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

View File

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

View File

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

View File

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

View File

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