Merge branch 'Statusbar-Imrpovements' of https://github.com/davevanegdom/FlaxEngine into davevanegdom-Statusbar-Imrpovements

This commit is contained in:
Wojtek Figat
2023-10-01 12:01:31 +02:00
5 changed files with 54 additions and 3 deletions

View File

@@ -129,6 +129,7 @@ namespace FlaxEditor.Modules
else
{
Editor.UI.UpdateProgress(string.Empty, 0);
Editor.UI.UpdateStatusBar();
}
}

View File

@@ -285,7 +285,7 @@ namespace FlaxEditor.Modules
Color color;
if (Editor.StateMachine.IsPlayMode)
color = Color.OrangeRed;
color = Style.Current.Statusbar.PlayMode;
else
color = Style.Current.BackgroundSelected;
@@ -299,6 +299,11 @@ namespace FlaxEditor.Modules
else
text = "Ready";
if(ProgressVisible)
{
color = Style.Current.Statusbar.Loading;
}
StatusBar.Text = text;
StatusBar.StatusColor = color;
_contentStats = contentStats;
@@ -344,7 +349,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;
}
@@ -397,6 +402,10 @@ namespace FlaxEditor.Modules
{
UpdateStatusBar();
}
else if(ProgressVisible)
{
UpdateStatusBar();
}
}
private class CustomWindowBorderControl : Control
@@ -778,7 +787,7 @@ namespace FlaxEditor.Modules
HorizontalAlignment = TextAlignment.Far,
AnchorPreset = AnchorPresets.HorizontalStretchMiddle,
Parent = progressPanel,
Offsets = new Margin(progressBarRightMargin, progressBarWidth + progressBarLeftMargin + progressBarRightMargin, 0, 0),
Offsets = new Margin(progressBarRightMargin, progressBarWidth + progressBarLeftMargin + progressBarRightMargin, 0, 0)
};
UpdateStatusBar();

View File

@@ -244,6 +244,13 @@ namespace FlaxEditor.Options
CollectionBackgroundColor = Color.FromBgra(0x14CCCCCC),
ProgressNormal = Color.FromBgra(0xFF0ad328),
Statusbar = new Style.StatusbarStyle()
{
PlayMode = Color.FromBgra(0xFF2F9135),
Failed = Color.FromBgra(0xFF9C2424),
Loading = Color.FromBgra(0xFF2D2D30)
},
// Fonts
FontTitle = options.Interface.TitleFont.GetFont(),
FontLarge = options.Interface.LargeFont.GetFont(),

View File

@@ -282,6 +282,12 @@ namespace FlaxEngine
TextBoxBackgroundSelected = Color.FromBgra(0xFF3F3F46),
CollectionBackgroundColor = Color.FromBgra(0x14CCCCCC),
SharedTooltip = new Tooltip(),
Statusbar = new Style.StatusbarStyle()
{
PlayMode = Color.FromBgra(0xFF2F9135),
Failed = Color.FromBgra(0xFF9C2424),
Loading = Color.FromBgra(0xFF2D2D30)
}
};
style.DragWindow = style.BackgroundSelected * 0.7f;

View File

@@ -164,6 +164,12 @@ namespace FlaxEngine.GUI
[EditorOrder(200)]
public Color ProgressNormal;
/// <summary>
/// The status bar style
/// </summary>
[EditorOrder(210)]
public StatusbarStyle Statusbar;
/// <summary>
/// The arrow right icon.
/// </summary>
@@ -241,5 +247,27 @@ namespace FlaxEngine.GUI
/// </summary>
[EditorOrder(340)]
public Tooltip SharedTooltip;
/// <summary>
/// Style for the Statusbar
/// </summary>
[System.Serializable, ShowInEditor]
public struct StatusbarStyle
{
/// <summary>
/// Color of the Statusbar when in Play Mode
/// </summary>
public Color PlayMode;
/// <summary>
/// Color of the Statusbar when in loading state (e.g. when importing assets)
/// </summary>
public Color Loading;
/// <summary>
/// Color of the Statusbar in its failed state (e.g. with compilation errors)
/// </summary>
public Color Failed;
}
}
}