diff --git a/Trdo/App.xaml.cs b/Trdo/App.xaml.cs index a085ee6..0ca9768 100644 --- a/Trdo/App.xaml.cs +++ b/Trdo/App.xaml.cs @@ -156,18 +156,36 @@ private void InitializeTrayIcon() private void TrayIcon_ContextMenu(TrayIcon sender, TrayIconEventArgs args) { - WindowPlacementService.CapturePointerAnchor(); - args.Flyout = CreateFlyout(); + if (SettingsService.TrayClickBehavior == 1) + { + // Swapped: right click plays/pauses (fall back to flyout if no station selected) + if (_playerVm.CanPlay) + { + _playerVm.Toggle(); + _ = UpdateTrayIconAsync(); + return; + } + } + + // Default: right click opens flyout; also fallback when no station is available + ShowFlyout(args); } private void TrayIcon_Selected(TrayIcon sender, TrayIconEventArgs args) { + if (SettingsService.TrayClickBehavior == 1) + { + // Swapped: left click opens flyout + ShowFlyout(args); + return; + } + + // Default: left click plays/pauses // Check if we can play (have stations available and one selected) if (!_playerVm.CanPlay) { // No stations available, show the flyout to encourage user to add a station - WindowPlacementService.CapturePointerAnchor(); - args.Flyout = CreateFlyout(); + ShowFlyout(args); return; } @@ -176,6 +194,12 @@ private void TrayIcon_Selected(TrayIcon sender, TrayIconEventArgs args) _ = UpdateTrayIconAsync(); } + private void ShowFlyout(TrayIconEventArgs args) + { + WindowPlacementService.CapturePointerAnchor(); + args.Flyout = CreateFlyout(); + } + private Flyout CreateFlyout() { Flyout flyout = new() diff --git a/Trdo/Pages/SettingsPage.xaml b/Trdo/Pages/SettingsPage.xaml index 45101f3..5326a09 100644 --- a/Trdo/Pages/SettingsPage.xaml +++ b/Trdo/Pages/SettingsPage.xaml @@ -10,6 +10,35 @@ + + + + + @@ -22,389 +51,359 @@ - - - - - - - - - + + + + + + + + + + + - - - - - - -