Moves defaults for HotkeyEntryWidget to global settings in metrics.yaml.

This commit is contained in:
reaperrr
2013-11-19 01:41:32 +01:00
parent 394a2b5166
commit e73b3705c6
5 changed files with 17 additions and 5 deletions

View File

@@ -25,9 +25,9 @@ namespace OpenRA.Widgets
public Action OnLoseFocus = () => { };
public Func<bool> IsDisabled = () => false;
public Color TextColor = Color.White;
public Color DisabledColor = Color.Gray;
public string Font = "Regular";
public string Font = ChromeMetrics.Get<string>("HotkeyFont");
public Color TextColor = ChromeMetrics.Get<Color>("HotkeyColor");
public Color TextColorDisabled = ChromeMetrics.Get<Color>("HotkeyColorDisabled");
public HotkeyEntryWidget() {}
protected HotkeyEntryWidget(HotkeyEntryWidget widget)
@@ -35,7 +35,7 @@ namespace OpenRA.Widgets
{
Font = widget.Font;
TextColor = widget.TextColor;
DisabledColor = widget.DisabledColor;
TextColorDisabled = widget.TextColorDisabled;
VisualHeight = widget.VisualHeight;
}
@@ -126,7 +126,7 @@ namespace OpenRA.Widgets
Bounds.Width - LeftMargin - RightMargin, Bounds.Bottom));
}
var color = disabled ? DisabledColor : TextColor;
var color = disabled ? TextColorDisabled : TextColor;
font.DrawText(apparentText, textPos, color);
if (textSize.X > Bounds.Width - LeftMargin - RightMargin)

View File

@@ -8,6 +8,9 @@ Metrics:
ButtonTextContrast: false
ButtonTextContrastColor: 0,0,0
CheckboxPressedState: true
HotkeyFont: Regular
HotkeyColor: 255,255,255
HotkeyColorDisabled: 128,128,128
TextFont: Regular
TextColor: 255,255,255
TextContrast: false

View File

@@ -8,6 +8,9 @@ Metrics:
ButtonTextContrast: false
ButtonTextContrastColor: 0,0,0
CheckboxPressedState: false
HotkeyFont: Regular
HotkeyColor: 255,255,255
HotkeyColorDisabled: 128,128,128
TextFont: Regular
TextColor: 255,255,255
TextContrast: false

View File

@@ -8,6 +8,9 @@ Metrics:
ButtonTextContrast: true
ButtonTextContrastColor: 0,0,0
CheckboxPressedState: false
HotkeyFont: Regular
HotkeyColor: 255,255,255
HotkeyColorDisabled: 128,128,128
TextFont: Regular
TextColor: 255,255,255
TextContrast: false

View File

@@ -8,6 +8,9 @@ Metrics:
ButtonTextContrast: false
ButtonTextContrastColor: 0,0,0
CheckboxPressedState: false
HotkeyFont: Regular
HotkeyColor: 255,255,255
HotkeyColorDisabled: 128,128,128
TextFont: Regular
TextColor: 255,255,255
TextContrast: false