From bdcaaa55de446d3d882e444b5f601d11c9554439 Mon Sep 17 00:00:00 2001 From: Filipe Moreira Date: Sun, 8 Nov 2026 17:22:21 -0300 Subject: [PATCH] feat: remove an app from Home from its own tile The apps added with + could only leave Home from the System tab. On a custom app's tile, the Menu button (Start / Options) or a right click now opens a menu, in the option picker, with Remove from Home and Cancel. Steam, Playnite and Xbox mode have no menu, and Menu anywhere else on Home still plays. Removing an app keeps the launcher that opens, unless it was that app (then Steam Big Picture), and System goes on showing another app. The tour's launchers stop says how. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.en-US.md | 2 + CHANGELOG.md | 2 + docs/GUIDE.md | 2 +- docs/GUIDE.pt-BR.md | 2 +- docs/TESTING.md | 8 +++ src/ConsoleMode/Resources/Strings.de-DE.json | 4 +- src/ConsoleMode/Resources/Strings.en-US.json | 4 +- src/ConsoleMode/Resources/Strings.es-ES.json | 4 +- src/ConsoleMode/Resources/Strings.fr-FR.json | 4 +- src/ConsoleMode/Resources/Strings.pt-BR.json | 4 +- src/ConsoleMode/Resources/Strings.ru-RU.json | 4 +- .../ViewModels/MainViewModel.ConsoleTour.cs | 1 + .../ViewModels/MainViewModel.ConsoleUi.cs | 1 + .../ViewModels/MainViewModel.CustomApp.cs | 54 +++++++++++++++++-- src/ConsoleMode/Views/ConsoleHomeView.xaml | 2 +- src/ConsoleMode/Views/ConsoleHomeView.xaml.cs | 20 +++++++ tests/ConsoleMode.Tests/ConsoleTourTests.cs | 1 + 17 files changed, 105 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 76ce69c..a4da3d6 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 +- Home: the apps you added with **+** leave Home from their own tile. With the focus on it, **☰** (OPTIONS on PlayStation) or a right click opens a menu with **Remove from Home**. Before, only the System tab could do it. Steam, Playnite and Xbox mode have no such menu, and anywhere else on Home **☰** still starts playing. (#198) ## [1.7.0-beta.3] ### Changes diff --git a/CHANGELOG.md b/CHANGELOG.md index 3648f14..0be2a67 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 +- Início: os aplicativos que você adicionou pelo **+** saem da Início pelo próprio bloco. Com o foco nele, **☰** (OPTIONS no PlayStation) ou o botão direito do mouse abre um menu com **Remover da Início**. Antes só dava para tirar pela aba Sistema. Steam, Playnite e modo Xbox não têm esse menu, e no resto da Início o **☰** continua começando a jogar. (#198) ## [1.7.0-beta.3] ### Mudanças diff --git a/docs/GUIDE.md b/docs/GUIDE.md index 0f7cf3a..5eec866 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -31,7 +31,7 @@ The **Task View shortcut** does from the controller what Win + Tab does: it open Console Mode has one interface, made like a console's: it fills the screen and works with an Xbox or PlayStation controller, the mouse or the keyboard (click a tab or use Page Up / Page Down; Enter and Esc work as A and B). The first time you open it, a guided tour walks through the tabs, the launchers, the play button, the screens, the quick settings and the controller shortcuts; each stop moves on by itself once there has been time to read it (the bar under the card shows how long is left), **A** goes on at once, **B** skips it. To see it again: **System → App → Tutorial**. While the app loads it shows an opening with its logo and an entrance sound; any button skips it, now and then it is, as a surprise, one inspired by the Xbox 360 or the PS4, with that console's sound; **System → App** picks a style (which ends the surprises), plays it right away, and turns it off, or just its sound. -**Home** puts your launchers in a row at the top (Steam Big Picture, Playnite, Xbox mode): **A** on one picks what opens, and **Play now** below starts it. The line under the name says where you will play and what changes (audio, resolution, FPS, HDR, VRR); the round button next to Play now opens **Session**, with the screens and quick settings. +**Home** puts your launchers in a row at the top (Steam Big Picture, Playnite, Xbox mode): **A** on one picks what opens, and **Play now** below starts it. The **+** tile at the end adds an app of your own; on one of those, **☰** (OPTIONS on PlayStation) or a right click opens its menu, with **Remove from Home**. The line under the name says where you will play and what changes (audio, resolution, FPS, HDR, VRR); the round button next to Play now opens **Session**, with the screens and quick settings. The **System** tab lists its categories on the left (Gaming display, When entering console mode, Controller, TV, Optional extras, App, Shortcut, help, and data, More apps from the developer). Moving over a category shows its options on the right; **A** or right goes into them, and **B** or left goes back to the categories. diff --git a/docs/GUIDE.pt-BR.md b/docs/GUIDE.pt-BR.md index e5132a2..8f4ee83 100644 --- a/docs/GUIDE.pt-BR.md +++ b/docs/GUIDE.pt-BR.md @@ -31,7 +31,7 @@ O **atalho da visão de tarefas** faz pelo controle o que o Win + Tab faz: abre O Console Mode tem uma interface só, feita como a de um console: ocupa a tela toda e funciona com controle Xbox ou PlayStation, mouse ou teclado (clique numa aba ou use Page Up / Page Down; Enter e Esc fazem o papel de A e B). Na primeira vez que você abre, um tour guiado passa pelas abas, pelos iniciadores, pelo botão de jogar, pelas telas, pelos ajustes rápidos e pelos atalhos do controle; cada parada avança sozinha depois do tempo de ler (a barra embaixo do cartão mostra quanto falta), **A** avança na hora e **B** pula. Para ver de novo: **Sistema → App → Tutorial**. Enquanto carrega, o app mostra uma abertura com o logo e um som de entrada; qualquer botão pula, de vez em quando, de surpresa, vem uma inspirada no Xbox 360 ou no PS4, com o som do console; **Sistema → App** escolhe um estilo (o que acaba com as surpresas), mostra a abertura na hora e desliga a abertura ou só o som. -O **Início** mostra os seus iniciadores numa fileira no topo (Steam Big Picture, Playnite, modo Xbox): **A** num deles escolhe o que abre, e **Jogar agora** logo abaixo começa. A linha embaixo do nome diz onde você vai jogar e o que muda (áudio, resolução, FPS, HDR, VRR); o botão redondo ao lado de Jogar agora abre a **Sessão**, com as telas e os ajustes rápidos. +O **Início** mostra os seus iniciadores numa fileira no topo (Steam Big Picture, Playnite, modo Xbox): **A** num deles escolhe o que abre, e **Jogar agora** logo abaixo começa. O bloco **+** no fim adiciona um aplicativo seu; num deles, **☰** (OPTIONS no PlayStation) ou o botão direito do mouse abre o menu dele, com **Remover da Início**. A linha embaixo do nome diz onde você vai jogar e o que muda (áudio, resolução, FPS, HDR, VRR); o botão redondo ao lado de Jogar agora abre a **Sessão**, com as telas e os ajustes rápidos. A aba **Sistema** lista as categorias à esquerda (Tela de jogo, Ao entrar no modo console, Controle, TV, Extras opcionais, App, Atalho, ajuda e dados, Outros apps do desenvolvedor). Passar por uma categoria mostra as opções dela à direita; **A** ou a direita entra nelas, e **B** ou a esquerda volta para as categorias. diff --git a/docs/TESTING.md b/docs/TESTING.md index a0d580e..ab27b58 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -654,6 +654,14 @@ Pré-condições: a opção **Tirar o ponteiro do mouse do caminho** ligada (é - [ ] Sistema não mostra mais a categoria **TV**; o direcional e o mouse andam pelas outras categorias sem buracos. Resultado: ______ - [ ] Com uma Android TV que estava configurada na 1.6: uma sessão não liga a TV nem troca a entrada, e a volta não a coloca em espera (o log não tem linhas "TV: ligar" / "TV: desligar"). O `config.json` continua com o bloco `tv` como estava. Resultado: ______ +## Remover um app pelo bloco da Início (#198) + +- [ ] Com dois apps adicionados pelo **+**: foco num deles, **☰** (ou OPTIONS) abre o menu com o nome do app, **Remover da Início** e **Cancelar**. **Remover da Início** tira o bloco (e do `config.json`); **Cancelar** ou B fecham sem mudar nada. Resultado: ______ +- [ ] O botão direito do mouse no bloco abre o mesmo menu. Resultado: ______ +- [ ] Removendo o app que estava escolhido para abrir, o Steam Big Picture passa a ser o escolhido; removendo outro, o escolhido não muda. Resultado: ______ +- [ ] **☰** num bloco da Steam, do Playnite ou do modo Xbox, ou no botão **Jogar agora**, continua começando a jogar. Com uma sessão ativa, o menu não abre. Resultado: ______ +- [ ] Tour, parada dos iniciadores: o texto mostra o botão certo (☰ no Xbox, OPTIONS no PlayStation). 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. diff --git a/src/ConsoleMode/Resources/Strings.de-DE.json b/src/ConsoleMode/Resources/Strings.de-DE.json index 95a3041..ad719e5 100644 --- a/src/ConsoleMode/Resources/Strings.de-DE.json +++ b/src/ConsoleMode/Resources/Strings.de-DE.json @@ -408,7 +408,7 @@ "ConsoleTourTabsTitle": "Drei Tabs", "ConsoleTourTabsBody": "Startseite, Sitzung und System. Wechsle die Tabs mit {0} und {1} am Controller, Bild auf und Bild ab auf der Tastatur oder per Klick auf den Namen.", "ConsoleTourLaunchersTitle": "Was sich öffnet", - "ConsoleTourLaunchersBody": "Jede Kachel ist ein Launcher: Steam Big Picture, Playnite, der Xbox-Modus oder eine eigene App. Geh auf den, den du willst: Er wird markiert und öffnet sich, wenn du spielst.", + "ConsoleTourLaunchersBody": "Jede Kachel ist ein Launcher: Steam Big Picture, Playnite, der Xbox-Modus oder eine eigene App. Geh auf den, den du willst: Er wird markiert und öffnet sich, wenn du spielst. Bei einer eigenen App entfernt {0} oder ein Rechtsklick sie von der Startseite.", "ConsoleTourPlayTitle": "Spielen", "ConsoleTourPlayBody": "{0} hier, oder {1} von überall auf der Startseite, startet den Konsolenmodus: Der Spielbildschirm wird zum Hauptbildschirm, die anderen gehen aus und der Launcher öffnet sich darauf. Der Name und die Zeile darunter zeigen, was sich öffnet, wo du spielst und was sich ändert.", "ConsoleTourScreensTitle": "Deine Bildschirme", @@ -437,6 +437,8 @@ "AddCustomAppDescription": "Wähle eine .exe: Sie wird zur Kachel auf der Startseite, mit Symbol und Namen des Programms.", "RemoveCustomAppCard": "Diese App entfernen", "RemoveCustomAppDescription": "Entfernt die Kachel dieser App von der Startseite; stattdessen öffnet sich Steam Big Picture.", + "RemoveFromHome": "Von der Startseite entfernen", + "Cancel": "Abbrechen", "OtherAppsControlFsDescription": "Ein Dateimanager für den Controller, mit sicherem ZIP-Entpacker.", "OtherAppsTakoDescription": "Deine Spielebibliothek in einem Launcher für Fernseher und Controller.", "OtherAppsJoyChromiumDescription": "Ein Webbrowser für den Fernseher, mit dem Controller vom Sofa aus bedient.", diff --git a/src/ConsoleMode/Resources/Strings.en-US.json b/src/ConsoleMode/Resources/Strings.en-US.json index 1e85879..4adbe29 100644 --- a/src/ConsoleMode/Resources/Strings.en-US.json +++ b/src/ConsoleMode/Resources/Strings.en-US.json @@ -408,7 +408,7 @@ "ConsoleTourTabsTitle": "Three tabs", "ConsoleTourTabsBody": "Home, Session and System. Switch tabs with {0} and {1} on the controller, Page Up and Page Down on the keyboard, or by clicking a tab's name.", "ConsoleTourLaunchersTitle": "What opens", - "ConsoleTourLaunchersBody": "Each tile is a launcher: Steam Big Picture, Playnite, Xbox mode or an app of your own. Move over the one you want: it gets the check and is what opens when you play.", + "ConsoleTourLaunchersBody": "Each tile is a launcher: Steam Big Picture, Playnite, Xbox mode or an app of your own. Move over the one you want: it gets the check and is what opens when you play. On an app of your own, {0} or a right click takes it off Home.", "ConsoleTourPlayTitle": "Play", "ConsoleTourPlayBody": "{0} here, or {1} from anywhere on Home, enters console mode: the game display becomes the main one, the others go dark and the launcher opens on it. The name and the line under it show what opens, where you'll play and what changes.", "ConsoleTourScreensTitle": "Your displays", @@ -437,6 +437,8 @@ "AddCustomAppDescription": "Pick an .exe: it becomes a tile on Home, with the program's icon and name.", "RemoveCustomAppCard": "Remove this app", "RemoveCustomAppDescription": "Takes this app's tile off Home; Steam Big Picture opens instead.", + "RemoveFromHome": "Remove from Home", + "Cancel": "Cancel", "OtherAppsControlFsDescription": "A controller-first file manager, with a safe ZIP extractor.", "OtherAppsTakoDescription": "Your game library in a launcher made for the TV and the controller.", "OtherAppsJoyChromiumDescription": "A web browser for the TV, driven with a controller from the couch.", diff --git a/src/ConsoleMode/Resources/Strings.es-ES.json b/src/ConsoleMode/Resources/Strings.es-ES.json index ac19ef6..f6b3a75 100644 --- a/src/ConsoleMode/Resources/Strings.es-ES.json +++ b/src/ConsoleMode/Resources/Strings.es-ES.json @@ -408,7 +408,7 @@ "ConsoleTourTabsTitle": "Tres pestañas", "ConsoleTourTabsBody": "Inicio, Sesión y Sistema. Cambia de pestaña con {0} y {1} en el mando, Re Pág y Av Pág en el teclado o haciendo clic en su nombre.", "ConsoleTourLaunchersTitle": "Qué se abre", - "ConsoleTourLaunchersBody": "Cada bloque es un lanzador: Steam Big Picture, Playnite, el modo Xbox o una aplicación tuya. Pasa por encima del que quieras: queda marcado y es lo que se abre al jugar.", + "ConsoleTourLaunchersBody": "Cada bloque es un lanzador: Steam Big Picture, Playnite, el modo Xbox o una aplicación tuya. Pasa por encima del que quieras: queda marcado y es lo que se abre al jugar. En una aplicación tuya, {0} o el botón derecho del ratón la quita de Inicio.", "ConsoleTourPlayTitle": "Jugar", "ConsoleTourPlayBody": "{0} aquí, o {1} desde cualquier parte de Inicio, entra en el modo consola: la pantalla de juego pasa a ser la principal, las demás se apagan y el lanzador se abre en ella. El nombre y la línea de debajo muestran qué se abre, dónde vas a jugar y qué cambia.", "ConsoleTourScreensTitle": "Tus pantallas", @@ -437,6 +437,8 @@ "AddCustomAppDescription": "Elige un .exe: se convierte en un bloque en Inicio, con el icono y el nombre del programa.", "RemoveCustomAppCard": "Quitar esta aplicación", "RemoveCustomAppDescription": "Quita el bloque de esta aplicación de Inicio; en su lugar se abre Steam Big Picture.", + "RemoveFromHome": "Quitar de Inicio", + "Cancel": "Cancelar", "OtherAppsControlFsDescription": "Explorador de archivos pensado para el mando, con extractor de ZIP seguro.", "OtherAppsTakoDescription": "Tu biblioteca de juegos en un lanzador hecho para la TV y el mando.", "OtherAppsJoyChromiumDescription": "Navegador para la TV que se usa con el mando, desde el sofá.", diff --git a/src/ConsoleMode/Resources/Strings.fr-FR.json b/src/ConsoleMode/Resources/Strings.fr-FR.json index 9b87d7c..e97dfc3 100644 --- a/src/ConsoleMode/Resources/Strings.fr-FR.json +++ b/src/ConsoleMode/Resources/Strings.fr-FR.json @@ -408,7 +408,7 @@ "ConsoleTourTabsTitle": "Trois onglets", "ConsoleTourTabsBody": "Accueil, Session et Système. Changez d'onglet avec {0} et {1} sur la manette, Page précédente et Page suivante au clavier ou en cliquant sur son nom.", "ConsoleTourLaunchersTitle": "Ce qui s'ouvre", - "ConsoleTourLaunchersBody": "Chaque tuile est un lanceur : Steam Big Picture, Playnite, le mode Xbox ou une application à vous. Placez-vous sur celui que vous voulez : il est coché et c'est lui qui s'ouvre quand vous jouez.", + "ConsoleTourLaunchersBody": "Chaque tuile est un lanceur : Steam Big Picture, Playnite, le mode Xbox ou une application à vous. Placez-vous sur celui que vous voulez : il est coché et c'est lui qui s'ouvre quand vous jouez. Sur une application à vous, {0} ou un clic droit la retire de l'Accueil.", "ConsoleTourPlayTitle": "Jouer", "ConsoleTourPlayBody": "{0} ici, ou {1} depuis n'importe où sur l'Accueil, lance le mode console : l'écran de jeu devient l'écran principal, les autres s'éteignent et le lanceur s'y ouvre. Le nom et la ligne en dessous indiquent ce qui s'ouvre, où vous jouerez et ce qui change.", "ConsoleTourScreensTitle": "Vos écrans", @@ -437,6 +437,8 @@ "AddCustomAppDescription": "Choisissez un .exe : il devient une tuile de l'Accueil, avec l'icône et le nom du programme.", "RemoveCustomAppCard": "Retirer cette application", "RemoveCustomAppDescription": "Retire la tuile de cette application de l'Accueil ; Steam Big Picture s'ouvre à la place.", + "RemoveFromHome": "Retirer de l'Accueil", + "Cancel": "Annuler", "OtherAppsControlFsDescription": "Un gestionnaire de fichiers pensé pour la manette, avec un extracteur ZIP sûr.", "OtherAppsTakoDescription": "Votre bibliothèque de jeux dans un lanceur fait pour la TV et la manette.", "OtherAppsJoyChromiumDescription": "Un navigateur pour la TV, piloté à la manette depuis le canapé.", diff --git a/src/ConsoleMode/Resources/Strings.pt-BR.json b/src/ConsoleMode/Resources/Strings.pt-BR.json index e5a7227..0ad5d12 100644 --- a/src/ConsoleMode/Resources/Strings.pt-BR.json +++ b/src/ConsoleMode/Resources/Strings.pt-BR.json @@ -408,7 +408,7 @@ "ConsoleTourTabsTitle": "Três abas", "ConsoleTourTabsBody": "Início, Sessão e Sistema. Troque de aba com {0} e {1} no controle, Page Up e Page Down no teclado ou clicando no nome dela.", "ConsoleTourLaunchersTitle": "O que vai abrir", - "ConsoleTourLaunchersBody": "Cada bloco é um iniciador: Steam Big Picture, Playnite, modo Xbox ou um aplicativo seu. Passe por cima do que você quer: ele fica marcado e é o que abre quando você jogar.", + "ConsoleTourLaunchersBody": "Cada bloco é um iniciador: Steam Big Picture, Playnite, modo Xbox ou um aplicativo seu. Passe por cima do que você quer: ele fica marcado e é o que abre quando você jogar. Num aplicativo seu, {0} ou o botão direito do mouse tira ele da Início.", "ConsoleTourPlayTitle": "Jogar", "ConsoleTourPlayBody": "{0} aqui, ou {1} de qualquer lugar da Início, entra no modo console: a tela de jogo vira a principal, as outras se apagam e o iniciador abre nela. O nome e a linha embaixo dele mostram o que abre, onde você vai jogar e o que muda.", "ConsoleTourScreensTitle": "Suas telas", @@ -437,6 +437,8 @@ "AddCustomAppDescription": "Escolha um .exe: ele vira um bloco no Início, com o ícone e o nome do programa.", "RemoveCustomAppCard": "Remover este aplicativo", "RemoveCustomAppDescription": "Tira o bloco deste aplicativo do Início; o Steam Big Picture passa a abrir no lugar.", + "RemoveFromHome": "Remover da Início", + "Cancel": "Cancelar", "OtherAppsControlFsDescription": "Explorador de arquivos feito para o controle, com extrator de ZIP seguro.", "OtherAppsTakoDescription": "Sua biblioteca de jogos num launcher feito para a TV e o controle.", "OtherAppsJoyChromiumDescription": "Navegador para a TV que se usa com o controle, do sofá.", diff --git a/src/ConsoleMode/Resources/Strings.ru-RU.json b/src/ConsoleMode/Resources/Strings.ru-RU.json index f675d96..a70d510 100644 --- a/src/ConsoleMode/Resources/Strings.ru-RU.json +++ b/src/ConsoleMode/Resources/Strings.ru-RU.json @@ -408,7 +408,7 @@ "ConsoleTourTabsTitle": "Три вкладки", "ConsoleTourTabsBody": "Главная, Сеанс и Система. Переключайте вкладки кнопками {0} и {1} на геймпаде, клавишами Page Up и Page Down или щелчком по названию.", "ConsoleTourLaunchersTitle": "Что откроется", - "ConsoleTourLaunchersBody": "Каждая плитка — это лаунчер: Steam Big Picture, Playnite, режим Xbox или ваше приложение. Наведитесь на нужный: он отмечается и откроется, когда вы начнёте играть.", + "ConsoleTourLaunchersBody": "Каждая плитка — это лаунчер: Steam Big Picture, Playnite, режим Xbox или ваше приложение. Наведитесь на нужный: он отмечается и откроется, когда вы начнёте играть. Ваше приложение можно убрать с главной кнопкой {0} или правым щелчком мыши.", "ConsoleTourPlayTitle": "Играть", "ConsoleTourPlayBody": "{0} здесь или {1} из любого места на Главной включает режим консоли: игровой экран становится основным, остальные гаснут, и на нём открывается лаунчер. Название и строка под ним показывают, что откроется, где вы будете играть и что изменится.", "ConsoleTourScreensTitle": "Ваши экраны", @@ -437,6 +437,8 @@ "AddCustomAppDescription": "Выберите .exe: он станет плиткой на Главной со значком и названием программы.", "RemoveCustomAppCard": "Удалить это приложение", "RemoveCustomAppDescription": "Убирает плитку этого приложения с Главной; вместо него откроется Steam Big Picture.", + "RemoveFromHome": "Убрать с главной", + "Cancel": "Отмена", "OtherAppsControlFsDescription": "Файловый менеджер для геймпада с безопасной распаковкой ZIP.", "OtherAppsTakoDescription": "Ваша библиотека игр в лаунчере для телевизора и геймпада.", "OtherAppsJoyChromiumDescription": "Браузер для телевизора, которым управляют геймпадом с дивана.", diff --git a/src/ConsoleMode/ViewModels/MainViewModel.ConsoleTour.cs b/src/ConsoleMode/ViewModels/MainViewModel.ConsoleTour.cs index 2210247..6d4d51f 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.ConsoleTour.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.ConsoleTour.cs @@ -31,6 +31,7 @@ public partial class MainViewModel private object[] ConsoleTourArgs(ConsoleTourStop stop) => stop switch { ConsoleTourStop.Tabs => [HintLb, HintRb], + ConsoleTourStop.Launchers => [HintMenu], ConsoleTourStop.Play => [HintConfirm, HintMenu], ConsoleTourStop.Screens => [HintConfirm], ConsoleTourStop.System => [HintAlt], diff --git a/src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs b/src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs index 6518224..ca74b07 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs @@ -292,6 +292,7 @@ private void PickOption(PickerItem? item) case "overlaysize": SelectedFpsOverlaySize = FpsOverlaySizeOptions.FirstOrDefault(o => o.Value == item.Value) ?? SelectedFpsOverlaySize; break; case "overlayposition": SelectedFpsOverlayPosition = FpsOverlayPositionOptions.FirstOrDefault(o => o.Value == item.Value) ?? SelectedFpsOverlayPosition; break; case "overlaycolor": SelectedFpsOverlayColor = FpsOverlayColorOptions.FirstOrDefault(o => o.Value == item.Value) ?? SelectedFpsOverlayColor; break; + case "tile": PickTileMenu(item.Value); break; case "profiles": if (int.TryParse(item.Value, out var appId)) RemoveGameProfile(GameProfileItems.FirstOrDefault(p => p.AppId == appId)); diff --git a/src/ConsoleMode/ViewModels/MainViewModel.CustomApp.cs b/src/ConsoleMode/ViewModels/MainViewModel.CustomApp.cs index e1a9475..434661a 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.CustomApp.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.CustomApp.cs @@ -126,15 +126,59 @@ private async Task PickCustomAppPathAsync() [RelayCommand] private void RemoveCustomApp() { - if (IsConsoleActive || SelectedCustomApp is not { } app) return; - _customApps.Remove(app); - _customAppId = _customApps.FirstOrDefault()?.Id ?? ""; - ShowSelectedCustomApp(); - RebuildLaunchOptions("bigPicture"); + if (SelectedCustomApp is { } app) RemoveCustomAppEntry(app); + } + + /// + /// Takes an app off Home (System, or its tile's menu). The launcher that opens stays, unless it was this app: then + /// Steam Big Picture opens instead. System goes on showing another of the apps, if any is left. + /// + private void RemoveCustomAppEntry(CustomAppEntry app) + { + if (IsConsoleActive || !_customApps.Remove(app)) return; + var wasLauncher = SelectedLaunch?.Value == CustomApp.EntryMode(app.Id); + if (_customAppId == app.Id) + { + _customAppId = _customApps.FirstOrDefault()?.Id ?? ""; + ShowSelectedCustomApp(); + } + RebuildLaunchOptions(wasLauncher ? "bigPicture" : null); AppLog.Write($"Aplicativo personalizado: removido {app.Path}"); SettingChanged(); } + // ── A custom app's tile menu (Start / Options on it, or a right click): Remove from Home ── + + private const string TileMenuRemove = "remove"; + private const string TileMenuCancel = "cancel"; + /// The app whose tile menu is open (its id). + private string _tileMenuAppId = ""; + + /// Only the apps added with "+" have one: Steam, Playnite and Xbox mode always stay. + public static bool HasTileMenu(LaunchTile? tile) => tile is { IsAdd: false } && CustomApp.IsEntryMode(tile.Option.Value); + + /// Opens the tile's menu in the option picker, titled with the app's name. False when it has none. + public bool OpenTileMenu(LaunchTile? tile) + { + if (IsConsoleActive || !HasTileMenu(tile) || CustomApp.EntryId(tile!.Option.Value) is not { } id) return false; + _tileMenuAppId = id; + _pickerKey = "tile"; + PickerTitle = tile.Text; + PickerOptions.Clear(); + PickerOptions.Add(new PickerItem(LocalizationService.Get("RemoveFromHome"), TileMenuRemove, false)); + PickerOptions.Add(new PickerItem(LocalizationService.Get("Cancel"), TileMenuCancel, false)); + IsRolePanelOpen = false; + IsPickerOpen = true; + AppLog.Write($"Início: menu do bloco \"{tile.Text}\""); + return true; + } + + private void PickTileMenu(string value) + { + if (value == TileMenuRemove && _customApps.FirstOrDefault(a => a.Id == _tileMenuAppId) is { } app) RemoveCustomAppEntry(app); + _tileMenuAppId = ""; + } + private async Task PickExeAsync() { try diff --git a/src/ConsoleMode/Views/ConsoleHomeView.xaml b/src/ConsoleMode/Views/ConsoleHomeView.xaml index 494775e..32aa479 100644 --- a/src/ConsoleMode/Views/ConsoleHomeView.xaml +++ b/src/ConsoleMode/Views/ConsoleHomeView.xaml @@ -261,7 +261,7 @@