// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; namespace osu.Game.Overlays.Options.Sections.Graphics { public class LayoutOptions : OptionsSubsection { protected override string Header => "Layout"; private OptionSlider letterboxPositionX; private OptionSlider letterboxPositionY; private Bindable letterboxing; [BackgroundDependencyLoader] private void load(FrameworkConfigManager config) { letterboxing = config.GetBindable(FrameworkConfig.Letterboxing); Children = new Drawable[] { new OptionEnumDropdown { LabelText = "Screen mode", Bindable = config.GetBindable(FrameworkConfig.WindowMode), }, new OptionCheckbox { LabelText = "Letterboxing", Bindable = letterboxing, }, letterboxPositionX = new OptionSlider { LabelText = "Horizontal position", Bindable = config.GetBindable(FrameworkConfig.LetterboxPositionX) }, letterboxPositionY = new OptionSlider { LabelText = "Vertical position", Bindable = config.GetBindable(FrameworkConfig.LetterboxPositionY) }, }; letterboxing.ValueChanged += visibilityChanged; letterboxing.TriggerChange(); } private void visibilityChanged(bool newVisibility) { if (newVisibility) { letterboxPositionX.Show(); letterboxPositionY.Show(); } else { letterboxPositionX.Hide(); letterboxPositionY.Hide(); } } } }