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