UI: Rename Show Title Bar + Revamp for global settings window

This commit is contained in:
Evan Husted 2025-03-05 18:39:42 -06:00
parent 97a1bbdd74
commit f3a9cecf72
22 changed files with 156 additions and 94 deletions

View File

@ -470,7 +470,7 @@ namespace Ryujinx.Ava
Dispatcher.UIThread.InvokeAsync(() =>
{
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowTitleBar);
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowOldUI);
});
_viewModel.SetUiProgressHandlers(Device);
@ -872,7 +872,7 @@ namespace Ryujinx.Ava
Device?.System.TogglePauseEmulation(false);
_viewModel.IsPaused = false;
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowTitleBar);
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowOldUI);
Logger.Info?.Print(LogClass.Emulation, "Emulation was resumed");
}
@ -881,7 +881,7 @@ namespace Ryujinx.Ava
Device?.System.TogglePauseEmulation(true);
_viewModel.IsPaused = true;
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowTitleBar, LocaleManager.Instance[LocaleKeys.Paused]);
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowOldUI, LocaleManager.Instance[LocaleKeys.Paused]);
Logger.Info?.Print(LogClass.Emulation, "Emulation was paused");
}

View File

@ -3823,28 +3823,53 @@
}
},
{
"ID": "SettingsTabGeneralShowTitleBar",
"ID": "SettingsTabGeneralShowOldUI",
"Translations": {
"ar_SA": "",
"de_DE": "",
"el_GR": "",
"en_US": "Show Title Bar (Requires restart)",
"es_ES": "Mostrar Barra de Título (Requiere reinicio)",
"fr_FR": "Afficher Barre de Titre (Nécessite redémarrage)",
"en_US": "Show Original UI Style (Requires restart)",
"es_ES": "",
"fr_FR": "",
"he_IL": "",
"it_IT": "Mostra barra del titolo (Richiede il riavvio)",
"it_IT": "",
"ja_JP": "",
"ko_KR": "제목 표시줄 표시(다시 시작해야 함)",
"no_NO": "Vis tittellinje (krever omstart)",
"ko_KR": "",
"no_NO": "Vis original UI-stil (krever omstart)",
"pl_PL": "",
"pt_BR": "Mostrar Barra de Título (Requer reinicialização)",
"ru_RU": "Показать строку заголовка (требуется перезапуск)",
"sv_SE": "Visa titelrad (kräver omstart)",
"pt_BR": "",
"ru_RU": "",
"sv_SE": "",
"th_TH": "",
"tr_TR": "",
"uk_UA": "Показувати рядок заголовка (Потрібен перезапуск)",
"zh_CN": "显示标题栏 (需要重启)",
"zh_TW": "顯示「標題列」 (需要重新開啟Ryujinx)"
"uk_UA": "",
"zh_CN": "",
"zh_TW": ""
}
},
{
"ID": "SettingsTabGeneralShowOldUIToolTip",
"Translations": {
"ar_SA": "",
"de_DE": "",
"el_GR": "",
"en_US": "Show the older Avalonia Ryujinx UI reminiscent of Ryujinx 1.1.1403. This is enabled by default on platforms that are not Windows.\nThe classic-style title bar is back and major window layout reworkings are reversed; such as the settings navigation placement above this tooltip.",
"es_ES": "",
"fr_FR": "",
"he_IL": "",
"it_IT": "",
"ja_JP": "",
"ko_KR": "",
"no_NO": "Vis det eldre Avalonia Ryujinx-grensesnittet som minner om Ryujinx 1.1.1403. Dette er aktivert som standard på plattformer som ikke er Windows.\nTittellinjen i klassisk stil er tilbake, og store omarbeidinger av vindusoppsettet er reversert, for eksempel plasseringen av innstillingsnavigasjonen over dette verktøytipset.",
"pl_PL": "",
"pt_BR": "",
"ru_RU": "",
"sv_SE": "",
"th_TH": "",
"tr_TR": "",
"uk_UA": "",
"zh_CN": "",
"zh_TW": ""
}
},
{

View File

@ -1,4 +1,5 @@
using Avalonia.Markup.Xaml.MarkupExtensions;
using Humanizer;
using Projektanker.Icons.Avalonia;
using Ryujinx.Ava.Common.Locale;
@ -24,4 +25,17 @@ namespace Ryujinx.Ava.Common.Markup
protected override void ConfigureBindingExtension(CompiledBindingExtension bindingExtension)
=> bindingExtension.Source = LocaleManager.Instance;
}
internal class WindowTitleExtension(LocaleKeys key, bool includeVersion) : BasicMarkupExtension<string>
{
public WindowTitleExtension(LocaleKeys key) : this(key, true)
{
}
public override string Name => "WindowTitleTranslation";
protected override string Value => RyujinxApp.FormatTitle(key, includeVersion);
protected override void ConfigureBindingExtension(CompiledBindingExtension bindingExtension)
=> bindingExtension.Source = LocaleManager.Instance;
}
}

