Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@trollodel
Created September 12, 2022 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trollodel/fa95eb3abaa73b7d97d0f1cd06384e08 to your computer and use it in GitHub Desktop.
Save trollodel/fa95eb3abaa73b7d97d0f1cd06384e08 to your computer and use it in GitHub Desktop.
gsoc_2022_trollodel_final_report

GSOC'22 final report

  • Project: Allow undocking the Script editor and the Shader editor

  • Student: trollodel

  • Mentors: Hugo Locurcio (Calinou), Michael Alexsander (Yeldham)

  • PR: #62378

Description

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.

Feature added

  • 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.

A demonstration of the undocking capabilities

The screen selector. The starred screen is the current screen.

More content content can be found in the linked pull request.

Design decisions

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.

Future work

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.

@trollodel
Copy link
Author

Note to self: don't delete this gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment