Merge branch 'ThePhantomMask-AddDropdownHighlightedColor'
This commit is contained in:
@@ -303,6 +303,12 @@ namespace FlaxEngine.GUI
|
|||||||
[EditorDisplay("Text Style"), EditorOrder(2023), ExpandGroups]
|
[EditorDisplay("Text Style"), EditorOrder(2023), ExpandGroups]
|
||||||
public Color TextColor { get; set; }
|
public Color TextColor { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the color used to display highlighted text.
|
||||||
|
/// </summary>
|
||||||
|
[EditorDisplay("Text Style"), EditorOrder(2024), ExpandGroups]
|
||||||
|
public Color TextColorHighlighted { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the horizontal text alignment within the control bounds.
|
/// Gets or sets the horizontal text alignment within the control bounds.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -386,6 +392,7 @@ namespace FlaxEngine.GUI
|
|||||||
var style = Style.Current;
|
var style = Style.Current;
|
||||||
Font = new FontReference(style.FontMedium);
|
Font = new FontReference(style.FontMedium);
|
||||||
TextColor = style.Foreground;
|
TextColor = style.Foreground;
|
||||||
|
TextColorHighlighted = style.Foreground;
|
||||||
BackgroundColor = style.BackgroundNormal;
|
BackgroundColor = style.BackgroundNormal;
|
||||||
BackgroundColorHighlighted = BackgroundColor;
|
BackgroundColorHighlighted = BackgroundColor;
|
||||||
BackgroundColorSelected = BackgroundColor;
|
BackgroundColorSelected = BackgroundColor;
|
||||||
@@ -587,8 +594,8 @@ namespace FlaxEngine.GUI
|
|||||||
X = margin,
|
X = margin,
|
||||||
Size = new Float2(size.X - margin, size.Y),
|
Size = new Float2(size.X - margin, size.Y),
|
||||||
Font = Font,
|
Font = Font,
|
||||||
TextColor = Color.White * 0.9f,
|
TextColor = TextColor * 0.9f,
|
||||||
TextColorHighlighted = Color.White,
|
TextColorHighlighted = TextColorHighlighted,
|
||||||
HorizontalAlignment = HorizontalAlignment,
|
HorizontalAlignment = HorizontalAlignment,
|
||||||
VerticalAlignment = VerticalAlignment,
|
VerticalAlignment = VerticalAlignment,
|
||||||
Text = _items[i],
|
Text = _items[i],
|
||||||
@@ -749,7 +756,7 @@ namespace FlaxEngine.GUI
|
|||||||
// Draw text of the selected item
|
// Draw text of the selected item
|
||||||
var textRect = new Rectangle(margin, 0, clientRect.Width - boxSize - 2.0f * margin, clientRect.Height);
|
var textRect = new Rectangle(margin, 0, clientRect.Width - boxSize - 2.0f * margin, clientRect.Height);
|
||||||
Render2D.PushClip(textRect);
|
Render2D.PushClip(textRect);
|
||||||
var textColor = TextColor;
|
var textColor = (IsMouseOver || IsNavFocused) ? TextColorHighlighted : TextColor;
|
||||||
string text = _items[_selectedIndex];
|
string text = _items[_selectedIndex];
|
||||||
string format = TextFormat != null ? TextFormat : null;
|
string format = TextFormat != null ? TextFormat : null;
|
||||||
if (!string.IsNullOrEmpty(format))
|
if (!string.IsNullOrEmpty(format))
|
||||||
|
|||||||
Reference in New Issue
Block a user