2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Settings
|
|
|
|
|
{
|
|
|
|
|
public class SettingsSlider<T> : SettingsSlider<T, OsuSliderBar<T>>
|
2019-10-23 13:04:06 +08:00
|
|
|
|
where T : struct, IEquatable<T>, IComparable<T>, IConvertible
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-10 21:04:26 +08:00
|
|
|
|
public class SettingsSlider<TValue, TSlider> : SettingsItem<TValue>
|
|
|
|
|
where TValue : struct, IEquatable<TValue>, IComparable<TValue>, IConvertible
|
|
|
|
|
where TSlider : OsuSliderBar<TValue>, new()
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-12-10 21:04:26 +08:00
|
|
|
|
protected override Drawable CreateControl() => new TSlider
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
Margin = new MarginPadding { Top = 5, Bottom = 5 },
|
|
|
|
|
RelativeSizeAxes = Axes.X
|
|
|
|
|
};
|
|
|
|
|
|
2019-01-08 13:56:42 +08:00
|
|
|
|
public bool TransferValueOnCommit
|
|
|
|
|
{
|
2019-12-10 21:04:26 +08:00
|
|
|
|
get => ((TSlider)Control).TransferValueOnCommit;
|
|
|
|
|
set => ((TSlider)Control).TransferValueOnCommit = value;
|
2019-01-08 13:56:42 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-01-08 13:56:42 +08:00
|
|
|
|
public float KeyboardStep
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-12-10 21:04:26 +08:00
|
|
|
|
get => ((TSlider)Control).KeyboardStep;
|
|
|
|
|
set => ((TSlider)Control).KeyboardStep = value;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|