You're breathtaking!

This commit is contained in:
Wojtek Figat
2020-12-07 23:40:54 +01:00
commit 6fb9eee74c
5143 changed files with 1153594 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.GUI
{
/// <summary>
/// Status strip GUI control.
/// </summary>
/// <seealso cref="FlaxEngine.GUI.ContainerControl" />
public class StatusBar : ContainerControl
{
/// <summary>
/// The default height.
/// </summary>
public const int DefaultHeight = 22;
/// <summary>
/// Gets or sets the color of the status strip.
/// </summary>
public Color StatusColor
{
get => BackgroundColor;
set => BackgroundColor = value;
}
/// <summary>
/// Gets or sets the status text.
/// </summary>
public string Text { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="StatusBar"/> class.
/// </summary>
public StatusBar()
{
AutoFocus = false;
AnchorPreset = AnchorPresets.HorizontalStretchBottom;
}
/// <inheritdoc />
public override void Draw()
{
base.Draw();
var style = Style.Current;
// Draw size grip
if (Root is WindowRootControl window && !window.IsMaximized)
Render2D.DrawSprite(style.StatusBarSizeGrip, new Rectangle(Width - 12, 10, 12, 12), style.Foreground);
// Draw status text
Render2D.DrawText(style.FontSmall, Text, new Rectangle(4, 0, Width - 20, Height), style.Foreground, TextAlignment.Near, TextAlignment.Center);
}
}
}