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.
This commit is contained in:
2026-06-12 09:09:25 +02:00
parent 28cb4ce6ae
commit 51c87a7dc9
3 changed files with 98 additions and 42 deletions
+8
View File
@@ -72,12 +72,20 @@ public partial class MainWindow : Window
vm.IsServerSettingsOpen = false;
}
private void OnSettingsOverlayBackdropTapped(object? sender, TappedEventArgs e)
{
if (!ReferenceEquals(e.Source, sender)) return;
if (DataContext is MainWindowViewModel vm)
vm.IsSettingsOpen = false;
}
protected override void OnKeyDown(KeyEventArgs e)
{
if (e.Key == Key.Escape && DataContext is MainWindowViewModel vm)
{
if (vm.AddressInfo is not null) { vm.AddressInfo = null; e.Handled = true; return; }
if (vm.IsServerSettingsOpen) { vm.IsServerSettingsOpen = false; e.Handled = true; return; }
if (vm.IsSettingsOpen) { vm.IsSettingsOpen = false; e.Handled = true; return; }
}
base.OnKeyDown(e);
}