From b7b8213179ff05edbea38a3385e1af9efe2ccdd4 Mon Sep 17 00:00:00 2001 From: Luke Schneider Date: Fri, 29 Sep 2023 07:43:59 -0500 Subject: [PATCH] Some additional fixes to light theme support Fixed some issues with light theme support: 1) Icons in content tree nodes (Folder icons) now use the foreground color. I did not find a case where the content tree is used for other icons. 2) The asset picker now uses the Background Normal color (instead of a very transparent dark gray) for the background, and Orange for the text. Did not seem like it warranted adding a new color, and Orange works in both dark and light styles. 3) The platform selector icons are now hard-coded instead of based on the style. This may sound odd, but the icons are colored, so they should always use White as the fully active color. Previously they worked with a dark theme because the Foreground was set to white. 4) Fixed the CollectionBackgroundColor in the light theme being dark gray instead of light gray like it should be. This fixes certain lists of things having a dark background in the light theme. --- Source/Editor/Content/Tree/ContentTreeNode.cs | 1 + Source/Editor/GUI/AssetPicker.cs | 4 ++-- Source/Editor/GUI/PlatformSelector.cs | 7 ++++--- Source/Editor/Options/OptionsModule.cs | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/Editor/Content/Tree/ContentTreeNode.cs b/Source/Editor/Content/Tree/ContentTreeNode.cs index 2f6651b14..0c0fc6a51 100644 --- a/Source/Editor/Content/Tree/ContentTreeNode.cs +++ b/Source/Editor/Content/Tree/ContentTreeNode.cs @@ -86,6 +86,7 @@ namespace FlaxEditor.Content Folder.ParentFolder = parent.Folder; Parent = parent; } + IconColor = Style.Current.Foreground; } /// diff --git a/Source/Editor/GUI/AssetPicker.cs b/Source/Editor/GUI/AssetPicker.cs index 3e5d22eb0..87346d817 100644 --- a/Source/Editor/GUI/AssetPicker.cs +++ b/Source/Editor/GUI/AssetPicker.cs @@ -395,8 +395,8 @@ namespace FlaxEditor.GUI else { // No element selected - Render2D.FillRectangle(iconRect, new Color(0.2f)); - Render2D.DrawText(style.FontMedium, "No asset\nselected", iconRect, Color.Wheat, TextAlignment.Center, TextAlignment.Center, TextWrapping.NoWrap, 1.0f, Height / DefaultIconSize); + Render2D.FillRectangle(iconRect, Style.Current.BackgroundNormal); + Render2D.DrawText(style.FontMedium, "No asset\nselected", iconRect, Color.Orange, TextAlignment.Center, TextAlignment.Center, TextWrapping.NoWrap, 1.0f, Height / DefaultIconSize); } // Check if drag is over diff --git a/Source/Editor/GUI/PlatformSelector.cs b/Source/Editor/GUI/PlatformSelector.cs index 1e03a9677..a29f62805 100644 --- a/Source/Editor/GUI/PlatformSelector.cs +++ b/Source/Editor/GUI/PlatformSelector.cs @@ -100,9 +100,10 @@ namespace FlaxEditor.GUI AutoResize = true; Offsets = new Margin(0, 0, 0, IconSize); - _mouseOverColor = style.Foreground; - _selectedColor = style.Foreground; - _defaultColor = style.ForegroundGrey; + // Ignoring style on purpose (style would make sense if the icons were white, but they are colored) + _mouseOverColor = new Color(0.8f, 0.8f, 0.8f, 1f); + _selectedColor = Color.White; + _defaultColor = new Color(0.7f, 0.7f, 0.7f, 0.5f); for (int i = 0; i < platforms.Length; i++) { diff --git a/Source/Editor/Options/OptionsModule.cs b/Source/Editor/Options/OptionsModule.cs index da293ec47..4ed3b02e1 100644 --- a/Source/Editor/Options/OptionsModule.cs +++ b/Source/Editor/Options/OptionsModule.cs @@ -304,7 +304,7 @@ namespace FlaxEditor.Options BorderNormal = new Color(0.59f, 0.59f, 0.64f, 1f), TextBoxBackground = new Color(0.75f, 0.75f, 0.81f, 1f), TextBoxBackgroundSelected = new Color(0.73f, 0.73f, 0.80f, 1f), - CollectionBackgroundColor = new Color(0.25f, 0.25f, 0.25f, 1f), + CollectionBackgroundColor = new Color(0.85f, 0.85f, 0.88f, 1f), ProgressNormal = new Color(0.03f, 0.65f, 0.12f, 1f), // Fonts