UI: Button to set emulator time based on system time in settings, under the time settings

This commit is contained in:
Evan Husted 2024-12-21 19:43:40 -06:00 committed by KeatonTheBot
parent 95ac0a7a51
commit d640f50203
12 changed files with 50 additions and 2 deletions

View file

@ -1,5 +1,7 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using Ryujinx.Ava.UI.ViewModels;
using System;
using TimeZone = Ryujinx.Ava.UI.Models.TimeZone;
namespace Ryujinx.Ava.UI.Views.Settings
@ -15,7 +17,7 @@ namespace Ryujinx.Ava.UI.Views.Settings
private void TimeZoneBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.AddedItems != null && e.AddedItems.Count > 0)
if (e.AddedItems.Count > 0)
{
if (e.AddedItems[0] is TimeZone timeZone)
{
@ -33,5 +35,7 @@ namespace Ryujinx.Ava.UI.Views.Settings
ViewModel.ValidateAndSetTimeZone(timeZone.Location);
}
}
private void MatchSystemTime_OnClick(object sender, RoutedEventArgs e) => ViewModel.MatchSystemTime();
}
}