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
1 changed files with 4 additions and 3 deletions

View File

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