-
Project: Allow undocking the Script editor and the Shader editor
-
Student: trollodel
-
Mentors: Hugo Locurcio (Calinou), Michael Alexsander (Yeldham)
-
PR: #62378
The work done for the project adds the ability to detach the code editor, and improves and harmonizes the existing Docks undocking.
It aims to provide a good start for multi-window related enhancements.
-
Allow to undock the Script and Shader editor. The feature can be deactivated from the project settings.
-
Allow to undock the Script and Shader editor using a shortcut (not bound by default), a command palette action, and a button for each editor.
-
Focus the Script editor when the "Script" button is pressed.
-
Add a UI to choose the desired screen for the Docks, Script and Shader editor, activatable by right-clicking the "Make Floating" button.
-
Allow to save the current window layout for undocked windows (excluding popups). The behavior is enabled by default, but can be disabled in the project settings.
-
When undocking, the window position and size are calculated using the position and size of the docked editor/dock.
-
In alternative to the above behavior, it's possible to always maximize the window when undocking through an editor setting.
More content content can be found in the linked pull request.
Several design decisions were taken to simplify the work, standardize the behaviors, and in general, try to align with the current code and design.
- Only minimal refactoring was done to make the features work. All the new code is almost transparent to the existing one, and can be removed easily.
- Behaviors were standardized by abstracting window management in a dedicated class. Client code only needs to handle integration and window layout calculations.
- The code necessary to undock a Control is easily portable to other controls. As an example, the Script editor (a viewport) and the Shader editor (a bottom panel) uses similar code to implement undocking.
The features planned in the proposal were completed, with some extras. The following tasks were left to do:
-
Bug fixing: While some bugs were already found during development, there are other bugs unknown.
-
Keep the pull request updated to be evaluated after the 4.0 release. This is what I propose in the proposal.
-
Extend the undocking features to all relevant UIs. This needs to be desired in the organization to be done.
Note to self: don't delete this gist