View File

@ -46,12 +46,11 @@ namespace Ryujinx.Ava.Systems.Configuration
EnableDiscordIntegration.Value = cff.EnableDiscordIntegration;
CheckUpdatesOnStart.Value = shouldLoadFromFile ? cff.CheckUpdatesOnStart : CheckUpdatesOnStart.Value; // Get from global config only
UpdateCheckerType.Value = shouldLoadFromFile ? cff.UpdateCheckerType : UpdateCheckerType.Value; // Get from global config only
FocusLostActionType.Value = cff.FocusLostActionType;
ShowConfirmExit.Value = shouldLoadFromFile ? cff.ShowConfirmExit : ShowConfirmExit.Value; // Get from global config only
RememberWindowState.Value = shouldLoadFromFile ? cff.RememberWindowState : RememberWindowState.Value; // Get from global config only
ShowTitleBar.Value = shouldLoadFromFile ? cff.ShowTitleBar : ShowTitleBar.Value; // Get from global config only
ShowOldUI.Value = shouldLoadFromFile ? cff.ShowTitleBar : ShowOldUI.Value; // Get from global config only
EnableHardwareAcceleration.Value = shouldLoadFromFile ? cff.EnableHardwareAcceleration : EnableHardwareAcceleration.Value; // Get from global config only
HideCursor.Value = cff.HideCursor;

View File

@ -784,11 +784,6 @@ namespace Ryujinx.Ava.Systems.Configuration
/// </summary>
public ReactiveObject<bool> EnableDiscordIntegration { get; private set; }
/// <summary>
/// Checks for updates when Ryujinx starts when enabled
/// </summary>
public ReactiveObject<bool> CheckUpdatesOnStart { get; private set; }
/// <summary>
/// Checks for updates when Ryujinx starts when enabled, either prompting when an update is found or just showing a notification.
/// </summary>
@ -810,9 +805,9 @@ namespace Ryujinx.Ava.Systems.Configuration
public ReactiveObject<bool> RememberWindowState { get; private set; }
/// <summary>
/// Enables or disables the redesigned title bar
/// Disable the new title bar layout & window layout changes.
/// </summary>
public ReactiveObject<bool> ShowTitleBar { get; private set; }
public ReactiveObject<bool> ShowOldUI { get; private set; }
/// <summary>
/// Enables hardware-accelerated rendering for Avalonia
@ -833,15 +828,14 @@ namespace Ryujinx.Ava.Systems.Configuration
Hid = new HidSection();
Multiplayer = new MultiplayerSection();
Hacks = new HacksSection();
EnableDiscordIntegration = new ReactiveObject<bool>();
CheckUpdatesOnStart = new ReactiveObject<bool>();
UpdateCheckerType = new ReactiveObject<UpdaterType>();
FocusLostActionType = new ReactiveObject<FocusLostType>();
HideCursor = new ReactiveObject<HideCursorMode>();
EnableDiscordIntegration = new ReactiveObject<bool>();
ShowConfirmExit = new ReactiveObject<bool>();
RememberWindowState = new ReactiveObject<bool>();
ShowTitleBar = new ReactiveObject<bool>();
ShowOldUI = new ReactiveObject<bool>();
EnableHardwareAcceleration = new ReactiveObject<bool>();
HideCursor = new ReactiveObject<HideCursorMode>();
}
public HleConfiguration CreateHleConfiguration() =>

View File

