mirror of https://github.com/ppy/osu
Rename FontColour to TextColour
This commit is contained in:
parent
ec575e9de4
commit
73b6744a97
|
@ -70,14 +70,14 @@ public static class SkinnableComponentStrings
|
|||
public static LocalisableString ColourDescription => new TranslatableString(getKey(@"colour_description"), @"The colour of the component.");
|
||||
|
||||
/// <summary>
|
||||
/// "Font colour"
|
||||
/// "Text colour"
|
||||
/// </summary>
|
||||
public static LocalisableString FontColour => new TranslatableString(getKey(@"font_colour"), @"Font colour");
|
||||
public static LocalisableString TextColour => new TranslatableString(getKey(@"text_colour"), @"Text colour");
|
||||
|
||||
/// <summary>
|
||||
/// "The colour of the font."
|
||||
/// "The colour of the text."
|
||||
/// </summary>
|
||||
public static LocalisableString FontColourDescription => new TranslatableString(getKey(@"font_colour_description"), @"The colour of the font.");
|
||||
public static LocalisableString TextColourDescription => new TranslatableString(getKey(@"text_colour_description"), @"The colour of the text.");
|
||||
|
||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ private void updateLabel()
|
|||
|
||||
protected override void SetFont(FontUsage font) => text.Font = font.With(size: 40);
|
||||
|
||||
protected override void SetFontColour(Colour4 fontColour) => text.Colour = fontColour;
|
||||
protected override void SetTextColour(Colour4 textColour) => text.Colour = textColour;
|
||||
}
|
||||
|
||||
// WARNING: DO NOT ADD ANY VALUES TO THIS ENUM ANYWHERE ELSE THAN AT THE END.
|
||||
|
|
|
@ -54,6 +54,6 @@ private void load()
|
|||
|
||||
protected override void SetFont(FontUsage font) => text.Font = font.With(size: 40);
|
||||
|
||||
protected override void SetFontColour(Colour4 fontColour) => text.Colour = fontColour;
|
||||
protected override void SetTextColour(Colour4 textColour) => text.Colour = textColour;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,6 @@ public TextElement()
|
|||
|
||||
protected override void SetFont(FontUsage font) => text.Font = font.With(size: 40);
|
||||
|
||||
protected override void SetFontColour(Colour4 fontColour) => text.Colour = fontColour;
|
||||
protected override void SetTextColour(Colour4 textColour) => text.Colour = textColour;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,15 +21,15 @@ public abstract partial class FontAdjustableSkinComponent : Container, ISerialis
|
|||
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.Font), nameof(SkinnableComponentStrings.FontDescription))]
|
||||
public Bindable<Typeface> Font { get; } = new Bindable<Typeface>(Typeface.Torus);
|
||||
|
||||
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.FontColour), nameof(SkinnableComponentStrings.FontColourDescription))]
|
||||
public BindableColour4 FontColour { get; } = new BindableColour4(Colour4.White);
|
||||
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.TextColour), nameof(SkinnableComponentStrings.TextColourDescription))]
|
||||
public BindableColour4 TextColour { get; } = new BindableColour4(Colour4.White);
|
||||
|
||||
/// <summary>
|
||||
/// Implement to apply the user font selection to one or more components.
|
||||
/// </summary>
|
||||
protected abstract void SetFont(FontUsage font);
|
||||
|
||||
protected abstract void SetFontColour(Colour4 fontColour);
|
||||
protected abstract void SetTextColour(Colour4 textColour);
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ protected override void LoadComplete()
|
|||
SetFont(f);
|
||||
}, true);
|
||||
|
||||
FontColour.BindValueChanged(e => SetFontColour(e.NewValue), true);
|
||||
TextColour.BindValueChanged(e => SetTextColour(e.NewValue), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue