From febb0fc3085864c3b369f15680764de5fe24bd5f Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Wed, 17 Jul 2024 17:56:05 +0100 Subject: [PATCH] Update file type and lang selection to use ToggleType --- src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs index 73ae0df14..dc2489b71 100644 --- a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs +++ b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs @@ -35,22 +35,23 @@ namespace Ryujinx.Ava.UI.Views.Main ChangeLanguageMenuItem.ItemsSource = GenerateLanguageMenuItems(); } - private CheckBox[] GenerateToggleFileTypeItems() + private MenuItem[] GenerateToggleFileTypeItems() { - List checkBoxes = new(); + List items = new(); foreach (var item in Enum.GetValues(typeof(FileTypes))) { string fileName = Enum.GetName(typeof(FileTypes), item); - checkBoxes.Add(new CheckBox + items.Add(new MenuItem { - Content = $".{fileName}", + Header = $".{fileName}", + ToggleType = MenuItemToggleType.CheckBox, IsChecked = ((FileTypes)item).GetConfigValue(ConfigurationState.Instance.UI.ShownFileTypes), Command = MiniCommand.Create(() => Window.ToggleFileType(fileName)), }); } - return checkBoxes.ToArray(); + return items.ToArray(); } private static MenuItem[] GenerateLanguageMenuItems() @@ -78,6 +79,8 @@ namespace Ryujinx.Ava.UI.Views.Main MenuItem menuItem = new() { Header = languageName, + ToggleType = MenuItemToggleType.Radio, + IsChecked = languageCode == ConfigurationState.Instance.UI.LanguageCode, Command = MiniCommand.Create(() => { MainWindowViewModel.ChangeLanguage(languageCode);