Add UI scale

Limited to (relatively) sane values until we eventually get around to adjusting UI to allow higher extermities.
This commit is contained in:
Dean Herbert
2019-01-09 19:01:33 +09:00
parent e4ff36a5bc
commit 4f5c208672
4 changed files with 50 additions and 4 deletions

View File

@ -63,9 +63,16 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y
},
new SettingsSlider<float, UIScaleSlider>
{
LabelText = "UI Scaling",
TransferValueOnCommit = true,
Bindable = osuConfig.GetBindable<float>(OsuSetting.UIScale),
KeyboardStep = 0.01f
},
new SettingsEnumDropdown<ScalingMode>
{
LabelText = "Scaling",
LabelText = "Screen Scaling",
Bindable = osuConfig.GetBindable<ScalingMode>(OsuSetting.Scaling),
},
scalingSettings = new FillFlowContainer<SettingsSlider<float>>
@ -141,6 +148,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
scalingSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
scalingSettings.ForEach(s => s.TransferValueOnCommit = mode == ScalingMode.Everything);
}, true);
}
@ -202,6 +210,11 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
}
}
private class UIScaleSlider : OsuSliderBar<float>
{
public override string TooltipText => base.TooltipText + "x";
}
private class ResolutionSettingsDropdown : SettingsDropdown<Size>
{
protected override OsuDropdown<Size> CreateDropdown() => new ResolutionDropdownControl { Items = Items };