diff --git a/SukiUI/Controls/SukiWindow.axaml b/SukiUI/Controls/SukiWindow.axaml index 47a2e4bc7..8677cae62 100644 --- a/SukiUI/Controls/SukiWindow.axaml +++ b/SukiUI/Controls/SukiWindow.axaml @@ -76,7 +76,7 @@ + IsVisible="{TemplateBinding CanMaximize}"> SetValue(CanMinimizeProperty, value); } + public static readonly StyledProperty CanMaximizeProperty = + AvaloniaProperty.Register(nameof(CanMaximize), defaultValue: true); + public bool CanMaximize + { + get => GetValue(CanMaximizeProperty); + set => SetValue(CanMaximizeProperty, value); + } + public static readonly StyledProperty CanMoveProperty = AvaloniaProperty.Register(nameof(CanMove), defaultValue: true); @@ -268,7 +276,7 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e) private void OnMaximizeButtonClicked(object? sender, RoutedEventArgs args) { - if (!CanResize) return; + if (!CanMaximize) return; WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; @@ -284,7 +292,7 @@ private void EnableWindowsSnapLayout(Button maximize) { case 533: if (!pointerOnMaxButton) break; - if (!CanResize) break; + if (!CanMaximize) break; WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; @@ -325,7 +333,7 @@ static int ToInt32(IntPtr ptr) => IntPtr.Size == 4 private void OnWindowStateChanged(WindowState state) { if (state == WindowState.FullScreen) - CanResize = CanMove = false; + CanMaximize = CanResize = CanMove = false; if (state == WindowState.Maximized) Margin = new Thickness(7); else