From c76f32a4eef4d291fe219ec2f69be8cea6ec5a6f Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Wed, 5 Mar 2025 13:59:51 -0600 Subject: [PATCH] UI: Give the cheat manager the custom window title bar treatment --- src/Ryujinx/UI/Windows/CheatWindow.axaml | 107 ++++++++++++------ src/Ryujinx/UI/Windows/CheatWindow.axaml.cs | 7 +- .../Windows/CompatibilityListWindow.axaml.cs | 4 +- src/Ryujinx/UI/Windows/StyleableWindow.cs | 5 +- 4 files changed, 86 insertions(+), 37 deletions(-) diff --git a/src/Ryujinx/UI/Windows/CheatWindow.axaml b/src/Ryujinx/UI/Windows/CheatWindow.axaml index 32f914019a..fc46a35621 100644 --- a/src/Ryujinx/UI/Windows/CheatWindow.axaml +++ b/src/Ryujinx/UI/Windows/CheatWindow.axaml @@ -20,38 +20,81 @@ - - - + + + + + + + + + + + + + + SearchBoxNormal = { Text = titleId ?? string.Empty } }); - public CompatibilityListWindow() : base(useCustomTitleBar: true) + public CompatibilityListWindow() : base(useCustomTitleBar: true, 37) { Title = RyujinxApp.FormatTitle(LocaleKeys.CompatibilityListTitle); - TitleBar.Height = 37; - InitializeComponent(); RyuLogo.Source = MainWindowViewModel.IconBitmap; diff --git a/src/Ryujinx/UI/Windows/StyleableWindow.cs b/src/Ryujinx/UI/Windows/StyleableWindow.cs index 294a368517..aaec50f79f 100644 --- a/src/Ryujinx/UI/Windows/StyleableWindow.cs +++ b/src/Ryujinx/UI/Windows/StyleableWindow.cs @@ -22,7 +22,7 @@ public static async Task ShowAsync(StyleableAppWindow appWindow, Window owner = await appWindow.ShowDialog(owner ?? RyujinxApp.MainWindow); } - protected StyleableAppWindow(bool useCustomTitleBar = false) + protected StyleableAppWindow(bool useCustomTitleBar = false, double? titleBarHeight = null) { WindowStartupLocation = WindowStartupLocation.CenterOwner; TransparencyLevelHint = [WindowTransparencyLevel.None]; @@ -34,6 +34,9 @@ protected StyleableAppWindow(bool useCustomTitleBar = false) { TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowTitleBar; TitleBar.TitleBarHitTestType = ConfigurationState.Instance.ShowTitleBar ? TitleBarHitTestType.Simple : TitleBarHitTestType.Complex; + + if (TitleBar.ExtendsContentIntoTitleBar && titleBarHeight != null) + TitleBar.Height = titleBarHeight.Value; } Icon = MainWindowViewModel.IconBitmap;