mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-25 07:09:55 -06:00
misc: chore: add helper constructor parameter to StyleableWindow to auto use custom title bar based on configuration
This commit is contained in:
@ -6,6 +6,7 @@ using Avalonia.Media;
|
||||
using Avalonia.Platform;
|
||||
using FluentAvalonia.UI.Windowing;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Systems.Configuration;
|
||||
using Ryujinx.Ava.UI.ViewModels;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@ -21,7 +22,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
await appWindow.ShowDialog(owner ?? RyujinxApp.MainWindow);
|
||||
}
|
||||
|
||||
protected StyleableAppWindow()
|
||||
protected StyleableAppWindow(bool useCustomTitleBar = false)
|
||||
{
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
||||
TransparencyLevelHint = [WindowTransparencyLevel.None];
|
||||
@ -29,6 +30,12 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
LocaleManager.Instance.LocaleChanged += LocaleChanged;
|
||||
LocaleChanged();
|
||||
|
||||
if (useCustomTitleBar)
|
||||
{
|
||||
TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowTitleBar;
|
||||
TitleBar.TitleBarHitTestType = ConfigurationState.Instance.ShowTitleBar ? TitleBarHitTestType.Simple : TitleBarHitTestType.Complex;
|
||||
}
|
||||
|
||||
Icon = MainWindowViewModel.IconBitmap;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user