mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Replace copy-constructor/method with extension method
This commit is contained in:
@ -82,7 +82,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
public BreadcrumbTabItem(T value) : base(value)
|
||||
{
|
||||
Text.Font = OsuFont.GetFont(Text.Font, size: 18);
|
||||
Text.Font = Text.Font.With(size: 18);
|
||||
Text.Margin = new MarginPadding { Vertical = 8 };
|
||||
Padding = new MarginPadding { Right = padding + item_chevron_size };
|
||||
Add(Chevron = new SpriteIcon
|
||||
|
@ -199,7 +199,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
public float TextSize
|
||||
{
|
||||
get => spriteText.Font.Size;
|
||||
set => spriteText.Font = OsuFont.GetFont(spriteText.Font, size: value);
|
||||
set => spriteText.Font = spriteText.Font.With(size: value);
|
||||
}
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => backgroundContainer.ReceivePositionalInputAt(screenSpacePos);
|
||||
|
@ -173,7 +173,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
new HoverClickSounds()
|
||||
};
|
||||
|
||||
Active.BindValueChanged(val => Text.Font = OsuFont.GetFont(Text.Font, weight: val ? FontWeight.Bold : FontWeight.Medium), true);
|
||||
Active.BindValueChanged(val => Text.Font = Text.Font.With(weight: val ? FontWeight.Bold : FontWeight.Medium), true);
|
||||
}
|
||||
|
||||
protected override void OnActivated() => fadeActive();
|
||||
|
@ -59,7 +59,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
new HoverClickSounds()
|
||||
};
|
||||
|
||||
Active.BindValueChanged(val => Text.Font = OsuFont.GetFont(Text.Font, weight: val ? FontWeight.Bold : FontWeight.Medium), true);
|
||||
Active.BindValueChanged(val => Text.Font = Text.Font.With(weight: val ? FontWeight.Bold : FontWeight.Medium), true);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -22,7 +22,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
public PercentageCounter()
|
||||
{
|
||||
DisplayedCountSpriteText.Font = OsuFont.GetFont(DisplayedCountSpriteText.Font, fixedWidth: true);
|
||||
DisplayedCountSpriteText.Font = DisplayedCountSpriteText.Font.With(fixedWidth: true);
|
||||
Current.Value = DisplayedCount = 1.0f;
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
public float TextSize
|
||||
{
|
||||
get => DisplayedCountSpriteText.Font.Size;
|
||||
set => DisplayedCountSpriteText.Font = OsuFont.GetFont(DisplayedCountSpriteText.Font, size: value);
|
||||
set => DisplayedCountSpriteText.Font = DisplayedCountSpriteText.Font.With(size: value);
|
||||
}
|
||||
|
||||
public Color4 AccentColour
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
/// <param name="leading">How many leading zeroes the counter will have.</param>
|
||||
public ScoreCounter(uint leading = 0)
|
||||
{
|
||||
DisplayedCountSpriteText.Font = OsuFont.GetFont(DisplayedCountSpriteText.Font, fixedWidth: true);
|
||||
DisplayedCountSpriteText.Font = DisplayedCountSpriteText.Font.With(fixedWidth: true);
|
||||
LeadingZeroes = leading;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user