mirror of
https://github.com/osukey/osukey.git
synced 2025-05-19 12:37:38 +09:00
Use better logic for setting slider bar settings
This commit is contained in:
parent
01aa4c2a72
commit
a2a7aa708f
@ -11,7 +11,6 @@ using osu.Framework.Extensions.IEnumerableExtensions;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -144,7 +143,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
if (mode == ScalingMode.Off)
|
if (mode == ScalingMode.Off)
|
||||||
scalingSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
|
scalingSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
|
||||||
|
|
||||||
scalingSettings.ForEach(s => ((SliderBar<float>)s.Control).TransferValueOnCommit = mode == ScalingMode.Everything);
|
scalingSettings.ForEach(s => s.TransferValueOnCommit = mode == ScalingMode.Everything);
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
{
|
{
|
||||||
protected abstract Drawable CreateControl();
|
protected abstract Drawable CreateControl();
|
||||||
|
|
||||||
public Drawable Control { get; }
|
protected Drawable Control { get; }
|
||||||
|
|
||||||
private IHasCurrentValue<T> controlWithCurrent => Control as IHasCurrentValue<T>;
|
private IHasCurrentValue<T> controlWithCurrent => Control as IHasCurrentValue<T>;
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
|
||||||
@ -23,14 +22,16 @@ namespace osu.Game.Overlays.Settings
|
|||||||
RelativeSizeAxes = Axes.X
|
RelativeSizeAxes = Axes.X
|
||||||
};
|
};
|
||||||
|
|
||||||
public float KeyboardStep;
|
public bool TransferValueOnCommit
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load()
|
|
||||||
{
|
{
|
||||||
var slider = Control as U;
|
get => ((U)Control).TransferValueOnCommit;
|
||||||
if (slider != null)
|
set => ((U)Control).TransferValueOnCommit = value;
|
||||||
slider.KeyboardStep = KeyboardStep;
|
}
|
||||||
|
|
||||||
|
public float KeyboardStep
|
||||||
|
{
|
||||||
|
get => ((U)Control).KeyboardStep;
|
||||||
|
set => ((U)Control).KeyboardStep = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user