From b3201064ca1d2db111a2f65286ee915cf95761a1 Mon Sep 17 00:00:00 2001 From: RMBGAME Date: Fri, 26 Nov 2021 21:43:50 +0800 Subject: [PATCH] fix #707 --- .../Application/UI/Views/MainView.axaml.cs | 18 ++++++++++++++++++ src/ST.Client/Settings/UISettings.cs | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/MainView.axaml.cs b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/MainView.axaml.cs index ad71843f8..1e326b432 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/MainView.axaml.cs +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/MainView.axaml.cs @@ -130,6 +130,24 @@ namespace System.Application.UI.Views title.Background = x ? null : _backgroundTemp; }); } + + if (nav != null) + { + this.GetObservable(BoundsProperty) + .Subscribe(x => + { + switch (x.Width) + { + case < 950: + nav.PaneDisplayMode = NavigationViewPaneDisplayMode.LeftCompact; + nav.IsPaneOpen = false; + break; + default: + nav.PaneDisplayMode = NavigationViewPaneDisplayMode.Left; + break; + } + }); + } } private void InitializeComponent() diff --git a/src/ST.Client/Settings/UISettings.cs b/src/ST.Client/Settings/UISettings.cs index b28a55ad6..908fb22e4 100644 --- a/src/ST.Client/Settings/UISettings.cs +++ b/src/ST.Client/Settings/UISettings.cs @@ -27,8 +27,8 @@ namespace System.Application.Settings /// /// 不再提示的消息框数组 /// - public static SerializableProperty> DoNotShowMessageBoxs { get; } - = GetProperty(defaultValue: new List(), autoSave: false); + public static SerializableProperty> DoNotShowMessageBoxs { get; } + = GetProperty(defaultValue: new HashSet(), autoSave: false); } }