Merge pull request #51220 from pycbouh/editor-mono-build-log

Fix the editor theme application for the Mono build log
This commit is contained in:
Rémi Verschelde 2021-08-03 21:45:33 +02:00 committed by GitHub
commit 769de0c35f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View file

@ -155,6 +155,7 @@ void editor_register_and_generate_icons(Ref<Theme> 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<Theme> 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<Theme> create_editor_theme(const Ref<Theme> 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);

View file

@ -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");
}
}
}
}