Add styling brush for progress bar
This commit is contained in:
@@ -74,7 +74,7 @@ namespace FlaxEngine.GUI
|
||||
/// <summary>
|
||||
/// Gets or sets the brush used for background drawing.
|
||||
/// </summary>
|
||||
[EditorOrder(2000), Tooltip("The brush used for background drawing.")]
|
||||
[EditorDisplay("Style"), EditorOrder(2000), Tooltip("The brush used for background drawing.")]
|
||||
public IBrush BackgroundBrush { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -108,6 +108,12 @@ namespace FlaxEngine.GUI
|
||||
[EditorDisplay("Style"), EditorOrder(2000), Tooltip("The color of the progress bar rectangle.")]
|
||||
public Color BarColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the brush used for progress bar drawing.
|
||||
/// </summary>
|
||||
[EditorDisplay("Style"), EditorOrder(2000), Tooltip("The brush used for progress bar drawing.")]
|
||||
public IBrush BarBrush { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ProgressBar"/> class.
|
||||
/// </summary>
|
||||
@@ -164,7 +170,10 @@ namespace FlaxEngine.GUI
|
||||
{
|
||||
var barRect = new Rectangle(0, 0, Width * progressNormalized, Height);
|
||||
BarMargin.ShrinkRectangle(ref barRect);
|
||||
Render2D.FillRectangle(barRect, BarColor);
|
||||
if (BarBrush != null)
|
||||
BarBrush.Draw(barRect, BarColor);
|
||||
else
|
||||
Render2D.FillRectangle(barRect, BarColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user