From d3e413c6594c1bb84651901e1ce011ab79c6afec Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Tue, 3 Aug 2021 21:48:17 +0300 Subject: [PATCH] Fix the editor theme application for the Mono build log --- editor/editor_themes.cpp | 3 ++- .../GodotTools/GodotTools/Build/MSBuildPanel.cs | 14 +++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index f0cc1530ab8..0d714065e3f 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -155,6 +155,7 @@ void editor_register_and_generate_icons(Ref p_theme, bool p_dark_theme = ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#8da5f3", "#3d64dd"); // 2D ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#4b70ea", "#1a3eac"); // 2D Dark ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#8eef97", "#2fa139"); // Control + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffdd65", "#ca8a04"); // Node warning // Rainbow ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff4545", "#ff2929"); // Red @@ -229,7 +230,6 @@ void editor_register_and_generate_icons(Ref p_theme, bool p_dark_theme = exceptions.insert("StatusError"); exceptions.insert("StatusSuccess"); exceptions.insert("StatusWarning"); - exceptions.insert("NodeWarning"); exceptions.insert("OverbrightIndicator"); } @@ -1045,6 +1045,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_icon("tab", "TextEdit", theme->get_icon("GuiTab", "EditorIcons")); theme->set_icon("space", "TextEdit", theme->get_icon("GuiSpace", "EditorIcons")); theme->set_color("font_color", "TextEdit", font_color); + theme->set_color("font_readonly_color", "LineEdit", font_readonly_color); theme->set_color("caret_color", "TextEdit", font_color); theme->set_color("selection_color", "TextEdit", selection_color); diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs b/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs index ed69c2b833d..897f1b2822a 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs @@ -11,6 +11,7 @@ namespace GodotTools.Build { public BuildOutputView BuildOutputView { get; private set; } + private MenuButton buildMenuBtn; private Button errorsBtn; private Button warningsBtn; private Button viewLogBtn; @@ -131,7 +132,7 @@ namespace GodotTools.Build var toolBarHBox = new HBoxContainer {SizeFlagsHorizontal = (int)SizeFlags.ExpandFill}; AddChild(toolBarHBox); - var buildMenuBtn = new MenuButton {Text = "Build", Icon = GetThemeIcon("Play", "EditorIcons")}; + buildMenuBtn = new MenuButton {Text = "Build", Icon = GetThemeIcon("Play", "EditorIcons")}; toolBarHBox.AddChild(buildMenuBtn); var buildMenu = buildMenuBtn.GetPopup(); @@ -177,5 +178,16 @@ namespace GodotTools.Build BuildOutputView = new BuildOutputView(); AddChild(BuildOutputView); } + + public override void _Notification(int what) + { + base._Notification(what); + + if (what == NotificationThemeChanged) { + buildMenuBtn.Icon = GetThemeIcon("Play", "EditorIcons"); + errorsBtn.Icon = GetThemeIcon("StatusError", "EditorIcons"); + warningsBtn.Icon = GetThemeIcon("NodeWarning", "EditorIcons"); + } + } } }