osu/osu.Game/Overlays/Settings/SettingsSlider.cs

37 lines
1.1 KiB
C#
Raw Normal View History

2018-01-05 11:21:19 +00:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2016-12-14 19:59:23 +00:00
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Settings
2016-12-07 20:39:21 +00:00
{
public class SettingsSlider<T> : SettingsSlider<T, OsuSliderBar<T>>
2018-01-10 06:41:13 +00:00
where T : struct, IEquatable<T>, IComparable, IConvertible
2016-12-07 20:39:21 +00:00
{
2017-04-21 11:59:04 +00:00
}
public class SettingsSlider<T, U> : SettingsItem<T>
2018-01-10 06:41:13 +00:00
where T : struct, IEquatable<T>, IComparable, IConvertible
where U : OsuSliderBar<T>, new()
2017-04-21 11:59:04 +00:00
{
protected override Drawable CreateControl() => new U
2016-12-07 20:39:21 +00:00
{
Margin = new MarginPadding { Top = 5, Bottom = 5 },
RelativeSizeAxes = Axes.X
};
public float KeyboardStep;
[BackgroundDependencyLoader]
private void load()
{
var slider = Control as U;
if (slider != null)
slider.KeyboardStep = KeyboardStep;
}
2016-12-07 20:39:21 +00:00
}
2016-12-09 13:18:58 +00:00
}