@ -56,12 +56,11 @@ namespace Ryujinx.Ava.Systems.Configuration
MatchSystemTime = System.MatchSystemTime,
DockedMode = System.EnableDockedMode,
EnableDiscordIntegration = EnableDiscordIntegration,
CheckUpdatesOnStart = CheckUpdatesOnStart,
UpdateCheckerType = UpdateCheckerType,
FocusLostActionType = FocusLostActionType,
ShowConfirmExit = ShowConfirmExit,
RememberWindowState = RememberWindowState,
ShowTitleBar = ShowTitleBar,
ShowTitleBar = ShowOldUI,
EnableHardwareAcceleration = EnableHardwareAcceleration,
HideCursor = HideCursor,
VSyncMode = Graphics.VSyncMode,
@ -183,7 +182,7 @@ namespace Ryujinx.Ava.Systems.Configuration
FocusLostActionType.Value = FocusLostType.DoNothing;
ShowConfirmExit.Value = true;
RememberWindowState.Value = true;
ShowTitleBar.Value = !OperatingSystem.IsWindows();
ShowOldUI.Value = !OperatingSystem.IsWindows();
EnableHardwareAcceleration.Value = true;
HideCursor.Value = HideCursorMode.OnIdle;
Graphics.VSyncMode.Value = VSyncMode.Switch;

View File

@ -0,0 +1,29 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Layout;
using Avalonia.Media.Imaging;
using Ryujinx.Ava.Systems.Configuration;
using Ryujinx.Ava.UI.ViewModels;
using System.Reflection;
namespace Ryujinx.Ava.UI.Controls
{
public class RyujinxLogo : Image
{
// The UI specifically uses a thicker bordered variant of the icon to avoid crunching out the border at lower resolutions.
// For an example of this, download canary 1.2.95, then open the settings menu, and look at the icon in the top-left.
// The border gets reduced to colored pixels in the 4 corners.
public static readonly Bitmap Bitmap =
new(Assembly.GetAssembly(typeof(MainWindowViewModel))!
.GetManifestResourceStream("Ryujinx.Assets.UIImages.Logo_Ryujinx_AntiAlias.png")!);
public RyujinxLogo()
{
Margin = new Thickness(7, 7, 7, 0);
Height = 25;
Width = 25;
Source = Bitmap;
IsVisible = !ConfigurationState.Instance.ShowOldUI;
}
}
}

View File

