Use new dock system for Shader Editor Dock#113181
Conversation
| if (file_menu->get_parent() != nullptr) { | ||
| file_menu->get_parent()->remove_child(file_menu); |
There was a problem hiding this comment.
Unrelated, but I wonder why the button isn't just made invisible?
There was a problem hiding this comment.
I don't like this but currently that single button gets transferred between all of the editors, so it needs to be reparented to the active editor. In the future it would probably be best to just put that logic and button in the ShaderEditor class
cc6b73c to
8100db5
Compare
|
Unless you think the vertical orientation is fine as you reviewed it earlier I think it won't be introduced just yet in this PR, I would want to reduce the size of the gutter and add a shortcut to toggle the minimap before I'd personally be comfortable with a vertical orientation. Although this is only an issue for small widths, so another option would be to temporarily have a "large" minimum width Edit: There is an existing editor setting to toggle the minimap, I don't know how much that impacts the issue |
c8ad651 to
4af933a
Compare
4af933a to
f72bc5f
Compare
|
Needs rebase. |
f72bc5f to
0d83637
Compare
There was a problem hiding this comment.
Tested locally, it works as expected. Code looks good to me.
I think we could allow moving it to a side dock if we automatically disable the minimap and file list while it's in a side dock. #113230 would also need to be merged to reduce the gutter's width.
Also, the Make Floating button in the general dock editor no longer has a screen selector like the old one had. For multi-monitor setups, this means you now need to move the shader editor window manually after making it floating. In the future, we should reintroduce a screen selector in the general dock editor to avoid regressing usability on this front.
PS: I wonder if people will be looking for the old Make Floating button now that it's been removed. The new way to do it is arguably harder to discover (3 vertical dots at the right of the bottom panel). Should we keep the existing button available during 1 minor version as a transition period, with a toast explaining the new way to make the shader editor floating?
Maybe let's see if it's really a problem first. We can reintroduce the button if there are bug reports about it. |
|
I think for the purpose of getting a basic implementation merged, the Shader dock should not be vertical in this PR. My reasoning is it would be a very large refactor to make it support changes on vertical layout (almost all of the plugin would need to be moved into a new class extending EditorDock, or have an external method to get updated when the layout is changed), and #113230 isn't merged yet, so it would take a while for a vertical PR to be merged. |
|
Thanks! |
|
That might be because of #113181 (comment) 🙃 |


See #113024
Upgraded the Shader Editor Dock to use the new system. I also added a
make_dock_floating()function inEditorDockManagerto force a dock to be floating through code.Now that this is a dock, I removed the internal floating logic and button to use the Dock methods. The dock has to be made floating by right-clicking the tab or using the shortcut. Since all docks should be made floating this is standard behavior.
My primary motive in removing the floating button is leaving the door open to refactors that might make individual shader file editors docks (ie able to edit multiple shaders on screen at once). Leaving the button in would necessitate moving almost the entirety of the plugin into a new class extending dock, which would have to be reversed if it were refactored to edit multiple shaders on screen at once.
I also reordered the constructor to be more in line with the rest of the editor.