using Avalonia.Controls; using Avalonia.Controls.Primitives; using Avalonia.Media; using Avalonia.Platform; using FluentAvalonia.UI.Windowing; using Ryujinx.Ava.Common.Locale; namespace Ryujinx.Ava.UI.Windows { public class StyleableAppWindow : AppWindow { public StyleableAppWindow() { WindowStartupLocation = WindowStartupLocation.CenterOwner; TransparencyLevelHint = [WindowTransparencyLevel.None]; LocaleManager.Instance.LocaleChanged += LocaleChanged; LocaleChanged(); } private void LocaleChanged() { FlowDirection = LocaleManager.Instance.IsRTL() ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; } protected override void OnApplyTemplate(TemplateAppliedEventArgs e) { base.OnApplyTemplate(e); ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.SystemChrome | ExtendClientAreaChromeHints.OSXThickTitleBar; } } public class StyleableWindow : Window { public StyleableWindow() { WindowStartupLocation = WindowStartupLocation.CenterOwner; TransparencyLevelHint = [WindowTransparencyLevel.None]; LocaleManager.Instance.LocaleChanged += LocaleChanged; LocaleChanged(); } private void LocaleChanged() { FlowDirection = LocaleManager.Instance.IsRTL() ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; } protected override void OnApplyTemplate(TemplateAppliedEventArgs e) { base.OnApplyTemplate(e); ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.SystemChrome | ExtendClientAreaChromeHints.OSXThickTitleBar; } } }