-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow docks to be closed and opened #89017
Conversation
In GIMP the menu is called "Windows". I think this doesn't really deserve a separate top level menu. It could be inside Editor, e.g. next to the layout button. |
6aa65ee
to
a335b09
Compare
Rebased since #88003 is merged. Added checkboxes. This helps see what is closed and what is not. Incorporated the shortcut, but the shortcut name should probably be changed. I think I should also make the disabled docks from EditorFeatures be disabled items instead of just not present. |
Yeah checkbox totally implies that you can toggle it, so it should display differently. You could make open docks show with bold text or using accent color, or show some other icon than checkbox. Maybe eye icon for open docks (to imply focus) and "open" icon for closed docks, to imply opening? As for the shortcut, you could make the item display the dock's name instead of shortcut name. I think it's fine to reuse it, because it works correctly (i.e. reopens/focuses dock on the side and toggles dock on bottom). |
a335b09
to
2cb9a4b
Compare
I don't think I can make them bold or colored, PopupMenu items don't support BBCode and they share the same theme. The open eye icon ( Here's what it looks like with Let me know if there are better icons or if I should try anything else. For reference, what other engines do: Unity has the menu items always open a new instance of the dock. Unreal has checkboxes to open and close docks, and they are in submenus for a fixed number of multiple instances. |
Hmmm, in GIMP the docks menu simply displays the list of docks with their own icons, without providing information whether they are currently opened. Not sure how it is in other software. |
2cb9a4b
to
610c45f
Compare
610c45f
to
3539e5b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally (rebased on top of master
29b3d9e), it works as expected.
Code looks good to me as well (outside of the suggestions).
3539e5b
to
860bff9
Compare
You should use |
EditorDockManager doesn't have get that notification, and putting it into the existing one in DockContextPopup feels weird since its an unrelated child class. |
Then signal is fine. |
Thanks! |
I think the menu bar should stay after clicking, otherwise when I adjust multiple times, I will have to open the menu bar repeatedly, which will become very troublesome. |
Currently, clicking on the menu for an open dock only focuses on the dock, so the menu should close in that case.
|
if (!dock.value.open) { | ||
docks_menu->set_item_icon_modulate(id, closed_icon_color_mod); | ||
} | ||
docks_menu->set_item_disabled(id, !dock.value.enabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Features that are disabled via Feature Profiles usually get hidden in the UI, not disabled. Seems like a simple change to skip adding the menu item in this case, instead of disabling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I forgot about this for a while.
Docks can be closed through their context menu, and reopened through the new
Window
menu.If a dock is already open, clicking on it in the
Window
menu will focus on it.Dock layouts can be saved with closed tabs. This helps with some of the use cases in godotengine/godot-proposals#1441.
Added dock slot
DOCK_SLOT_NONE
. Using this withadd_control_to_dock
allows the dock to not be opened immediately, it will be closed by default. When it is opened from theWindow
menu, it will appear floating.Internally, renamed
add_control_to_dock
toadd_dock
andremove_control_from_dock
toremove_dock
. This is because I want to unify the language used better, the Control that is being added and removed is the dock, and it is added to a dock slot/dock container. However, I didn't change it in the editor plugin since it would break compat. I want to add it as the new names in EditorInterface in a future PR.Closed docks aren't unloaded, they are just removed from any TabContainers and hidden.
After #88081, shortcuts can be added to open docks.
Updated (import closed, history disabled):