Merge pull request #21070 from peppy/standardise-visual-settings-ui-components

Standardise "Visual Settings" components to fix mismatched paddings and labels
This commit is contained in:
Dan Balasescu 2022-11-02 14:53:00 +09:00 committed by GitHub
commit 22f662a076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 23 deletions

View File

@ -1,22 +1,27 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.Settings;
namespace osu.Game.Screens.Play.PlayerSettings namespace osu.Game.Screens.Play.PlayerSettings
{ {
public class PlayerCheckbox : OsuCheckbox public class PlayerCheckbox : SettingsCheckbox
{ {
[BackgroundDependencyLoader] protected override Drawable CreateControl() => new PlayerCheckboxControl();
private void load(OsuColour colours)
public class PlayerCheckboxControl : OsuCheckbox
{ {
Nub.AccentColour = colours.Yellow; [BackgroundDependencyLoader]
Nub.GlowingAccentColour = colours.YellowLighter; private void load(OsuColour colours)
Nub.GlowColour = colours.YellowDark; {
Nub.AccentColour = colours.Yellow;
Nub.GlowingAccentColour = colours.YellowLighter;
Nub.GlowColour = colours.YellowDark;
}
} }
} }
} }

View File

@ -1,12 +1,9 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.Sprites;
using osu.Game.Localisation; using osu.Game.Localisation;
namespace osu.Game.Screens.Play.PlayerSettings namespace osu.Game.Screens.Play.PlayerSettings
@ -24,26 +21,16 @@ namespace osu.Game.Screens.Play.PlayerSettings
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText
{
Text = GameplaySettingsStrings.BackgroundDim
},
dimSliderBar = new PlayerSliderBar<double> dimSliderBar = new PlayerSliderBar<double>
{ {
LabelText = GameplaySettingsStrings.BackgroundDim,
DisplayAsPercentage = true DisplayAsPercentage = true
}, },
new OsuSpriteText
{
Text = GameplaySettingsStrings.BackgroundBlur
},
blurSliderBar = new PlayerSliderBar<double> blurSliderBar = new PlayerSliderBar<double>
{ {
LabelText = GameplaySettingsStrings.BackgroundBlur,
DisplayAsPercentage = true DisplayAsPercentage = true
}, },
new OsuSpriteText
{
Text = "Toggles:"
},
showStoryboardToggle = new PlayerCheckbox { LabelText = GraphicsSettingsStrings.StoryboardVideo }, showStoryboardToggle = new PlayerCheckbox { LabelText = GraphicsSettingsStrings.StoryboardVideo },
beatmapSkinsToggle = new PlayerCheckbox { LabelText = SkinSettingsStrings.BeatmapSkins }, beatmapSkinsToggle = new PlayerCheckbox { LabelText = SkinSettingsStrings.BeatmapSkins },
beatmapColorsToggle = new PlayerCheckbox { LabelText = SkinSettingsStrings.BeatmapColours }, beatmapColorsToggle = new PlayerCheckbox { LabelText = SkinSettingsStrings.BeatmapColours },