Unify widget state image suffixes (disabled, pressed, hover, focus)

- Add a property for arrows image collection (in drop-downs, scrollbars
and production tabs)
- Add a property for separators image collection (in drop-downs)
- Add hover and disable states to the drop-down separator
- Unify button, textfield and checkbox state suffixes
This commit is contained in:
Ivaylo Draganov
2020-05-12 00:11:45 +03:00
committed by Paul Chote
parent 2dda2d7689
commit 7943f4deb6
15 changed files with 194 additions and 94 deletions

View File

@@ -566,10 +566,8 @@ namespace OpenRA.Mods.Common.Widgets
var cursorPosition = font.Measure(apparentText.Substring(0, CursorPosition));
var disabled = IsDisabled();
var state = disabled ? "textfield-disabled" :
HasKeyboardFocus ? "textfield-focused" :
Ui.MouseOverWidget == this || Children.Any(c => c == Ui.MouseOverWidget) ? "textfield-hover" :
"textfield";
var hover = Ui.MouseOverWidget == this || Children.Any(c => c == Ui.MouseOverWidget);
var state = WidgetUtils.GetStatefulImageName("textfield", disabled, false, hover, HasKeyboardFocus);
WidgetUtils.DrawPanel(state,
new Rectangle(pos.X, pos.Y, Bounds.Width, Bounds.Height));