Skip to content

Commit

Permalink
Add relative size toggle to DefaultSongProgress too
Browse files Browse the repository at this point in the history
  • Loading branch information
bdach committed Oct 18, 2024
1 parent bb4f3c7 commit 47f1069
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions osu.Game/Screens/Play/HUD/DefaultSongProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public partial class DefaultSongProgress : SongProgress
[SettingSource(typeof(SongProgressStrings), nameof(SongProgressStrings.ShowTime), nameof(SongProgressStrings.ShowTimeDescription))]
public Bindable<bool> ShowTime { get; } = new BindableBool(true);

[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.UseRelativeSize))]
public BindableBool UseRelativeSize { get; } = new BindableBool(true);

[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.Colour), nameof(SkinnableComponentStrings.ColourDescription))]
public BindableColour4 AccentColour { get; } = new BindableColour4(Colour4.White);

Expand Down Expand Up @@ -83,6 +86,11 @@ public DefaultSongProgress()
private void load(OsuColour colours)
{
graph.FillColour = bar.FillColour = colours.BlueLighter;

// see comment in ArgonHealthDisplay.cs regarding RelativeSizeAxes
float previousWidth = Width;
UseRelativeSize.BindValueChanged(v => RelativeSizeAxes = v.NewValue ? Axes.X : Axes.None, true);
Width = previousWidth;
}

protected override void LoadComplete()
Expand Down

0 comments on commit 47f1069

Please sign in to comment.