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:
committed by
Paul Chote
parent
2dda2d7689
commit
7943f4deb6
@@ -292,13 +292,10 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
if (string.IsNullOrEmpty(baseName))
|
||||
return;
|
||||
|
||||
var variant = highlighted ? "-highlighted" : "";
|
||||
var state = disabled ? "-disabled" :
|
||||
pressed ? "-pressed" :
|
||||
hover ? "-hover" :
|
||||
"";
|
||||
var variantName = highlighted ? baseName + "-highlighted" : baseName;
|
||||
var imageName = WidgetUtils.GetStatefulImageName(variantName, disabled, pressed, hover);
|
||||
|
||||
WidgetUtils.DrawPanel(baseName + variant + state, rect);
|
||||
WidgetUtils.DrawPanel(imageName, rect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user