Merge branch 'xxSeys1-SliderHoverColor'
This commit is contained in:
@@ -71,20 +71,25 @@ namespace FlaxEditor.GUI.Input
|
|||||||
public Action ValueChanged;
|
public Action ValueChanged;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The color of the slider track line
|
/// The color of the slider track line.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Color TrackLineColor { get; set; }
|
public Color TrackLineColor { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The color of the slider thumb when it's not selected
|
/// The color of the slider thumb when it's not selected.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Color ThumbColor { get; set; }
|
public Color ThumbColor { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The color of the slider thumb when it's selected
|
/// The color of the slider thumb when it's selected.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Color ThumbColorSelected { get; set; }
|
public Color ThumbColorSelected { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The color of the slider thumb when it's hovered.
|
||||||
|
/// </summary>
|
||||||
|
public Color ThumbColorHovered { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether user is using a slider.
|
/// Gets a value indicating whether user is using a slider.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -112,6 +117,7 @@ namespace FlaxEditor.GUI.Input
|
|||||||
TrackLineColor = style.BackgroundHighlighted;
|
TrackLineColor = style.BackgroundHighlighted;
|
||||||
ThumbColor = style.BackgroundNormal;
|
ThumbColor = style.BackgroundNormal;
|
||||||
ThumbColorSelected = style.BackgroundSelected;
|
ThumbColorSelected = style.BackgroundSelected;
|
||||||
|
ThumbColorHovered = style.BackgroundHighlighted;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateThumb()
|
private void UpdateThumb()
|
||||||
@@ -151,7 +157,8 @@ namespace FlaxEditor.GUI.Input
|
|||||||
Render2D.FillRectangle(lineRect, TrackLineColor);
|
Render2D.FillRectangle(lineRect, TrackLineColor);
|
||||||
|
|
||||||
// Draw thumb
|
// Draw thumb
|
||||||
Render2D.FillRectangle(_thumbRect, _isSliding ? ThumbColorSelected : ThumbColor);
|
bool mouseOverThumb = _thumbRect.Contains(PointFromWindow(Root.MousePosition));
|
||||||
|
Render2D.FillRectangle(_thumbRect, _isSliding ? ThumbColorSelected : mouseOverThumb ? ThumbColorHovered : ThumbColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
Reference in New Issue
Block a user