Skip to content
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

Don't tint editor bottom panel icons when hovered or pressed #98765

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions editor/editor_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ class EditorLog : public HBoxContainer {
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));
Expand Down
7 changes: 7 additions & 0 deletions editor/themes/editor_theme_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Comment on lines +1906 to +1907
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this meant to be the same thing as the lightened() function?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, more or less. It's slightly different but probably doesn't matter here.

That said, this may be better to harmonize in a different PR since we use color multiplication all over the place in EditorThemeManager right now.

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.
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions scene/gui/file_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading