Merge pull request #98765 from Calinou/editor-bottom-panel-no-icon-tint

Don't tint editor bottom panel icons when hovered or pressed
This commit is contained in:
Rémi Verschelde 2024-11-29 22:01:55 +01:00
commit a1365dcb12
No known key found for this signature in database
GPG key ID: C3336907360768E1
3 changed files with 9 additions and 4 deletions

View file

@ -98,8 +98,6 @@ private:
toggle_button->set_pressed(true);
toggle_button->set_text(itos(message_count));
toggle_button->set_tooltip_text(TTR(p_tooltip));
// Don't tint the icon even when in "pressed" state.
toggle_button->add_theme_color_override("icon_color_pressed", Color(1, 1, 1, 1));
toggle_button->set_focus_mode(FOCUS_NONE);
// When toggled call the callback and pass the MessageType this button is for.
toggle_button->connect(SceneStringName(toggled), p_toggled_callback.bind(type));

View file

@ -1901,6 +1901,12 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
p_theme->set_stylebox(SceneStringName(pressed), "BottomPanelButton", menu_transparent_style);
p_theme->set_stylebox("hover_pressed", "BottomPanelButton", main_screen_button_hover);
p_theme->set_stylebox("hover", "BottomPanelButton", main_screen_button_hover);
// Don't tint the icon even when in "pressed" state.
p_theme->set_color("icon_pressed_color", "BottomPanelButton", Color(1, 1, 1, 1));
Color icon_hover_color = p_config.icon_normal_color * (p_config.dark_theme ? 1.15 : 1.0);
icon_hover_color.a = 1.0;
p_theme->set_color("icon_hover_color", "BottomPanelButton", icon_hover_color);
p_theme->set_color("icon_hover_pressed_color", "BottomPanelButton", icon_hover_color);
}
// Editor GUI widgets.
@ -1998,6 +2004,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
Color icon_hover_color = p_config.icon_normal_color * (p_config.dark_theme ? 1.15 : 1.0);
icon_hover_color.a = 1.0;
p_theme->set_color("icon_hover_color", "EditorLogFilterButton", icon_hover_color);
p_theme->set_color("icon_hover_pressed_color", "EditorLogFilterButton", icon_hover_color);
// When pressed, add a small bottom border to the buttons to better show their active state,
// similar to active tabs.

View file

@ -236,14 +236,14 @@ void FileDialog::_notification(int p_what) {
dir_prev->add_theme_color_override("icon_normal_color", theme_cache.icon_normal_color);
dir_prev->add_theme_color_override("icon_hover_color", theme_cache.icon_hover_color);
dir_prev->add_theme_color_override("icon_focus_color", theme_cache.icon_focus_color);
dir_prev->add_theme_color_override("icon_color_pressed", theme_cache.icon_pressed_color);
dir_prev->add_theme_color_override("icon_pressed_color", theme_cache.icon_pressed_color);
dir_prev->end_bulk_theme_override();
dir_next->begin_bulk_theme_override();
dir_next->add_theme_color_override("icon_normal_color", theme_cache.icon_normal_color);
dir_next->add_theme_color_override("icon_hover_color", theme_cache.icon_hover_color);
dir_next->add_theme_color_override("icon_focus_color", theme_cache.icon_focus_color);
dir_next->add_theme_color_override("icon_color_pressed", theme_cache.icon_pressed_color);
dir_next->add_theme_color_override("icon_pressed_color", theme_cache.icon_pressed_color);
dir_next->end_bulk_theme_override();
refresh->begin_bulk_theme_override();