@ -137,13 +137,6 @@ namespace Ryujinx.Ava.UI.ViewModels
// Key is Title ID
public SafeDictionary<string, LdnGameData.Array> LdnData = [];
// The UI specifically uses a thicker bordered variant of the icon to avoid crunching out the border at lower resolutions.
// For an example of this, download canary 1.2.95, then open the settings menu, and look at the icon in the top-left.
// The border gets reduced to colored pixels in the 4 corners.
public static readonly Bitmap IconBitmap =
new(Assembly.GetAssembly(typeof(MainWindowViewModel))!
.GetManifestResourceStream("Ryujinx.Assets.UIImages.Logo_Ryujinx_AntiAlias.png")!);
public MainWindow Window { get; init; }
internal AppHost AppHost { get; set; }
@ -1794,7 +1787,7 @@ namespace Ryujinx.Ava.UI.ViewModels
if (WindowState is not WindowState.Normal)
{
WindowState = WindowState.Normal;
Window.TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowTitleBar;
Window.TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowOldUI;
if (IsGameRunning)
{

View File

@ -130,11 +130,10 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool IsOpenGLAvailable => !OperatingSystem.IsMacOS();
public bool EnableDiscordIntegration { get; set; }
public bool CheckUpdatesOnStart { get; set; }
public bool ShowConfirmExit { get; set; }
public bool IgnoreApplet { get; set; }
public bool RememberWindowState { get; set; }
public bool ShowTitleBar { get; set; }
public bool ShowOldUI { get; set; }
public int HideCursor { get; set; }
public int UpdateCheckerType { get; set; }
public bool EnableDockedMode { get; set; }
@ -537,10 +536,9 @@ namespace Ryujinx.Ava.UI.ViewModels
// User Interface
EnableDiscordIntegration = config.EnableDiscordIntegration;
CheckUpdatesOnStart = config.CheckUpdatesOnStart;
ShowConfirmExit = config.ShowConfirmExit;
RememberWindowState = config.RememberWindowState;
ShowTitleBar = config.ShowTitleBar;
ShowOldUI = config.ShowOldUI;
HideCursor = (int)config.HideCursor.Value;
UpdateCheckerType = (int)config.UpdateCheckerType.Value;
FocusLostActionType = (int)config.FocusLostActionType.Value;
@ -646,10 +644,9 @@ namespace Ryujinx.Ava.UI.ViewModels
// User Interface
config.EnableDiscordIntegration.Value = EnableDiscordIntegration;
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
config.ShowConfirmExit.Value = ShowConfirmExit;
config.RememberWindowState.Value = RememberWindowState;
config.ShowTitleBar.Value = ShowTitleBar;
config.ShowOldUI.Value = ShowOldUI;
config.HideCursor.Value = (HideCursorMode)HideCursor;
config.UpdateCheckerType.Value = (UpdaterType)UpdateCheckerType;
config.FocusLostActionType.Value = (FocusLostType)FocusLostActionType;

View File

@ -6,17 +6,15 @@
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
mc:Ignorable="d"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
x:DataType="viewModels:MainWindowViewModel"
x:Class="Ryujinx.Ava.UI.Views.Main.MainMenuBarView">
<Design.DataContext>
<viewModels:MainWindowViewModel />
</Design.DataContext>
<DockPanel HorizontalAlignment="Stretch">
<Image
Name="RyuLogo"
<controls:RyujinxLogo
Margin="7, 0"
Height="25"
Width="25"
ToolTip.Tip="{Binding Title}"/>
<Menu
Name="Menu"

View File

@ -34,9 +34,6 @@ namespace Ryujinx.Ava.UI.Views.Main
{
InitializeComponent();
RyuLogo.IsVisible = !ConfigurationState.Instance.ShowTitleBar;
RyuLogo.Source = MainWindowViewModel.IconBitmap;
ToggleFileTypesMenuItem.ItemsSource = GenerateToggleFileTypeItems();
ChangeLanguageMenuItem.ItemsSource = GenerateLanguageMenuItems();
@ -226,7 +223,7 @@ namespace Ryujinx.Ava.UI.Views.Main
// Correctly size window when 'TitleBar' is enabled (Nov. 14, 2024)
double barsHeight = ((Window.StatusBarHeight + Window.MenuBarHeight) +
(ConfigurationState.Instance.ShowTitleBar ? (int)Window.TitleBar.Height : 0));
(ConfigurationState.Instance.ShowOldUI ? (int)Window.TitleBar.Height : 0));
double windowWidthScaled = (resolutionWidth * Program.WindowScaleFactor);
double windowHeightScaled = ((resolutionHeight + barsHeight) * Program.WindowScaleFactor);

View File

@ -54,9 +54,10 @@
<CheckBox
IsEnabled="{Binding !IsGameTitleNotNull}"
Opacity="{Binding PanelOpacity}"
IsChecked="{Binding ShowTitleBar}" IsVisible="{x:Static helper:RunningPlatform.IsWindows}">
IsChecked="{Binding ShowOldUI}"
ToolTip.Tip="{ext:Locale SettingsTabGeneralShowOldUIToolTip}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{ext:Locale SettingsTabGeneralShowTitleBar}" />
<TextBlock Text="{ext:Locale SettingsTabGeneralShowOldUI}" />
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}" />
</StackPanel>
</CheckBox>

View File

@ -6,6 +6,7 @@
xmlns:window="clr-namespace:Ryujinx.Ava.UI.Windows"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
mc:Ignorable="d"
d:DesignWidth="400"
d:DesignHeight="350"
@ -24,14 +25,12 @@
</Design.DataContext>
<Grid RowDefinitions="Auto,Auto,*,Auto" Margin="15" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
<Grid Name="FlushControls" ColumnDefinitions="Auto,Auto" Grid.Row="1" Margin="-15">
<Image
<controls:RyujinxLogo
Grid.Column="0"
Name="RyuLogo"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="8, 8, 7, 0"
Height="25"
Width="25" />
ToolTip.Tip="{ext:WindowTitle Amiibo}" />
<StackPanel Grid.Column="1" Orientation="Horizontal" Margin="0, 0, 0, 100">
<StackPanel Spacing="10" Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock VerticalAlignment="Center" Text="{ext:Locale AmiiboSeriesLabel}" />

View File

@ -17,9 +17,8 @@ namespace Ryujinx.Ava.UI.Windows
InitializeComponent();
FlushControls.IsVisible = !ConfigurationState.Instance.ShowTitleBar;
NormalControls.IsVisible = ConfigurationState.Instance.ShowTitleBar;
RyuLogo.Source = MainWindowViewModel.IconBitmap;
FlushControls.IsVisible = !ConfigurationState.Instance.ShowOldUI;
NormalControls.IsVisible = ConfigurationState.Instance.ShowOldUI;
Title = RyujinxApp.FormatTitle(LocaleKeys.Amiibo);
}

View File

