Remove obsolete Bold field from widgets

This commit is contained in:
Paul Chote
2011-05-22 13:30:52 +12:00
parent 8eb4e663d2
commit 35673a058a
13 changed files with 112 additions and 138 deletions

View File

@@ -25,9 +25,6 @@ namespace OpenRA.Widgets
public Func<bool> IsDisabled = () => false;
public Action OnClick = () => {};
[Obsolete] public bool Bold = false;
public ButtonWidget()
: base()
{
@@ -96,8 +93,6 @@ namespace OpenRA.Widgets
{
var rb = RenderBounds;
var disabled = IsDisabled();
if (Font == "Regular" && Bold)
Font = "Bold";
var font = Game.Renderer.Fonts[Font];
var text = GetText();

View File

@@ -63,9 +63,6 @@ namespace OpenRA.Widgets
public override void DrawInner()
{
if (Font == "Regular" && Bold)
Font = "Bold";
var font = Game.Renderer.Fonts[Font];
var rect = RenderBounds;
var check = new Rectangle(rect.Location, new Size(Bounds.Height, Bounds.Height));

View File

@@ -30,8 +30,6 @@ namespace OpenRA.Widgets
public Func<string> GetText;
[Obsolete] public Func<string> GetBackground;
[Obsolete] public bool Bold = false; // Legacy flag. TODO: Remove
public LabelWidget()
: base()
{
@@ -44,7 +42,6 @@ namespace OpenRA.Widgets
{
Text = other.Text;
Align = other.Align;
Bold = other.Bold;
Font = other.Font;
Color = other.Color;
Contrast = other.Contrast;
@@ -61,9 +58,6 @@ namespace OpenRA.Widgets
if (bg != null)
WidgetUtils.DrawPanel(bg, RenderBounds );
if (Font == "Regular" && Bold)
Font = "Bold";
SpriteFont font = Game.Renderer.Fonts[Font];
var text = GetText();
if (text == null)

View File

@@ -39,15 +39,12 @@ namespace OpenRA.Widgets
public Color DisabledColor = Color.Gray;
public string Font = "Regular";
[Obsolete] public bool Bold = false;
public TextFieldWidget() : base() {}
protected TextFieldWidget(TextFieldWidget widget)
: base(widget)
{
Text = widget.Text;
MaxLength = widget.MaxLength;
Bold = widget.Bold;
Font = widget.Font;
TextColor = widget.TextColor;
DisabledColor = widget.DisabledColor;
@@ -86,9 +83,6 @@ namespace OpenRA.Widgets
public int ClosestCursorPosition(int x)
{
if (Font == "Regular" && Bold)
Font = "Bold";
var font = Game.Renderer.Fonts[Font];
var textSize = font.Measure(Text);
@@ -200,9 +194,6 @@ namespace OpenRA.Widgets
public virtual void DrawWithString(string text)
{
if (Font == "Regular" && Bold)
Font = "Bold";
var font = Game.Renderer.Fonts[Font];
var pos = RenderOrigin;