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 @@ -5,6 +5,8 @@ English (US) release notes, mirroring CHANGELOG.md (Brazilian Portuguese). Befor
## [Unreleased]
### Changes
- Home: clicking a launcher (or pressing A on it) only picks what will open; **Play now** is what starts. Before, the click went straight into console mode, so picking looked like opening. With a controller or the keyboard, the focus moves down to **Play now** after the pick, so a second A plays. (#193)
### Fixes
- System and Session: picking an option from a list (resolution, audio output, how to turn the other screens off...) or closing it with B leaves the focus on the same row. Before, it went back to the category or the first screen, and you had to scroll down all over again. (#196)

## [1.7.0-beta.2]
### Fixes
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Notas em português do Brasil; a versão em inglês (Estados Unidos) fica em `CH
## [Unreleased]
### Mudanças
- Início: clicar num iniciador (ou apertar A nele) só escolhe o que vai abrir; quem começa é **Jogar agora**. Antes o clique já entrava no modo console, e escolher parecia abrir sozinho. No controle e no teclado, o foco desce para **Jogar agora** depois da escolha, então um segundo A joga. (#193)
### Correções
- Sistema e Sessão: escolher uma opção numa lista (resolução, saída de áudio, como desligar as outras telas...) ou fechá-la com B deixa o foco na mesma linha. Antes ele voltava para a categoria ou para a primeira tela, e era preciso descer tudo de novo. (#196)

## [1.7.0-beta.2]
### Correções
Expand Down
6 changes: 6 additions & 0 deletions docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,12 @@ Pré-condições: a opção **Tirar o ponteiro do mouse do caminho** ligada (é
- [ ] Fechar o Playnite depois disso encerra a sessão e a mesa volta como estava ("Restore: concluído com sucesso", sem "Não foi possível desconectar"). Resultado: ______
- [ ] Com a TV como tela de jogo e os dois monitores da mesa desligados pela sessão, abrir e encerrar várias sessões seguidas. Se o log mostrar "Telas: a tela de jogo passou de … para …", a resolução da TV é aplicada, o jogo abre na TV e a volta religa os monitores da mesa nas posições certas (o log da volta mostra "telas com outro nome desde o backup"). Resultado: ______

## Foco volta para a linha depois de uma lista (#196)

- [ ] Sistema, com o controle: descer até uma opção que não seja a primeira (ex.: Como desligar as outras telas), abrir com A, escolher outro valor com A. O foco fica nessa mesma opção. Fechar outra lista com B também volta para a linha dela. Resultado: ______
- [ ] Sessão: Saída de áudio e Resolução, escolhendo um valor ou fechando com B: o foco volta para o ajuste, não para a primeira tela. Resultado: ______
- [ ] Com o mouse: clicar numa opção, escolher um valor; a lista fecha e a página não pula. Resultado: ______

## Interface única e tour guiado (1.7.0)

Pré-condições: um `config.json` sem `consoleTourDone` (vale para quem atualiza de uma versão anterior, mesmo tendo visto o tutorial antigo). Teste com controle, só com mouse e só com teclado.
Expand Down
22 changes: 21 additions & 1 deletion src/ConsoleMode/Views/ConsoleHomeView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public sealed partial class ConsoleHomeView : UserControl
private static Style? _cardStyle;
private static Style? _launchTileStyle;
private Control? _lastSettingsRow;
/// <summary>The row whose picker is open (or was, until the focus goes back to it).</summary>
private Control? _pickerOpener;
private readonly ScrollEdges _rowsEdges;
/// <summary>When a category was last pressed with the mouse / touch: that click picks it, A goes into its options.</summary>
private long _railPointerPressedAt = long.MinValue / 2;
Expand Down Expand Up @@ -166,10 +168,15 @@ private void OnViewModelChanged(object? sender, PropertyChangedEventArgs e)
});
break;
case nameof(MainViewModel.IsPickerOpen):
// The row that opened it still has the focus here: closing the picker lands back on that row (the
// resolution, an audio output...), not on the first one of the page.
if (ViewModel.IsPickerOpen && !IsFocusInside(PickerPanel))
_pickerOpener = Root.XamlRoot is { } root ? FocusManager.GetFocusedElement(root) as Control : null;
DispatcherQueue.TryEnqueue(() =>
{
if (ViewModel.IsPickerOpen) FocusPickerSelection();
else if (ViewModel.IsConsoleSettingsOpen) FocusSystemRow();
else if (BackToPickerOpener()) { }
else if (ViewModel.IsConsoleSettingsOpen || ViewModel.IsSystemTab && _lastSettingsRow is not null) FocusSystemRow();
else FocusDefault();
});
break;
Expand Down Expand Up @@ -256,6 +263,19 @@ private void FocusDefault()
(FocusManager.FindFirstFocusableElement(ScreenCards) as Control)?.Focus(FocusState.Keyboard);
}

/// <summary>
/// The picker closed (a value picked or B): back to the row that opened it, if it is still on screen. A choice can
/// rebuild the page under it (another resolution list, say); then the caller falls back to the usual spot.
/// </summary>
private bool BackToPickerOpener()
{
var opener = _pickerOpener;
_pickerOpener = null;
if (opener is null || opener.XamlRoot is null || opener.Visibility != Visibility.Visible || !opener.IsEnabled) return false;
if (!IsInside(opener, Root) || IsInside(opener, PickerPanel)) return false;
return opener.Focus(FocusState.Keyboard);
}

/// <summary>Land on the current value so A confirms it and the stick moves from there.</summary>
private void FocusPickerSelection()
{
Expand Down
Loading