From 51c87a7dc900cfe60d1bca79806386b189ef6cee Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Fri, 12 Jun 2026 09:09:25 +0200 Subject: [PATCH] refactor(app): replace nested settings submenu with in-app overlay The Impostazioni menu now opens a single overlay (same pattern as address/server overlays) instead of nested OS popup menus, which are slow to respond under WSLg. The overlay groups language (RadioButton) and unit (RadioButton) in one panel, with a button to open the server overlay. Esc and backdrop tap close it. OpenServerSettings() closes the settings overlay first so the two overlays never stack. --- src/App/ViewModels/MainWindowViewModel.cs | 19 +++- src/App/Views/MainWindow.axaml | 113 ++++++++++++++-------- src/App/Views/MainWindow.axaml.cs | 8 ++ 3 files changed, 98 insertions(+), 42 deletions(-) diff --git a/src/App/ViewModels/MainWindowViewModel.cs b/src/App/ViewModels/MainWindowViewModel.cs index d26841f..58dceb0 100644 --- a/src/App/ViewModels/MainWindowViewModel.cs +++ b/src/App/ViewModels/MainWindowViewModel.cs @@ -231,16 +231,31 @@ public partial class MainWindowViewModel : ViewModelBase [ObservableProperty] private bool useSsl = true; - /// Overlay impostazioni server: aperto da menu Impostazioni → Server. + /// Overlay impostazioni server: aperto dall'overlay Impostazioni. [ObservableProperty] private bool isServerSettingsOpen; [RelayCommand] - private void OpenServerSettings() => IsServerSettingsOpen = true; + private void OpenServerSettings() + { + IsSettingsOpen = false; + IsServerSettingsOpen = true; + } [RelayCommand] private void CloseServerSettings() => IsServerSettingsOpen = false; + /// Overlay impostazioni (lingua, unità, server): in-app per evitare + /// i popup di menu annidati, lenti su WSLg. + [ObservableProperty] + private bool isSettingsOpen; + + [RelayCommand] + private void OpenSettings() => IsSettingsOpen = true; + + [RelayCommand] + private void CloseSettings() => IsSettingsOpen = false; + [ObservableProperty] private string connectionStatus = Loc.Tr("conn.none"); diff --git a/src/App/Views/MainWindow.axaml b/src/App/Views/MainWindow.axaml index 3f235c5..008b47c 100644 --- a/src/App/Views/MainWindow.axaml +++ b/src/App/Views/MainWindow.axaml @@ -30,46 +30,8 @@ - - - - - - - - - - - - - - - - - - + @@ -498,5 +460,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +