misc: chore: add helper constructor parameter to StyleableWindow to auto use custom title bar based on configuration

This commit is contained in:
Evan Husted 2025-03-05 02:34:34 -06:00
parent bed3835718
commit dd02c8e25d
3 changed files with 10 additions and 8 deletions

View file

@ -76,7 +76,7 @@ namespace Ryujinx.Ava.UI.Windows
public readonly double StatusBarHeight;
public readonly double MenuBarHeight;
public MainWindow()
public MainWindow() : base(useCustomTitleBar: true)
{
DataContext = ViewModel = new MainWindowViewModel
{
@ -90,9 +90,6 @@ namespace Ryujinx.Ava.UI.Windows
ViewModel.Title = RyujinxApp.FormatTitle();
TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowTitleBar;
TitleBar.TitleBarHitTestType = (ConfigurationState.Instance.ShowTitleBar) ? TitleBarHitTestType.Simple : TitleBarHitTestType.Complex;
// NOTE: Height of MenuBar and StatusBar is not usable here, since it would still be 0 at this point.
StatusBarHeight = StatusBarView.StatusBar.MinHeight;
MenuBarHeight = MenuBar.MinHeight;