-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Fix PopupPanel and PopupMenu menu styles #96518
Conversation
@@ -1331,17 +1334,17 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the | |||
|
|||
Ref<StyleBoxLine> style_popup_separator(memnew(StyleBoxLine)); | |||
style_popup_separator->set_color(p_config.separator_color); | |||
style_popup_separator->set_grow_begin(p_config.popup_margin - MAX(Math::round(EDSCALE), p_config.border_width)); | |||
style_popup_separator->set_grow_end(p_config.popup_margin - MAX(Math::round(EDSCALE), p_config.border_width)); | |||
style_popup_separator->set_grow_begin(Math::round(EDSCALE) - MAX(Math::round(EDSCALE), p_config.border_width)); |
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.
This looks sus. There is EDSCALE on both sides, so this has high chance of being 0. Though not sure what's the expected value here.
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 some popups and they visually look fine with default settings. The border is an improvement.
0c75c1f
to
549bffd
Compare
Thanks! |
Fixes: #96517
Edit: Fixes: #67657 (border part)
This makes popup menus using PopupPanel and PopupMenus have same base look, as it is in Godot 3.
Panel border
Adding a default border to the PopupPanel to make it easier to differentiate from the background.
I believe this was removed in PR #45607 and then added back for PopupMenus in PR #48655 (also removed support for Border Size on PopupMenus)
Before:

After:

Border color
In Godot 3 both styles of popup menus uses the same border color, light on dark theme and dark border on light themes.
Godot 3 example:
Currently Godot 4 uses dark border for PopupMenus and with Border Size in Editor Settings set to 1 or 2 PopupPanel uses a light border in dark themes.
Before: with border size set
After: border size is set to deafult
Because the PopupMenu border is visible by default I went with that color for both in this PR.
Maybe there could be a editor setting for changing outline color, but that would need to be a proposal in that case.
Border Size
In Godot 3 both PopupPanel and PopupMenus uses the Border Size.
PopupPanel uses this already.
This PR also changes PopupMenus to use the editor setting Border Size for the outer border.
Separator width
Due to the change of using Border Size the separator line in PopupMenus was much more obvious that it overlaps the outer border. So this was also changed
Before:

After:

Compact
Before:

After:
