From b540ea80d16488d1e5b3eb6ca6b9e93cc663b06f Mon Sep 17 00:00:00 2001 From: Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> Date: Thu, 1 Dec 2022 21:31:21 -0500 Subject: [PATCH] Ava GUI: Make Dialogue More Intuitive (#3955) * Adjust button position and locales * Shortcuts + Highlight default action * Update Locales - Corrections Welcome * Move `Apply` button back to right side * OS Reactive Button layout * Fix reversed boolean :) * Fix accented button styling --- Ryujinx.Ava/Assets/Locales/de_DE.json | 4 +-- Ryujinx.Ava/Assets/Locales/el_GR.json | 4 +-- Ryujinx.Ava/Assets/Locales/en_US.json | 4 +-- Ryujinx.Ava/Assets/Locales/es_ES.json | 4 +-- Ryujinx.Ava/Assets/Locales/fr_FR.json | 4 +-- Ryujinx.Ava/Assets/Locales/it_IT.json | 4 +-- Ryujinx.Ava/Assets/Locales/ja_JP.json | 4 +-- Ryujinx.Ava/Assets/Locales/ko_KR.json | 4 +-- Ryujinx.Ava/Assets/Locales/pl_PL.json | 4 +-- Ryujinx.Ava/Assets/Locales/pt_BR.json | 4 +-- Ryujinx.Ava/Assets/Locales/ru_RU.json | 4 +-- Ryujinx.Ava/Assets/Locales/tr_TR.json | 4 +-- Ryujinx.Ava/Assets/Locales/zh_CN.json | 4 +-- Ryujinx.Ava/Assets/Locales/zh_TW.json | 4 +-- .../Ui/ViewModels/SettingsViewModel.cs | 36 ++++++++++++++++++- Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml | 23 ++++++++---- .../Ui/Windows/SettingsWindow.axaml.cs | 30 ---------------- 17 files changed, 79 insertions(+), 66 deletions(-) diff --git a/Ryujinx.Ava/Assets/Locales/de_DE.json b/Ryujinx.Ava/Assets/Locales/de_DE.json index cb8d787b8..449f53886 100644 --- a/Ryujinx.Ava/Assets/Locales/de_DE.json +++ b/Ryujinx.Ava/Assets/Locales/de_DE.json @@ -166,8 +166,8 @@ "SettingsTabInput": "Eingabe", "SettingsTabInputEnableDockedMode": "Docked Modus", "SettingsTabInputDirectKeyboardAccess": "Direkter Tastaturzugriff", - "SettingsButtonSave": "Speichern", - "SettingsButtonClose": "Schließen", + "SettingsButtonOk": "OK", + "SettingsButtonCancel": "Abbrechen", "SettingsButtonApply": "Übernehmen", "ControllerSettingsPlayer": "Spieler", "ControllerSettingsPlayer1": "Spieler 1", diff --git a/Ryujinx.Ava/Assets/Locales/el_GR.json b/Ryujinx.Ava/Assets/Locales/el_GR.json index 4fb8bf567..cd806544e 100644 --- a/Ryujinx.Ava/Assets/Locales/el_GR.json +++ b/Ryujinx.Ava/Assets/Locales/el_GR.json @@ -166,8 +166,8 @@ "SettingsTabInput": "Χειρισμός", "SettingsTabInputEnableDockedMode": "Ενεργοποίηση Docked Mode", "SettingsTabInputDirectKeyboardAccess": "Άμεση Πρόσβαση στο Πληκτρολόγιο", - "SettingsButtonSave": "Αποθήκευση", - "SettingsButtonClose": "Κλείσιμο", + "SettingsButtonOk": "OK", + "SettingsButtonCancel": "Ακύρωση", "SettingsButtonApply": "Εφαρμογή", "ControllerSettingsPlayer": "Παίχτης", "ControllerSettingsPlayer1": "Παίχτης 1", diff --git a/Ryujinx.Ava/Assets/Locales/en_US.json b/Ryujinx.Ava/Assets/Locales/en_US.json index 86cb44c9a..87a2f50db 100644 --- a/Ryujinx.Ava/Assets/Locales/en_US.json +++ b/Ryujinx.Ava/Assets/Locales/en_US.json @@ -166,8 +166,8 @@ "SettingsTabInput": "Input", "SettingsTabInputEnableDockedMode": "Docked Mode", "SettingsTabInputDirectKeyboardAccess": "Direct Keyboard Access", - "SettingsButtonSave": "Save", - "SettingsButtonClose": "Close", + "SettingsButtonOk": "OK", + "SettingsButtonCancel": "Cancel", "SettingsButtonApply": "Apply", "ControllerSettingsPlayer": "Player", "ControllerSettingsPlayer1": "Player 1", diff --git a/Ryujinx.Ava/Assets/Locales/es_ES.json b/Ryujinx.Ava/Assets/Locales/es_ES.json index e6ba35c07..379682eae 100644 --- a/Ryujinx.Ava/Assets/Locales/es_ES.json +++ b/Ryujinx.Ava/Assets/Locales/es_ES.json @@ -166,8 +166,8 @@ "SettingsTabInput": "Entrada", "SettingsTabInputEnableDockedMode": "Modo dock/TV", "SettingsTabInputDirectKeyboardAccess": "Acceso directo al teclado", - "SettingsButtonSave": "Guardar", - "SettingsButtonClose": "Cerrar", + "SettingsButtonOk": "OK", + "SettingsButtonCancel": "Cancelar", "SettingsButtonApply": "Aplicar", "ControllerSettingsPlayer": "Jugador", "ControllerSettingsPlayer1": "Jugador 1", diff --git a/Ryujinx.Ava/Assets/Locales/fr_FR.json b/Ryujinx.Ava/Assets/Locales/fr_FR.json index 29d26ec88..4b0780d2e 100644 --- a/Ryujinx.Ava/Assets/Locales/fr_FR.json +++ b/Ryujinx.Ava/Assets/Locales/fr_FR.json @@ -159,8 +159,8 @@ "SettingsTabInput": "Contrôles", "SettingsTabInputEnableDockedMode": "Active le mode station d'accueil", "SettingsTabInputDirectKeyboardAccess": "Accès direct au clavier", - "SettingsButtonSave": "Enregistrer", - "SettingsButtonClose": "Fermer", + "SettingsButtonOk": "OK", + "SettingsButtonCancel": "Annuler", "SettingsButtonApply": "Appliquer", "ControllerSettingsPlayer": "Joueur", "ControllerSettingsPlayer1": "Joueur 1", diff --git a/Ryujinx.Ava/Assets/Locales/it_IT.json b/Ryujinx.Ava/Assets/Locales/it_IT.json index beed9a995..3ab2617c0 100644 --- a/Ryujinx.Ava/Assets/Locales/it_IT.json +++ b/Ryujinx.Ava/Assets/Locales/it_IT.json @@ -166,8 +166,8 @@ "SettingsTabInput": "Input", "SettingsTabInputEnableDockedMode": "Attiva modalità TV", "SettingsTabInputDirectKeyboardAccess": "Accesso diretto alla tastiera", - "SettingsButtonSave": "Salva", - "SettingsButtonClose": "Chiudi", + "SettingsButtonOk": "OK", + "SettingsButtonCancel": "Cancella", "SettingsButtonApply": "Applica", "ControllerSettingsPlayer": "Giocatore", "ControllerSettingsPlayer1": "Giocatore 1", diff --git a/Ryujinx.Ava/Assets/Locales/ja_JP.json b/Ryujinx.Ava/Assets/Locales/ja_JP.json index 5d95d7d08..549eabb49 100644 --- a/Ryujinx.Ava/Assets/Locales/ja_JP.json +++ b/Ryujinx.Ava/Assets/Locales/ja_JP.json @@ -166,8 +166,8 @@ "SettingsTabInput": "入力", "SettingsTabInputEnableDockedMode": "ドッキングモード", "SettingsTabInputDirectKeyboardAccess": "キーボード直接アクセス", - "SettingsButtonSave": "セーブ", - "SettingsButtonClose": "閉じる", + "SettingsButtonOk": "オーケー", + "SettingsButtonCancel": "キャンセル", "SettingsButtonApply": "適用", "ControllerSettingsPlayer": "プレイヤー", "ControllerSettingsPlayer1": "プレイヤー 1", diff --git a/Ryujinx.Ava/Assets/Locales/ko_KR.json b/Ryujinx.Ava/Assets/Locales/ko_KR.json index cc7232c9f..c1b000b87 100644 --- a/Ryujinx.Ava/Assets/Locales/ko_KR.json +++ b/Ryujinx.Ava/Assets/Locales/ko_KR.json @@ -165,8 +165,8 @@ "SettingsTabInput": "입력", "SettingsTabInputEnableDockedMode": "도킹 모드 활성화", "SettingsTabInputDirectKeyboardAccess": "직접 키보드 액세스", - "SettingsButtonSave": "구하다", - "SettingsButtonClose": "출구", + "SettingsButtonOk": "좋아", + "SettingsButtonCancel": "취소", "SettingsButtonApply": "적용하다", "ControllerSettingsPlayer": "플레이어", "ControllerSettingsPlayer1": "플레이어 1", diff --git a/Ryujinx.Ava/Assets/Locales/pl_PL.json b/Ryujinx.Ava/Assets/Locales/pl_PL.json index d7f8a1bcb..5a701c237 100644 --- a/Ryujinx.Ava/Assets/Locales/pl_PL.json +++ b/Ryujinx.Ava/Assets/Locales/pl_PL.json @@ -166,8 +166,8 @@ "SettingsTabInput": "Sterowanie", "SettingsTabInputEnableDockedMode": "Tryb Zadokowany", "SettingsTabInputDirectKeyboardAccess": "Bezpośredni Dostęp do Klawiatury", - "SettingsButtonSave": "Zapisz", - "SettingsButtonClose": "Zamknij", + "SettingsButtonOk": "OK", + "SettingsButtonCancel": "Anuluj", "SettingsButtonApply": "Zastosuj", "ControllerSettingsPlayer": "Gracz", "ControllerSettingsPlayer1": "Gracz 1", diff --git a/Ryujinx.Ava/Assets/Locales/pt_BR.json b/Ryujinx.Ava/Assets/Locales/pt_BR.json index c49084d89..a8b02f676 100644 --- a/Ryujinx.Ava/Assets/Locales/pt_BR.json +++ b/Ryujinx.Ava/Assets/Locales/pt_BR.json @@ -166,8 +166,8 @@ "SettingsTabInput": "Controle", "SettingsTabInputEnableDockedMode": "Habilitar modo TV", "SettingsTabInputDirectKeyboardAccess": "Acesso direto ao teclado", - "SettingsButtonSave": "Salvar", - "SettingsButtonClose": "Fechar", + "SettingsButtonOk": "OK", + "SettingsButtonCancel": "Cancelar", "SettingsButtonApply": "Aplicar", "ControllerSettingsPlayer": "Jogador", "ControllerSettingsPlayer1": "Jogador 1", diff --git a/Ryujinx.Ava/Assets/Locales/ru_RU.json b/Ryujinx.Ava/Assets/Locales/ru_RU.json index e2788296c..fa74c4b92 100644 --- a/Ryujinx.Ava/Assets/Locales/ru_RU.json +++ b/Ryujinx.Ava/Assets/Locales/ru_RU.json @@ -165,8 +165,8 @@ "SettingsTabInput": "Управление", "SettingsTabInputEnableDockedMode": "Включить режим закрепления", "SettingsTabInputDirectKeyboardAccess": "Прямой доступ с клавиатуры", - "SettingsButtonSave": "Сохранить", - "SettingsButtonClose": "Закрыть", + "SettingsButtonOk": "OK", + "SettingsButtonCancel": "Отмена", "SettingsButtonApply": "Применить", "ControllerSettingsPlayer": "Игрок", "ControllerSettingsPlayer1": "Игрок 1", diff --git a/Ryujinx.Ava/Assets/Locales/tr_TR.json b/Ryujinx.Ava/Assets/Locales/tr_TR.json index 59979de3c..e8713e0c1 100644 --- a/Ryujinx.Ava/Assets/Locales/tr_TR.json +++ b/Ryujinx.Ava/Assets/Locales/tr_TR.json @@ -166,8 +166,8 @@ "SettingsTabInput": "Giriş Yöntemi", "SettingsTabInputEnableDockedMode": "Docked Modunu Etkinleştir", "SettingsTabInputDirectKeyboardAccess": "Doğrudan Klavye Erişimi", - "SettingsButtonSave": "Kaydet", - "SettingsButtonClose": "Kapat", + "SettingsButtonOk": "Tamam", + "SettingsButtonCancel": "İptal", "SettingsButtonApply": "Uygula", "ControllerSettingsPlayer": "Oyuncu", "ControllerSettingsPlayer1": "Oyuncu 1", diff --git a/Ryujinx.Ava/Assets/Locales/zh_CN.json b/Ryujinx.Ava/Assets/Locales/zh_CN.json index 5e52f78ab..09b344e80 100644 --- a/Ryujinx.Ava/Assets/Locales/zh_CN.json +++ b/Ryujinx.Ava/Assets/Locales/zh_CN.json @@ -166,8 +166,8 @@ "SettingsTabInput": "输入", "SettingsTabInputEnableDockedMode": "主机模式", "SettingsTabInputDirectKeyboardAccess": "直通键盘控制", - "SettingsButtonSave": "保存", - "SettingsButtonClose": "关闭", + "SettingsButtonOk": "批准", + "SettingsButtonCancel": "取消", "SettingsButtonApply": "应用", "ControllerSettingsPlayer": "玩家", "ControllerSettingsPlayer1": "玩家 1", diff --git a/Ryujinx.Ava/Assets/Locales/zh_TW.json b/Ryujinx.Ava/Assets/Locales/zh_TW.json index 6b1d9d49f..8a9e4d61d 100644 --- a/Ryujinx.Ava/Assets/Locales/zh_TW.json +++ b/Ryujinx.Ava/Assets/Locales/zh_TW.json @@ -166,8 +166,8 @@ "SettingsTabInput": "輸入", "SettingsTabInputEnableDockedMode": "Docked 模式", "SettingsTabInputDirectKeyboardAccess": "直通鍵盤控制", - "SettingsButtonSave": "儲存", - "SettingsButtonClose": "關閉", + "SettingsButtonOk": "嘛好", + "SettingsButtonCancel": "取消", "SettingsButtonApply": "套用", "ControllerSettingsPlayer": "玩家", "ControllerSettingsPlayer1": "玩家 1", diff --git a/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs b/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs index 584627417..bd4a55e8f 100644 --- a/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs +++ b/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs @@ -118,7 +118,12 @@ namespace Ryujinx.Ava.Ui.ViewModels OnPropertyChanged(); } } - + + public bool IsMacOS + { + get => OperatingSystem.IsMacOS(); + } + public bool EnableDiscordIntegration { get; set; } public bool CheckUpdatesOnStart { get; set; } public bool ShowConfirmExit { get; set; } @@ -474,11 +479,40 @@ namespace Ryujinx.Ava.Ui.ViewModels MainWindow.UpdateGraphicsConfig(); _previousVolumeLevel = Volume; + + if (_owner is SettingsWindow owner) + { + owner.ControllerSettings?.SaveCurrentProfile(); + } + + if (_owner.Owner is MainWindow window && _directoryChanged) + { + window.ViewModel.LoadApplications(); + } + + _directoryChanged = false; } public void RevertIfNotSaved() { Program.ReloadConfig(); } + + public void ApplyButton() + { + SaveSettings(); + } + + public void OkButton() + { + SaveSettings(); + _owner.Close(); + } + + public void CancelButton() + { + RevertIfNotSaved(); + _owner.Close(); + } } } \ No newline at end of file diff --git a/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml b/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml index 1791d8ea5..0a5cdc893 100644 --- a/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml +++ b/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml @@ -955,16 +955,25 @@ Icon="Document" /> - -