From 56278b17ee135df748891f426baacb939112e7f3 Mon Sep 17 00:00:00 2001 From: Phantom Date: Sun, 7 Dec 2025 16:53:43 +0100 Subject: [PATCH 1/3] Add Text Color Highlighted on Dropdown --- Source/Engine/UI/GUI/Common/Dropdown.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Engine/UI/GUI/Common/Dropdown.cs b/Source/Engine/UI/GUI/Common/Dropdown.cs index 868db4b89..7af0185aa 100644 --- a/Source/Engine/UI/GUI/Common/Dropdown.cs +++ b/Source/Engine/UI/GUI/Common/Dropdown.cs @@ -303,6 +303,12 @@ namespace FlaxEngine.GUI [EditorDisplay("Text Style"), EditorOrder(2023), ExpandGroups] public Color TextColor { get; set; } + /// + /// Gets or sets the color used to display highlighted text. + /// + [EditorDisplay("Text Style"), EditorOrder(2023), ExpandGroups] + public Color TextColorHighlighted { get; set; } + /// /// Gets or sets the horizontal text alignment within the control bounds. /// @@ -386,6 +392,7 @@ namespace FlaxEngine.GUI var style = Style.Current; Font = new FontReference(style.FontMedium); TextColor = style.Foreground; + TextColorHighlighted = style.Foreground; BackgroundColor = style.BackgroundNormal; BackgroundColorHighlighted = BackgroundColor; BackgroundColorSelected = BackgroundColor; @@ -749,7 +756,7 @@ namespace FlaxEngine.GUI // Draw text of the selected item var textRect = new Rectangle(margin, 0, clientRect.Width - boxSize - 2.0f * margin, clientRect.Height); Render2D.PushClip(textRect); - var textColor = TextColor; + var textColor = (IsMouseOver || IsNavFocused) ? TextColorHighlighted : TextColor; string text = _items[_selectedIndex]; string format = TextFormat != null ? TextFormat : null; if (!string.IsNullOrEmpty(format)) From a7e77f6e21f15e2ea2ab92891d2226d256f53169 Mon Sep 17 00:00:00 2001 From: Phantom Date: Sun, 7 Dec 2025 18:23:38 +0100 Subject: [PATCH 2/3] Update CreatePopupItem method -Modify the `TextColour` property to use a dynamic value based on `TextColour` multiplied by `0.9f` instead of a fixed value (`Colour.White * 0.9f`). -Modify the `TextColourHighlighted` property to use the dynamic value of `TextColourHighlighted` instead of a fixed value (`Colour.White`). --- Source/Engine/UI/GUI/Common/Dropdown.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Engine/UI/GUI/Common/Dropdown.cs b/Source/Engine/UI/GUI/Common/Dropdown.cs index 7af0185aa..0d24c5491 100644 --- a/Source/Engine/UI/GUI/Common/Dropdown.cs +++ b/Source/Engine/UI/GUI/Common/Dropdown.cs @@ -594,8 +594,8 @@ namespace FlaxEngine.GUI X = margin, Size = new Float2(size.X - margin, size.Y), Font = Font, - TextColor = Color.White * 0.9f, - TextColorHighlighted = Color.White, + TextColor = TextColor * 0.9f, + TextColorHighlighted = TextColorHighlighted, HorizontalAlignment = HorizontalAlignment, VerticalAlignment = VerticalAlignment, Text = _items[i], From ed50ce9c90197dca45e90f7cf8b90aad3a4d2242 Mon Sep 17 00:00:00 2001 From: Phantom Date: Sun, 7 Dec 2025 18:48:16 +0100 Subject: [PATCH 3/3] Change Dropdown's EditorOrder from 2023 to 2024 --- Source/Engine/UI/GUI/Common/Dropdown.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Engine/UI/GUI/Common/Dropdown.cs b/Source/Engine/UI/GUI/Common/Dropdown.cs index 0d24c5491..a227e5acd 100644 --- a/Source/Engine/UI/GUI/Common/Dropdown.cs +++ b/Source/Engine/UI/GUI/Common/Dropdown.cs @@ -306,7 +306,7 @@ namespace FlaxEngine.GUI /// /// Gets or sets the color used to display highlighted text. /// - [EditorDisplay("Text Style"), EditorOrder(2023), ExpandGroups] + [EditorDisplay("Text Style"), EditorOrder(2024), ExpandGroups] public Color TextColorHighlighted { get; set; } ///