Add buttons interactibility toggle

This commit is contained in:
Isaac Marovitz 2024-04-18 18:04:47 -04:00
parent fd33ebb42d
commit 417b4caa98
No known key found for this signature in database
GPG Key ID: 97250B2B09A132E1
3 changed files with 8 additions and 0 deletions

View File

@ -67,6 +67,7 @@ namespace Ryujinx.Ava.UI.ViewModels
public event Action CloseWindow; public event Action CloseWindow;
public event Action SaveSettingsEvent; public event Action SaveSettingsEvent;
public event Action<bool> DirtyEvent; public event Action<bool> DirtyEvent;
public event Action<bool> ToggleButtons;
public int ResolutionScale public int ResolutionScale
{ {

View File

@ -108,6 +108,7 @@
</ui:NavigationView> </ui:NavigationView>
<ReversibleStackPanel <ReversibleStackPanel
Grid.Row="2" Grid.Row="2"
Name="Buttons"
Margin="10" Margin="10"
Spacing="10" Spacing="10"
Orientation="Horizontal" Orientation="Horizontal"

View File

@ -22,6 +22,7 @@ namespace Ryujinx.Ava.UI.Windows
ViewModel.CloseWindow += Close; ViewModel.CloseWindow += Close;
ViewModel.SaveSettingsEvent += SaveSettings; ViewModel.SaveSettingsEvent += SaveSettings;
ViewModel.DirtyEvent += UpdateDirtyTitle; ViewModel.DirtyEvent += UpdateDirtyTitle;
ViewModel.ToggleButtons += ToggleButtons;
InitializeComponent(); InitializeComponent();
Load(); Load();
@ -49,6 +50,11 @@ namespace Ryujinx.Ava.UI.Windows
} }
} }
public void ToggleButtons(bool enable)
{
Buttons.IsEnabled = enable;
}
public void SaveSettings() public void SaveSettings()
{ {
InputPage.InputView?.SaveCurrentProfile(); InputPage.InputView?.SaveCurrentProfile();