1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 11:27:24 +08:00

Add ability to override width of value area

This commit is contained in:
ansel 2022-08-29 22:08:43 +03:00
parent 2a12194ff9
commit 7faeed88b0

View File

@ -20,7 +20,6 @@ namespace osu.Game.Overlays.Mods
public abstract class ModsEffectDisplay : Container
{
public const float HEIGHT = 42;
private const float value_area_width = 56;
private const float transition_duration = 200;
private readonly Box contentBackground;
@ -38,6 +37,8 @@ namespace osu.Game.Overlays.Mods
/// </summary>
protected abstract LocalisableString Label { get; }
protected virtual float ValueAreaWidth => 56;
protected override Container<Drawable> Content => content;
protected ModsEffectDisplay()
@ -59,7 +60,7 @@ namespace osu.Game.Overlays.Mods
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
RelativeSizeAxes = Axes.Y,
Width = value_area_width + ModSelectPanel.CORNER_RADIUS
Width = ValueAreaWidth + ModSelectPanel.CORNER_RADIUS
},
new GridContainer
{
@ -68,7 +69,7 @@ namespace osu.Game.Overlays.Mods
ColumnDimensions = new[]
{
new Dimension(GridSizeMode.AutoSize),
new Dimension(GridSizeMode.Absolute, value_area_width)
new Dimension(GridSizeMode.Absolute, ValueAreaWidth)
},
Content = new[]
{