Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
7 changes: 7 additions & 0 deletions src/ConsoleMode/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DidPresenterChange reports whether the AppWindow.Presenter property changed, but minimizing changes the existing presenter's State, so this guard can discard the minimize event before checking for Minimized. As a result, enabling the option may still leave the minimized window on the taskbar; observe the presenter-state transition without requiring the presenter object itself to change.

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) =>
{
Expand Down
3 changes: 3 additions & 0 deletions src/ConsoleMode/Models/Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public sealed class AppConfig
/// <summary>Sounds for moving, picking and going back in the console interface.</summary>
public bool InterfaceSounds { get; set; } = true;

/// <summary>Minimizing the main window hides it in the tray instead of leaving it on the taskbar.</summary>
public bool MinimizeToTray { get; set; }

/// <summary>Console background: "auto" (covers of the installed Steam games), "gradient" or "image".</summary>
public string ConsoleBackground { get; set; } = "auto";

Expand Down
2 changes: 2 additions & 0 deletions src/ConsoleMode/Resources/Strings.en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/ConsoleMode/Resources/Strings.es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/ConsoleMode/Resources/Strings.pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/ConsoleMode/Services/LocalizationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
public ObservableCollection<ComboOption> UiModeOptions { get; } = [];
public ObservableCollection<ComboOption> ControllerLayoutOptions { get; } = [];

[ObservableProperty] private bool _isConsoleUi;

Check warning on line 16 in src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs

View workflow job for this annotation

GitHub Actions / Build and test

The field ConsoleMode.ViewModels.MainViewModel._isConsoleUi using
[ObservableProperty] private ComboOption? _selectedUiMode;

Check warning on line 17 in src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs

View workflow job for this annotation

GitHub Actions / Build and test

The field ConsoleMode.ViewModels.MainViewModel._selectedUiMode using
[ObservableProperty] private bool _isRolePanelOpen;

Check warning on line 18 in src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs

View workflow job for this annotation

GitHub Actions / Build and test

The field ConsoleMode.ViewModels.MainViewModel._isRolePanelOpen using
[ObservableProperty] private MonitorRowViewModel? _rolePanelMonitor;

Check warning on line 19 in src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs

View workflow job for this annotation

GitHub Actions / Build and test

The field ConsoleMode.ViewModels.MainViewModel._rolePanelMonitor using
[ObservableProperty] private bool _isPlayStationHints;

Check warning on line 20 in src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs

View workflow job for this annotation

GitHub Actions / Build and test

The field ConsoleMode.ViewModels.MainViewModel._isPlayStationHints using
[ObservableProperty] private ComboOption? _selectedControllerLayout;

Check warning on line 21 in src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs

View workflow job for this annotation

GitHub Actions / Build and test

The field ConsoleMode.ViewModels.MainViewModel._selectedControllerLayout using
private ControllerFamily _detectedControllerFamily;

/// <summary>Set by App when the session was requested from the controller's Home button.</summary>
Expand Down Expand Up @@ -259,6 +259,7 @@
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;
Expand Down
3 changes: 3 additions & 0 deletions src/ConsoleMode/ViewModels/MainViewModel.Updates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/ConsoleMode/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -926,6 +927,7 @@ private AppConfig BuildConfig()
HomeButtonShortPress = HomeButtonShortPress,
AutoStartOnController = AutoStartOnController,
InterfaceSounds = InterfaceSounds,
MinimizeToTray = MinimizeToTray,
ConsoleBackground = ConsoleBackgroundMode,
ConsoleBackgroundImage = ConsoleBackgroundImage,
CloseSteamOnRestore = CloseSteamOnRestore,
Expand Down
6 changes: 6 additions & 0 deletions src/ConsoleMode/Views/ConsoleHomeView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,12 @@
<TextBlock Grid.Column="1" Style="{StaticResource RowValue}" Text="{x:Bind ViewModel.OnOff(ViewModel.StartWithWindows), Mode=OneWay}"/>
</Grid>
</Button>
<Button Style="{StaticResource ConsoleRow}" Command="{x:Bind ViewModel.CycleSettingCommand}" CommandParameter="minimizetray">
<Grid ColumnSpacing="24"><Grid.ColumnDefinitions><ColumnDefinition Width="3*"/><ColumnDefinition Width="2*"/></Grid.ColumnDefinitions>
<TextBlock Style="{StaticResource RowLabel}" Text="{x:Bind ViewModel.Texts.MinimizeToTrayCard, Mode=OneWay}"/>
<TextBlock Grid.Column="1" Style="{StaticResource RowValue}" Text="{x:Bind ViewModel.OnOff(ViewModel.MinimizeToTray), Mode=OneWay}"/>
</Grid>
</Button>
<Button Style="{StaticResource ConsoleRow}" Command="{x:Bind ViewModel.CycleSettingCommand}" CommandParameter="updates">
<Grid ColumnSpacing="24"><Grid.ColumnDefinitions><ColumnDefinition Width="3*"/><ColumnDefinition Width="2*"/></Grid.ColumnDefinitions>
<TextBlock Style="{StaticResource RowLabel}" Text="{x:Bind ViewModel.Texts.NotifyUpdatesCard, Mode=OneWay}"/>
Expand Down
7 changes: 7 additions & 0 deletions src/ConsoleMode/Views/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,13 @@
<ToggleSwitch IsOn="{x:Bind ViewModel.StartWithWindows, Mode=TwoWay}"
OnContent="{x:Bind ViewModel.Texts.ToggleOn, Mode=OneWay}" OffContent="{x:Bind ViewModel.Texts.ToggleOff, Mode=OneWay}"/>
</ctk:SettingsCard>
<ctk:SettingsCard Header="{x:Bind ViewModel.Texts.MinimizeToTrayCard, Mode=OneWay}" Description="{x:Bind ViewModel.Texts.MinimizeToTrayDescription, Mode=OneWay}">
<ctk:SettingsCard.HeaderIcon>
<FontIcon Glyph="&#xE921;"/>
</ctk:SettingsCard.HeaderIcon>
<ToggleSwitch IsOn="{x:Bind ViewModel.MinimizeToTray, Mode=TwoWay}"
OnContent="{x:Bind ViewModel.Texts.ToggleOn, Mode=OneWay}" OffContent="{x:Bind ViewModel.Texts.ToggleOff, Mode=OneWay}"/>
</ctk:SettingsCard>
<ctk:SettingsCard Header="{x:Bind ViewModel.Texts.UpdatesCard, Mode=OneWay}" Description="{x:Bind ViewModel.UpdateStatusText, Mode=OneWay}">
<ctk:SettingsCard.HeaderIcon>
<FontIcon Glyph="&#xE895;"/>
Expand Down
Loading