diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 277592d..f5c2549 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -3,6 +3,8 @@ English (US) release notes, mirroring CHANGELOG.md (Brazilian Portuguese). Before publishing a version, add a `## [VERSION]` section to **both** files: the workflow publishes the section matching the tag from each one and fails if either is missing. ## [Unreleased] +### What's new +- Minimize to the system tray: with the new option in Settings (also in the Console interface, under System), minimizing the window takes Console Mode off the taskbar and leaves just its icon in the hidden icons; one click on the icon opens it again. Off by default. (#150) ## [1.6.1] ### What's new diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ee60c5..1090172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ Notas em português do Brasil; a versão em inglês (Estados Unidos) fica em `CHANGELOG.en-US.md`. Antes de publicar uma versão, adicione uma seção `## [VERSÃO]` com o changelog daquela versão **nos dois arquivos**. O workflow publica as duas seções correspondentes à tag na mesma release e falha se faltar alguma. ## [Unreleased] +### Novidades +- Minimizar para a bandeja: com a nova opção em Ajustes (também na interface Console, em Sistema), minimizar a janela tira o Console Mode da barra de tarefas e deixa só o ícone nos ícones ocultos; um clique no ícone abre de novo. Vem desligada. (#150) ## [1.6.1] ### Novidades diff --git a/docs/TESTING.md b/docs/TESTING.md index 47e0b1c..9a57462 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -457,3 +457,13 @@ Pré-requisito: RivaTuner Statistics Server instalado, com "Show On-Screen Displ - [ ] Config salva na 1.6.0 com "Compacto": depois de atualizar, aparece "Apenas FPS" e o jogo mostra só o FPS. - [ ] Voltar ao PC com Compacto/Detalhado: o contador some e não volta sozinho segundos depois. - [ ] Uso de CPU do Console Mode com Detalhado ligado continua baixo (Gerenciador de Tarefas, < 1%). + +## Minimizar para a bandeja + +- [ ] Ajustes → "Minimizar para a bandeja" vem desligado; minimizar deixa a janela na barra de tarefas, como antes. +- [ ] Ligado: minimizar (botão da barra de título, Win+Down ou clique no ícone da barra de tarefas) tira o app da barra de tarefas e do Alt+Tab; o ícone continua nos ícones ocultos. +- [ ] Clique no ícone da bandeja (ou "Mostrar janela" no menu dele) traz a janela de volta, no mesmo tamanho e posição, com foco. +- [ ] Com a janela maximizada antes de minimizar, ela volta maximizada. +- [ ] Interface Console → Sistema: a linha "Minimizar para a bandeja" alterna Ligado/Desligado e o modo PC mostra o mesmo valor; o valor fica salvo ao reabrir o app. +- [ ] Com a sessão ativa e a opção ligada, minimizar e reabrir pela bandeja continua funcionando; o atalho do controle para abrir o app também traz a janela de volta. +- [ ] Fechar no X (sem sessão ativa) continua fechando o app, com a opção ligada ou desligada. diff --git a/src/ConsoleMode/MainWindow.xaml.cs b/src/ConsoleMode/MainWindow.xaml.cs index 9f8c8de..abaedd3 100644 --- a/src/ConsoleMode/MainWindow.xaml.cs +++ b/src/ConsoleMode/MainWindow.xaml.cs @@ -49,6 +49,13 @@ public MainWindow(MainViewModel viewModel) appWindow.Hide(); }; + // With "Minimize to the system tray" on, minimizing leaves the taskbar; the tray icon brings it back. + appWindow.Changed += (_, e) => + { + if (!e.DidPresenterChange || !ViewModel.MinimizeToTray) return; + if (appWindow.Presenter is OverlappedPresenter { State: OverlappedPresenterState.Minimized }) appWindow.Hide(); + }; + // The console interface fills the screen, like a console; the desktop one gets its size back. ViewModel.PropertyChanged += (_, e) => { diff --git a/src/ConsoleMode/Models/Models.cs b/src/ConsoleMode/Models/Models.cs index cd5101b..69808fc 100644 --- a/src/ConsoleMode/Models/Models.cs +++ b/src/ConsoleMode/Models/Models.cs @@ -78,6 +78,9 @@ public sealed class AppConfig /// Sounds for moving, picking and going back in the console interface. public bool InterfaceSounds { get; set; } = true; + /// Minimizing the main window hides it in the tray instead of leaving it on the taskbar. + public bool MinimizeToTray { get; set; } + /// Console background: "auto" (covers of the installed Steam games), "gradient" or "image". public string ConsoleBackground { get; set; } = "auto"; diff --git a/src/ConsoleMode/Resources/Strings.en-US.json b/src/ConsoleMode/Resources/Strings.en-US.json index 55e7c9d..2370b9e 100644 --- a/src/ConsoleMode/Resources/Strings.en-US.json +++ b/src/ConsoleMode/Resources/Strings.en-US.json @@ -144,6 +144,8 @@ "GameBarSettingError": "Could not change the Game Bar setting: {0}", "StartupCard": "Start with Windows", "StartupDescription": "Opens in the system tray when your PC starts, ready for the one-click shortcut.", + "MinimizeToTrayCard": "Minimize to the system tray", + "MinimizeToTrayDescription": "Minimizing hides the window from the taskbar and keeps Console Mode in the hidden icons. Click the icon to open it again.", "UpdatesCard": "Updates", "CheckNow": "Check now", "NotifyUpdatesCard": "Notify me when a new version is available", diff --git a/src/ConsoleMode/Resources/Strings.es-ES.json b/src/ConsoleMode/Resources/Strings.es-ES.json index d497471..b2fbcb1 100644 --- a/src/ConsoleMode/Resources/Strings.es-ES.json +++ b/src/ConsoleMode/Resources/Strings.es-ES.json @@ -144,6 +144,8 @@ "GameBarSettingError": "No se pudo cambiar el ajuste de la Game Bar: {0}", "StartupCard": "Iniciar con Windows", "StartupDescription": "Se abre en la bandeja del sistema al encender el PC, listo para el acceso directo de 1 clic.", + "MinimizeToTrayCard": "Minimizar a la bandeja", + "MinimizeToTrayDescription": "Al minimizar, la ventana sale de la barra de tareas y queda en los iconos ocultos. Haz clic en el icono para abrirla de nuevo.", "UpdatesCard": "Actualizaciones", "CheckNow": "Buscar ahora", "NotifyUpdatesCard": "Avisarme cuando haya una versión nueva", diff --git a/src/ConsoleMode/Resources/Strings.pt-BR.json b/src/ConsoleMode/Resources/Strings.pt-BR.json index 08e7d0a..b970282 100644 --- a/src/ConsoleMode/Resources/Strings.pt-BR.json +++ b/src/ConsoleMode/Resources/Strings.pt-BR.json @@ -144,6 +144,8 @@ "GameBarSettingError": "Não foi possível alterar o ajuste da Game Bar: {0}", "StartupCard": "Iniciar com o Windows", "StartupDescription": "Abre direto na bandeja ao ligar o PC, pronto para o atalho de 1 clique.", + "MinimizeToTrayCard": "Minimizar para a bandeja", + "MinimizeToTrayDescription": "Ao minimizar, a janela sai da barra de tarefas e fica nos ícones ocultos. Clique no ícone para abrir de novo.", "UpdatesCard": "Atualizações", "CheckNow": "Procurar agora", "NotifyUpdatesCard": "Avisar quando sair versão nova", diff --git a/src/ConsoleMode/Services/LocalizationService.cs b/src/ConsoleMode/Services/LocalizationService.cs index 02401f6..2989197 100644 --- a/src/ConsoleMode/Services/LocalizationService.cs +++ b/src/ConsoleMode/Services/LocalizationService.cs @@ -174,6 +174,8 @@ internal void NotifyAll() public string AppSection => LocalizationService.Get(nameof(AppSection)); public string StartupCard => LocalizationService.Get(nameof(StartupCard)); public string StartupDescription => LocalizationService.Get(nameof(StartupDescription)); + public string MinimizeToTrayCard => LocalizationService.Get(nameof(MinimizeToTrayCard)); + public string MinimizeToTrayDescription => LocalizationService.Get(nameof(MinimizeToTrayDescription)); public string UpdatesCard => LocalizationService.Get(nameof(UpdatesCard)); public string CheckNow => LocalizationService.Get(nameof(CheckNow)); public string UiModeCard => LocalizationService.Get(nameof(UiModeCard)); diff --git a/src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs b/src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs index 1d77e21..44e51a4 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs @@ -259,6 +259,7 @@ private void CycleSetting(string spec) case "background": CycleBackgroundMode(); break; case "backgroundimage": PickBackgroundImage(); break; case "startup": StartWithWindows = !StartWithWindows; break; + case "minimizetray": MinimizeToTray = !MinimizeToTray; break; case "updates": CheckUpdates = !CheckUpdates; break; case "betas": BetaUpdates = !BetaUpdates; break; case "closest": CloseSteamOnRestore = !CloseSteamOnRestore; break; diff --git a/src/ConsoleMode/ViewModels/MainViewModel.Updates.cs b/src/ConsoleMode/ViewModels/MainViewModel.Updates.cs index e2b1b7a..22601cd 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.Updates.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.Updates.cs @@ -23,6 +23,7 @@ private enum UpdateStatusKind { InstallKind, Searching, Latest, Available, Faile [ObservableProperty] private bool _closeSteamOnRestore = true; [ObservableProperty] private string _homeButtonHint = ""; [ObservableProperty] private bool _startWithWindows; + [ObservableProperty] private bool _minimizeToTray; [ObservableProperty] private bool _isUpdateOpen; [ObservableProperty] private string _updateTitle = ""; [ObservableProperty] private string _updateMessage = ""; @@ -80,6 +81,8 @@ partial void OnStartWithWindowsChanged(bool value) } } + partial void OnMinimizeToTrayChanged(bool value) => SaveQuietly(); + partial void OnCheckUpdatesChanged(bool value) => SaveQuietly(); partial void OnBetaUpdatesChanged(bool value) diff --git a/src/ConsoleMode/ViewModels/MainViewModel.cs b/src/ConsoleMode/ViewModels/MainViewModel.cs index 8998754..4e2f267 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.cs @@ -312,6 +312,7 @@ private void Apply(LoadResult data) HomeButtonShortPress = config.HomeButtonShortPress; AutoStartOnController = config.AutoStartOnController; InterfaceSounds = config.InterfaceSounds; + MinimizeToTray = config.MinimizeToTray; ConsoleBackgroundMode = ConsoleBackgroundService.NormalizeMode(config.ConsoleBackground); ConsoleBackgroundImage = config.ConsoleBackgroundImage ?? ""; CloseSteamOnRestore = config.CloseSteamOnRestore; @@ -926,6 +927,7 @@ private AppConfig BuildConfig() HomeButtonShortPress = HomeButtonShortPress, AutoStartOnController = AutoStartOnController, InterfaceSounds = InterfaceSounds, + MinimizeToTray = MinimizeToTray, ConsoleBackground = ConsoleBackgroundMode, ConsoleBackgroundImage = ConsoleBackgroundImage, CloseSteamOnRestore = CloseSteamOnRestore, diff --git a/src/ConsoleMode/Views/ConsoleHomeView.xaml b/src/ConsoleMode/Views/ConsoleHomeView.xaml index 53e3307..f4dc119 100644 --- a/src/ConsoleMode/Views/ConsoleHomeView.xaml +++ b/src/ConsoleMode/Views/ConsoleHomeView.xaml @@ -618,6 +618,12 @@ +