@ -6,6 +6,7 @@
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:window="clr-namespace:Ryujinx.Ava.UI.Windows"
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
Width="600"
Height="750"
MinWidth="500"
@ -21,14 +22,14 @@
</Window.Styles>
<Grid Name="CheatGrid" Margin="15" RowDefinitions="Auto,Auto,Auto,*,Auto" ColumnDefinitions="*,*">
<Grid Name="FlushHeader" Grid.Row="1" Column="0" ColumnSpan="2" RowDefinitions="Auto,Auto,Auto" ColumnDefinitions="Auto,*,Auto,*">
<Image
<controls:RyujinxLogo
Grid.Row="0"
Grid.Column="0"
Name="RyuLogo"
HorizontalAlignment="Left"
Margin="-7, -22, 7, 0"
Height="28"
Width="28" />
Width="28"
ToolTip.Tip="{ext:WindowTitle CheatWindowTitle}"/>
<StackPanel Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2"
Margin="7, -7, 0, 5"
Orientation="Horizontal"

View File

@ -45,9 +45,8 @@ namespace Ryujinx.Ava.UI.Windows
InitializeComponent();
FlushHeader.IsVisible = !ConfigurationState.Instance.ShowTitleBar;
NormalHeader.IsVisible = ConfigurationState.Instance.ShowTitleBar;
RyuLogo.Source = MainWindowViewModel.IconBitmap;
FlushHeader.IsVisible = !ConfigurationState.Instance.ShowOldUI;
NormalHeader.IsVisible = ConfigurationState.Instance.ShowOldUI;
string modsBasePath = ModLoader.GetModsBasePath();
string titleModsPath = ModLoader.GetApplicationDir(modsBasePath, titleId);

View File

@ -7,6 +7,7 @@
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
xmlns:systems="clr-namespace:Ryujinx.Ava.Systems"
xmlns:window="clr-namespace:Ryujinx.Ava.UI.Windows"
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
CanResize="False"
mc:Ignorable="d"
MinWidth="800"
@ -18,11 +19,10 @@
</window:StyleableAppWindow.DataContext>
<Grid RowDefinitions="Auto,*">
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto,Auto" Name="FlushControls">
<Image
Name="RyuLogo"
<controls:RyujinxLogo
Grid.Column="0"
Margin="15, 0, 7, 0"
Height="25"
Width="25" />
ToolTip.Tip="{ext:WindowTitle CompatibilityListTitle, False}"/>
<TextBox Name="SearchBoxFlush" Grid.Column="1" Margin="0, 5, 0, 5" HorizontalAlignment="Stretch" Watermark="{ext:Locale CompatibilityListSearchBoxWatermarkWithCount}" TextChanged="TextBox_OnTextChanged" />
<CheckBox Grid.Column="2" Margin="7, 0, 0, 0" IsChecked="{Binding OnlyShowOwnedGames}" />
<TextBlock Grid.Column="3" Padding="0, 0, 138, 0" Margin="-10, 0, 18, 0" Text="{ext:Locale CompatibilityListOnlyShowOwnedGames}" />

View File

@ -27,9 +27,8 @@ namespace Ryujinx.Ava.UI.Windows
InitializeComponent();
RyuLogo.Source = MainWindowViewModel.IconBitmap;
FlushControls.IsVisible = !ConfigurationState.Instance.ShowTitleBar;
NormalControls.IsVisible = ConfigurationState.Instance.ShowTitleBar;
FlushControls.IsVisible = !ConfigurationState.Instance.ShowOldUI;
NormalControls.IsVisible = ConfigurationState.Instance.ShowOldUI;
}
// ReSharper disable once UnusedMember.Local

View File

@ -97,7 +97,7 @@ namespace Ryujinx.Ava.UI.Windows
TitleBar.Height = MenuBarHeight;
// Correctly size window when 'TitleBar' is enabled (Nov. 14, 2024)
TitleBarHeight = (ConfigurationState.Instance.ShowTitleBar ? TitleBar.Height : 0);
TitleBarHeight = (ConfigurationState.Instance.ShowOldUI ? TitleBar.Height : 0);
ApplicationList.DataContext = DataContext;
ApplicationGrid.DataContext = DataContext;

View File

