diff --git a/Source/Editor/Editor.cs b/Source/Editor/Editor.cs index 7f0359331..308e40bc1 100644 --- a/Source/Editor/Editor.cs +++ b/Source/Editor/Editor.cs @@ -568,7 +568,8 @@ namespace FlaxEditor BackgroundColorSelected = Color.Transparent, BorderColorHighlighted = Color.Transparent, Text = "Save Now", - TooltipText = "Saves now and restarts the auto save timer." + TooltipText = "Saves now and restarts the auto save timer.", + TextColor = Style.Current.Statusbar.TextColor }; _saveNowButton.LocalX += 120; _saveNowButton.Clicked += () => _autoSaveNow = true; @@ -590,7 +591,8 @@ namespace FlaxEditor BackgroundColorSelected = Color.Transparent, BorderColorHighlighted = Color.Transparent, Text = "Cancel", - TooltipText = "Cancels this auto save." + TooltipText = "Cancels this auto save.", + TextColor = Style.Current.Statusbar.TextColor }; _cancelSaveButton.LocalX += 180; _cancelSaveButton.Clicked += () => diff --git a/Source/Editor/GUI/StatusBar.cs b/Source/Editor/GUI/StatusBar.cs index f8f7ae839..93c8f7218 100644 --- a/Source/Editor/GUI/StatusBar.cs +++ b/Source/Editor/GUI/StatusBar.cs @@ -33,7 +33,7 @@ namespace FlaxEditor.GUI /// /// Gets or sets the status text color /// - public Color TextColor { get; set; } = Style.Current.Foreground; + public Color TextColor { get; set; } = Style.Current.Statusbar.TextColor; /// /// Initializes a new instance of the class. diff --git a/Source/Editor/Modules/ProgressReportingModule.cs b/Source/Editor/Modules/ProgressReportingModule.cs index 16acd7f8b..22ae5ea98 100644 --- a/Source/Editor/Modules/ProgressReportingModule.cs +++ b/Source/Editor/Modules/ProgressReportingModule.cs @@ -129,6 +129,7 @@ namespace FlaxEditor.Modules else { Editor.UI.UpdateProgress(string.Empty, 0); + Editor.UI.UpdateStatusBar(); } } diff --git a/Source/Editor/Modules/UIModule.cs b/Source/Editor/Modules/UIModule.cs index 08ec09de8..a4a96d075 100644 --- a/Source/Editor/Modules/UIModule.cs +++ b/Source/Editor/Modules/UIModule.cs @@ -279,9 +279,9 @@ namespace FlaxEditor.Modules Color color; if (Editor.StateMachine.IsPlayMode) - color = Color.OrangeRed; + color = Style.Current.Statusbar.PlayMode; else - color = Style.Current.BackgroundSelected; + color = Style.Current.Statusbar.Normal; string text; if (_statusMessages != null && _statusMessages.Count != 0) @@ -293,6 +293,11 @@ namespace FlaxEditor.Modules else text = "Ready"; + if(ProgressVisible) + { + color = Style.Current.Statusbar.Loading; + } + StatusBar.Text = text; StatusBar.StatusColor = color; _contentStats = contentStats; @@ -338,7 +343,7 @@ namespace FlaxEditor.Modules internal void ProgressFailed(string message) { _progressFailed = true; - StatusBar.StatusColor = Color.Red; + StatusBar.StatusColor = Style.Current.Statusbar.Failed; StatusBar.Text = message; _outputLogButton.Visible = true; } @@ -391,6 +396,10 @@ namespace FlaxEditor.Modules { UpdateStatusBar(); } + else if(ProgressVisible) + { + UpdateStatusBar(); + } } private class CustomWindowBorderControl : Control @@ -753,6 +762,7 @@ namespace FlaxEditor.Modules AnchorPreset = AnchorPresets.HorizontalStretchMiddle, Parent = progressPanel, Offsets = new Margin(progressBarRightMargin, progressBarWidth + progressBarLeftMargin + progressBarRightMargin, 0, 0), + TextColor = Style.Current.Statusbar.TextColor }; UpdateStatusBar(); diff --git a/Source/Editor/Options/OptionsModule.cs b/Source/Editor/Options/OptionsModule.cs index 68aa11626..4584395be 100644 --- a/Source/Editor/Options/OptionsModule.cs +++ b/Source/Editor/Options/OptionsModule.cs @@ -244,6 +244,15 @@ namespace FlaxEditor.Options CollectionBackgroundColor = Color.FromBgra(0x14CCCCCC), ProgressNormal = Color.FromBgra(0xFF0ad328), + Statusbar = new Style.StatusbarStyle() + { + TextColor = Color.White, + Normal = Color.FromBgra(0xFF007ACC), + PlayMode = Color.ParseHex("#2f9135"), + Failed = Color.ParseHex("#9c2424"), + Loading = Color.ParseHex("#2d2d30") + }, + // Fonts FontTitle = options.Interface.TitleFont.GetFont(), FontLarge = options.Interface.LargeFont.GetFont(), diff --git a/Source/Engine/Scripting/Scripting.cs b/Source/Engine/Scripting/Scripting.cs index 68da64bf7..4215f09b3 100644 --- a/Source/Engine/Scripting/Scripting.cs +++ b/Source/Engine/Scripting/Scripting.cs @@ -277,6 +277,14 @@ namespace FlaxEngine TextBoxBackgroundSelected = Color.FromBgra(0xFF3F3F46), CollectionBackgroundColor = Color.FromBgra(0x14CCCCCC), SharedTooltip = new Tooltip(), + Statusbar = new Style.StatusbarStyle() + { + TextColor = Color.White, + Normal = Color.FromBgra(0xFF007ACC), + PlayMode = Color.ParseHex("#2f9135"), + Failed = Color.ParseHex("#9c2424"), + Loading = Color.ParseHex("#2d2d30") + } }; style.DragWindow = style.BackgroundSelected * 0.7f; diff --git a/Source/Engine/UI/GUI/Style.cs b/Source/Engine/UI/GUI/Style.cs index fac65e22f..c98c37b78 100644 --- a/Source/Engine/UI/GUI/Style.cs +++ b/Source/Engine/UI/GUI/Style.cs @@ -164,6 +164,12 @@ namespace FlaxEngine.GUI [EditorOrder(200)] public Color ProgressNormal; + /// + /// The status bar style + /// + [EditorOrder(210)] + public StatusbarStyle Statusbar; + /// /// The arrow right icon. /// @@ -241,5 +247,37 @@ namespace FlaxEngine.GUI /// [EditorOrder(340)] public Tooltip SharedTooltip; + + /// + /// Style for the Statusbar + /// + [System.Serializable, ShowInEditor] + public struct StatusbarStyle + { + /// + /// Color of the text in the Statusbar + /// + public Color TextColor; + + /// + /// Color of the Statusbar in its default state + /// + public Color Normal; + + /// + /// Color of the Statusbar when in Play Mode + /// + public Color PlayMode; + + /// + /// Color of the Statusbar when in loading state (e.g. when importing assets) + /// + public Color Loading; + + /// + /// Color of the Statusbar in its failed state (e.g. with compilation errors) + /// + public Color Failed; + } } }