diff options
| author | Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> | 2022-12-01 21:31:21 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-02 03:31:21 +0100 |
| commit | b540ea80d16488d1e5b3eb6ca6b9e93cc663b06f (patch) | |
| tree | 7dad972c3e1560da8aecb80c5f69df56dde74852 /Ryujinx.Ava/Ui | |
| parent | d692a9b83ebb1c0303f91adaa22cd67852f2386f (diff) | |
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
Diffstat (limited to 'Ryujinx.Ava/Ui')
| -rw-r--r-- | Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs | 36 | ||||
| -rw-r--r-- | Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml | 23 | ||||
| -rw-r--r-- | Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml.cs | 30 |
3 files changed, 51 insertions, 38 deletions
diff --git a/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs b/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs index 58462741..bd4a55e8 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 1791d8ea..0a5cdc89 100644 --- a/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml +++ b/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml @@ -955,16 +955,25 @@ Icon="Document" /> </ui:NavigationView.MenuItems> </ui:NavigationView> - <StackPanel + <ReversibleStackPanel Grid.Row="2" Margin="10" Spacing="10" Orientation="Horizontal" - HorizontalAlignment="Right"> - <Button Content="{locale:Locale SettingsButtonSave}" Click="SaveButton_Clicked" /> - <Button Content="{locale:Locale SettingsButtonClose}" Click="CloseButton_Clicked" /> - <Button Content="{locale:Locale SettingsButtonApply}" - Click="ApplyButton_Clicked" /> - </StackPanel> + HorizontalAlignment="Right" + ReverseOrder="{ReflectionBinding IsMacOS}"> + <Button + HotKey="Enter" + Classes="accent" + Content="{locale:Locale SettingsButtonOk}" + Command="{ReflectionBinding OkButton}" /> + <Button + HotKey="Escape" + Content="{locale:Locale SettingsButtonCancel}" + Command="{ReflectionBinding CancelButton}" /> + <Button + Content="{locale:Locale SettingsButtonApply}" + Command="{ReflectionBinding ApplyButton}" /> + </ReversibleStackPanel> </Grid> </window:StyleableWindow>
\ No newline at end of file diff --git a/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml.cs b/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml.cs index 0e610d77..d690322d 100644 --- a/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml.cs +++ b/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml.cs @@ -199,36 +199,6 @@ namespace Ryujinx.Ava.Ui.Windows } } - private void SaveButton_Clicked(object sender, RoutedEventArgs e) - { - SaveSettings(); - Close(); - } - - private void CloseButton_Clicked(object sender, RoutedEventArgs e) - { - ViewModel.RevertIfNotSaved(); - Close(); - } - - private void ApplyButton_Clicked(object sender, RoutedEventArgs e) - { - SaveSettings(); - } - - private void SaveSettings() - { - ViewModel.SaveSettings(); - ControllerSettings?.SaveCurrentProfile(); - - if (Owner is MainWindow window && ViewModel.DirectoryChanged) - { - window.ViewModel.LoadApplications(); - } - - ViewModel.DirectoryChanged = false; - } - protected override void OnClosed(EventArgs e) { ControllerSettings.Dispose(); |
