Skip to content

Commit

Permalink
Merge pull request #23089 from Susko3/fix-window-mode-dropdown
Browse files Browse the repository at this point in the history
Fix window mode dropdown not showing
  • Loading branch information
bdach committed Apr 2, 2023
2 parents ea42e7f + c3a6a58 commit bc0538a
Showing 1 changed file with 1 addition and 4 deletions.
Expand Up @@ -32,7 +32,6 @@ public partial class LayoutSettings : SettingsSubsection
private FillFlowContainer<SettingsSlider<float>> scalingSettings = null!;

private readonly Bindable<Display> currentDisplay = new Bindable<Display>();
private readonly IBindableList<WindowMode> windowModes = new BindableList<WindowMode>();

private Bindable<ScalingMode> scalingMode = null!;
private Bindable<Size> sizeFullscreen = null!;
Expand Down Expand Up @@ -87,6 +86,7 @@ private void load(FrameworkConfigManager config, OsuConfigManager osuConfig, Gam
{
LabelText = GraphicsSettingsStrings.ScreenMode,
Items = window?.SupportedWindowModes,
CanBeShown = { Value = window?.SupportedWindowModes.Count() > 1 },
Current = config.GetBindable<WindowMode>(FrameworkSetting.WindowMode),
},
displayDropdown = new DisplaySettingsDropdown
Expand Down Expand Up @@ -180,8 +180,6 @@ protected override void LoadComplete()
updateScreenModeWarning();
}, true);

windowModes.BindCollectionChanged((_, _) => updateDisplaySettingsVisibility());

currentDisplay.BindValueChanged(display => Schedule(() =>
{
resolutions.RemoveRange(1, resolutions.Count - 1);
Expand Down Expand Up @@ -235,7 +233,6 @@ private void onDisplaysChanged(IEnumerable<Display> displays)

private void updateDisplaySettingsVisibility()
{
windowModeDropdown.CanBeShown.Value = windowModes.Count > 1;
resolutionDropdown.CanBeShown.Value = resolutions.Count > 1 && windowModeDropdown.Current.Value == WindowMode.Fullscreen;
displayDropdown.CanBeShown.Value = displayDropdown.Items.Count() > 1;
safeAreaConsiderationsCheckbox.CanBeShown.Value = host.Window?.SafeAreaPadding.Value.Total != Vector2.Zero;
Expand Down

0 comments on commit bc0538a

Please sign in to comment.