mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 22:22:54 +08:00
Handle star rating range display sizing
This commit is contained in:
parent
9d2664cbb1
commit
5e91ec73e3
@ -51,6 +51,23 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
MarginPadding margin = default;
|
||||
|
||||
switch (size)
|
||||
{
|
||||
case StarRatingDisplaySize.Small:
|
||||
margin = new MarginPadding { Horizontal = 7f };
|
||||
break;
|
||||
|
||||
case StarRatingDisplaySize.Range:
|
||||
margin = new MarginPadding { Horizontal = 8f };
|
||||
break;
|
||||
|
||||
case StarRatingDisplaySize.Regular:
|
||||
margin = new MarginPadding { Horizontal = 8f, Vertical = 2f };
|
||||
break;
|
||||
}
|
||||
|
||||
InternalChild = new CircularContainer
|
||||
{
|
||||
Masking = true,
|
||||
@ -66,9 +83,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Margin = size == StarRatingDisplaySize.Small
|
||||
? new MarginPadding { Horizontal = 7f }
|
||||
: new MarginPadding { Horizontal = 8f, Vertical = 2f },
|
||||
Margin = margin,
|
||||
ColumnDimensions = new[]
|
||||
{
|
||||
new Dimension(GridSizeMode.AutoSize),
|
||||
@ -124,6 +139,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
public enum StarRatingDisplaySize
|
||||
{
|
||||
Small,
|
||||
Range,
|
||||
Regular,
|
||||
}
|
||||
}
|
||||
|
@ -64,8 +64,8 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
minDisplay = new StarRatingDisplay(default) { Size = new Vector2(52f, 16f) },
|
||||
maxDisplay = new StarRatingDisplay(default) { Size = new Vector2(52f, 16f) }
|
||||
minDisplay = new StarRatingDisplay(default, StarRatingDisplaySize.Range),
|
||||
maxDisplay = new StarRatingDisplay(default, StarRatingDisplaySize.Range)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user