@ -11,10 +11,11 @@
xmlns:settings="clr-namespace:Ryujinx.Ava.UI.Views.Settings"
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
xmlns:helper="clr-namespace:Ryujinx.Common.Helper;assembly=Ryujinx.Common"
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
Width="1100"
Height="927"
MinWidth="800"
MinHeight="480"
Title="{ext:WindowTitle Settings}"
WindowStartupLocation="CenterOwner"
x:DataType="viewModels:SettingsViewModel"
mc:Ignorable="d"
@ -22,13 +23,20 @@
<Design.DataContext>
<viewModels:SettingsViewModel />
</Design.DataContext>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="600" RowDefinitions="Auto,*,Auto">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="600" RowDefinitions="Auto,Auto,*,Auto">
<StackPanel Grid.Row="0" Orientation="Horizontal">
<controls:RyujinxLogo
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="7, 7, 7, 0"
ToolTip.Tip="{ext:WindowTitle Settings}"/>
</StackPanel>
<ContentPresenter
x:Name="ContentPresenter"
Grid.Row="1"
Grid.Row="2"
IsVisible="False"
KeyboardNavigation.IsTabStop="False"/>
<Grid Name="Pages" IsVisible="False" Grid.Row="2">
<Grid Name="Pages" IsVisible="False" Grid.Row="3">
<settings:SettingsUiView Name="UiPage" />
<settings:SettingsInputView Name="InputPage" />
<settings:SettingsHotkeysView Name="HotkeysPage" />
@ -41,12 +49,11 @@
<settings:SettingsHacksView Name="HacksPage" />
</Grid>
<ui:NavigationView
Grid.Row="1"
Grid.Row="2"
IsSettingsVisible="False"
Name="NavPanel"
IsBackEnabled="False"
PaneDisplayMode="Left"
Margin="2,10,10,0"
Margin="10,10,10,0"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
OpenPaneLength="200">
@ -108,7 +115,7 @@
</Style>
</ui:NavigationView.Styles>
</ui:NavigationView>
<Grid Grid.Row="2"
<Grid Grid.Row="3"
ColumnDefinitions="Auto,*,Auto">
<StackPanel Grid.Column="0" Orientation="Horizontal">
<Button

View File

@ -1,6 +1,7 @@
using Avalonia.Controls;
using FluentAvalonia.UI.Controls;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.Systems.Configuration;
using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.HLE.FileSystem;
using Ryujinx.Input;
@ -13,7 +14,7 @@ namespace Ryujinx.Ava.UI.Windows
{
internal readonly SettingsViewModel ViewModel;
public SettingsWindow(VirtualFileSystem virtualFileSystem, ContentManager contentManager)
public SettingsWindow(VirtualFileSystem virtualFileSystem, ContentManager contentManager) : base(true)
{
Title = RyujinxApp.FormatTitle(LocaleKeys.Settings);
@ -23,6 +24,16 @@ namespace Ryujinx.Ava.UI.Windows
ViewModel.SaveSettingsEvent += SaveSettings;
InitializeComponent();
NavPanel.PaneDisplayMode =
ConfigurationState.Instance.ShowOldUI
? NavigationViewPaneDisplayMode.Left
: NavigationViewPaneDisplayMode.Top;
Height = ConfigurationState.Instance.ShowOldUI
? 927
: 993; // nav panel is put on top with custom title bar so account for new height
Load();
}

View File

@ -7,6 +7,7 @@ using Avalonia.Platform;
using FluentAvalonia.UI.Windowing;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.Systems.Configuration;
using Ryujinx.Ava.UI.Controls;
using Ryujinx.Ava.UI.ViewModels;
using System.Threading.Tasks;
@ -32,14 +33,14 @@ namespace Ryujinx.Ava.UI.Windows
if (useCustomTitleBar)
{
TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowTitleBar;
TitleBar.TitleBarHitTestType = ConfigurationState.Instance.ShowTitleBar ? TitleBarHitTestType.Simple : TitleBarHitTestType.Complex;
TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowOldUI;
TitleBar.TitleBarHitTestType = ConfigurationState.Instance.ShowOldUI ? TitleBarHitTestType.Simple : TitleBarHitTestType.Complex;
if (TitleBar.ExtendsContentIntoTitleBar && titleBarHeight != null)
TitleBar.Height = titleBarHeight.Value;
}
Icon = MainWindowViewModel.IconBitmap;
Icon = RyujinxLogo.Bitmap;
}
private void LocaleChanged()
@ -73,7 +74,7 @@ namespace Ryujinx.Ava.UI.Windows
LocaleManager.Instance.LocaleChanged += LocaleChanged;
LocaleChanged();
Icon = new WindowIcon(MainWindowViewModel.IconBitmap);
Icon = new WindowIcon(RyujinxLogo.Bitmap);
}
private void LocaleChanged()