| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using Avalonia.Controls;
- using Avalonia.Controls.Primitives;
- using Avalonia.Media;
- using Avalonia.Platform;
- using FluentAvalonia.UI.Windowing;
- using Ryujinx.Ava.Common.Locale;
- using Ryujinx.Ava.UI.ViewModels;
- namespace Ryujinx.Ava.UI.Windows
- {
- public class StyleableAppWindow : AppWindow
- {
- public StyleableAppWindow()
- {
- WindowStartupLocation = WindowStartupLocation.CenterOwner;
- TransparencyLevelHint = [WindowTransparencyLevel.None];
- LocaleManager.Instance.LocaleChanged += LocaleChanged;
- LocaleChanged();
-
- Icon = MainWindowViewModel.IconBitmap;
- }
- 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();
- Icon = new WindowIcon(MainWindowViewModel.IconBitmap);
- }
- 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;
- }
- }
- }
|