Skip to content

Fix TabContainer Editor theming and remove Debugger style hacks #107395

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lodetrick
Copy link
Contributor

@lodetrick lodetrick commented Jun 11, 2025

See: #106164 (comment), #104676 (comment)

This PR fixes a bug in the TabContainer theming, where make_flat_stylebox(p_config.dark_color_1, 0, 0, 0, 0, p_config.corner_radius * EDSCALE) was called to create the stylebox for the TabBar background, but make_flat_stylebox multiplies all the input values by EDSCALE, so EDSCALE was incorrectly applied twice. With the change applied, the tabbar_background stylebox completely covers the bottom panel, meaning that there is no need for the negative extended margin that the Debugger's hack used previously, just the zero margins.

This allows for the hacks used to create the Debugger panel's margins (the BottomPanelDebuggerOverride stylebox) to be removed completely.

@AThousandShips AThousandShips added this to the 4.x milestone Jun 11, 2025
@lodetrick lodetrick changed the title Fix TabBar Margins and Generalize Debugger Hack Fix TabContainer theming and generalize debugger dock hack Jun 11, 2025
@lodetrick lodetrick force-pushed the bottom-panel-margin-fixes branch from 1f0c792 to 2602148 Compare June 11, 2025 17:08
@KoBeWi
Copy link
Member

KoBeWi commented Jun 11, 2025

This affects all bottom panel nodes that extend MarginContainer. Aside from the debugger, there is also TileSet editor and Shader editor.
image
vs
image

@lodetrick lodetrick requested a review from a team as a code owner June 11, 2025 21:13
@lodetrick
Copy link
Contributor Author

lodetrick commented Jun 11, 2025

Thanks for pointing that out, I just made it so theres only one BottomPanel stylebox with normal margins, and the Debugger panel now affects the top margin. This fully removes the extra cases in BottomPanel and the extra StyleBox.

@lodetrick lodetrick changed the title Fix TabContainer theming and generalize debugger dock hack Fix TabContainer Editor theming Jun 11, 2025
@lodetrick lodetrick changed the title Fix TabContainer Editor theming Fix TabContainer Editor theming and remove Debugger style hacks Jun 11, 2025
@lodetrick lodetrick force-pushed the bottom-panel-margin-fixes branch from 9da8da3 to 100002a Compare June 14, 2025 06:49
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine.
Once we have EditorDock class, this could be probably automatic.

@KoBeWi KoBeWi modified the milestones: 4.x, 4.6 Jun 24, 2025
@lodetrick lodetrick force-pushed the bottom-panel-margin-fixes branch from 100002a to 78045df Compare July 7, 2025 23:53
@lodetrick
Copy link
Contributor Author

lodetrick commented Jul 7, 2025

While working on another PR I realized that I missed a reference to the deleted stylebox in editor_node.cpp, so I just pushed to remove that. I checked and there are no more references.

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

Successfully merging this pull request may close these issues.

3 participants