Improve Dropdown Control- #4102

Merges #4102
This commit is contained in:
Phantom
2026-09-20 00:08:13 +02:00
committed by mafiesto4
parent 2a0589b4c1
commit d1148fdcfd
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -112,6 +112,16 @@ namespace FlaxEngine
/// </summary>
public float ValuesSum => R + G + B + A;
/// <summary>
/// Returns true if color is fully transparent (all components are equal zero).
/// </summary>
public bool IsTransparent => Mathf.IsZero(R + G + B + A);
/// <summary>
/// Returns true if color has opacity channel in use (different from 1).
/// </summary>
public bool HasOpacity => !Mathf.IsOne(A);
/// <summary>
/// Constructs a new Color with given r,g,b,a component.
/// </summary>
+1 -1
View File
@@ -595,7 +595,7 @@ namespace FlaxEngine.GUI
Size = new Float2(size.X - margin, size.Y),
Font = Font,
TextColor = TextColor * 0.9f,
TextColorHighlighted = BackgroundColorSelected.Brightness < 0.05f ? Color.Lerp(TextColorHighlighted, Color.White, 0.3f) : TextColorHighlighted,
TextColorHighlighted = (Mathf.IsZero(BackgroundColorSelected.Brightness) || BackgroundColorSelected.IsTransparent) ? Color.Lerp(TextColorHighlighted, Color.White, 0.3f) : TextColorHighlighted,
HorizontalAlignment = HorizontalAlignment,
VerticalAlignment = VerticalAlignment,
Text = _items[i],