From 70cdfc4c5e20af7459d4e2148dab38458150454f Mon Sep 17 00:00:00 2001 From: passivestar <60579014+passivestar@users.noreply.github.com> Date: Sun, 16 Jun 2024 14:00:55 +0400 Subject: [PATCH] Allow theming movie writer button icon color --- editor/gui/editor_run_bar.cpp | 7 ++++--- editor/themes/editor_theme_manager.cpp | 8 +++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/editor/gui/editor_run_bar.cpp b/editor/gui/editor_run_bar.cpp index af044cbfce0d..4cc2d1145ed9 100644 --- a/editor/gui/editor_run_bar.cpp +++ b/editor/gui/editor_run_bar.cpp @@ -66,9 +66,10 @@ void EditorRunBar::_notification(int p_what) { write_movie_button->set_icon(get_editor_theme_icon(SNAME("MainMovieWrite"))); // This button behaves differently, so color it as such. write_movie_button->begin_bulk_theme_override(); - write_movie_button->add_theme_color_override("icon_normal_color", Color(1, 1, 1, 0.7)); - write_movie_button->add_theme_color_override("icon_pressed_color", Color(0, 0, 0, 0.84)); - write_movie_button->add_theme_color_override("icon_hover_color", Color(1, 1, 1, 0.9)); + write_movie_button->add_theme_color_override("icon_normal_color", get_theme_color(SNAME("movie_writer_icon_normal"), EditorStringName(EditorStyles))); + write_movie_button->add_theme_color_override("icon_pressed_color", get_theme_color(SNAME("movie_writer_icon_pressed"), EditorStringName(EditorStyles))); + write_movie_button->add_theme_color_override("icon_hover_color", get_theme_color(SNAME("movie_writer_icon_hover"), EditorStringName(EditorStyles))); + write_movie_button->add_theme_color_override("icon_hover_pressed_color", get_theme_color(SNAME("movie_writer_icon_hover_pressed"), EditorStringName(EditorStyles))); write_movie_button->end_bulk_theme_override(); } break; } diff --git a/editor/themes/editor_theme_manager.cpp b/editor/themes/editor_theme_manager.cpp index 10b7c649993a..b5ad674a8d09 100644 --- a/editor/themes/editor_theme_manager.cpp +++ b/editor/themes/editor_theme_manager.cpp @@ -1858,7 +1858,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref &p_theme editor_spin_label_bg->set_border_width_all(0); p_theme->set_stylebox("label_bg", "EditorSpinSlider", editor_spin_label_bg); - // Launch Pad and Play buttons + // Launch Pad and Play buttons. Ref style_launch_pad = make_flat_stylebox(p_config.dark_color_1, 2 * EDSCALE, 0, 2 * EDSCALE, 0, p_config.corner_radius); style_launch_pad->set_corner_radius_all(p_config.corner_radius * EDSCALE); p_theme->set_stylebox("LaunchPadNormal", EditorStringName(EditorStyles), style_launch_pad); @@ -1878,6 +1878,12 @@ void EditorThemeManager::_populate_editor_styles(const Ref &p_theme style_write_movie_button->set_content_margin(SIDE_RIGHT, 0); style_write_movie_button->set_expand_margin(SIDE_RIGHT, 2 * EDSCALE); p_theme->set_stylebox("MovieWriterButtonPressed", EditorStringName(EditorStyles), style_write_movie_button); + + // Movie writer button colors. + p_theme->set_color("movie_writer_icon_normal", EditorStringName(EditorStyles), Color(1, 1, 1, 0.7)); + p_theme->set_color("movie_writer_icon_pressed", EditorStringName(EditorStyles), Color(0, 0, 0, 0.84)); + p_theme->set_color("movie_writer_icon_hover", EditorStringName(EditorStyles), Color(1, 1, 1, 0.9)); + p_theme->set_color("movie_writer_icon_hover_pressed", EditorStringName(EditorStyles), Color(0, 0, 0, 0.84)); } // Standard GUI variations.