Change Theme to EditorDock and add closable property#113108
Change Theme to EditorDock and add closable property#113108akien-mga merged 1 commit intogodotengine:masterfrom
closable property#113108Conversation
|
I am glad to see you were open to mention it, but the button has to stay, at least for now. The alternative is, for the sake of consistency and developer sanity, to display something special for every dock that can be closed but isn't global. That also sounds a bit unusual, but I guess there's going to be quite a few of them. |
|
Restored the button. |
| </member> | ||
| <member name="global" type="bool" setter="set_global" getter="is_global" default="true"> | ||
| If [code]true[/code], the dock appears in the [b]Editor > Editor Docks[/b] menu and can be closed. Non-global docks can still be closed using [method close]. | ||
| If [code]true[/code], the dock appears in the [b]Editor > Editor Docks[/b] menu and can be closed. Non-global docks can still be closed using [method close] or when [member closable] is [code]true[/code]. |
There was a problem hiding this comment.
We're starting to make exceptions to what "global" means in this context. Or just starting to make exceptions in general. The API is getting a bit wrangled. Can we not have both global and closable coexist without interfering with one another?
There was a problem hiding this comment.
global is true by default and closable is false. So if they were to co-exist, you'd need to enable closable every time you want the dock closable. There is no reason not to allow closing a dock that can be brought back using a menu.
Alternative I considered is a 3-state enum, something like Global, Closable, Non-Closable.
There was a problem hiding this comment.
You could begin discussing this on RocketChat. I personally think the if-elses and special cases required for both right now are unwieldy, so whatever the solution is, I welcome it.
I don't mind the enum myself but there is a possibility it'll become unreasonable as you keep porting more docks.
Is there any way to show it only when dock is not floating? |
| <member name="closable" type="bool" setter="set_closable" getter="is_closable" default="false"> | ||
| If [code]true[/code], the dock can be closed with the Close button in the context popup. Docks with [member global] enabled are always closable. | ||
| </member> |
There was a problem hiding this comment.
I was thinking that all transient docks should be closable by default in the future.
It's just some bottom docks that aren't closable that this would be needed for, or they could be just made global (Output, Debugger, Audio, Animation, Shader).
There was a problem hiding this comment.
Why would you want to close them though? They will disappear when you are not editing, and even if you close them, they will appear again when needed. It's futile.
Yes, but then you can't close it directly. You have to close the window then close the dock. Not sure if it's better. |
|
The discussion kind of went nowhere. Should I just remove the new property? I guess there is no harm in that, other than docks being closable for no useful reason. Though I'm not sure if it's expected that your dock can be closed at any time by the user, but the new signal allows to handle it. |
closable property
|
Thanks! |

Part of #113024
Changes Theme to Editor dock. I also added
closableproperty that allows non-global docks to be closed. Also added a relatedclosedsignal (emitted when the dock is closed with the button).From more controversial changes, I also removed the close button from Theme. The dock has to be closed by right-clicking the tab
godot.windows.editor.dev.x86_64_Fzhp3WuUsH.mp4
There are 2 downsides:
If it's a problem, I can restore the button, but then there are 2 ways to close the dock, and also code would be more complex.