Skip to content

Commit

Permalink
调整窗体限制
Browse files Browse the repository at this point in the history
  • Loading branch information
mujianwu committed Jul 30, 2024
1 parent 32a2580 commit f63794b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SukiUI/Controls/SukiWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</Button>
<Button Name="PART_MaximizeButton"
Classes="Basic Rounded WindowControlsButton"
IsVisible="{TemplateBinding CanResize}">
IsVisible="{TemplateBinding CanMaxSize}">
<PathIcon x:Name="MaximizeIcon" Data="{x:Static icons:Icons.WindowMaximize}" />
</Button>
<Button Name="PART_MinimizeButton"
Expand Down
9 changes: 9 additions & 0 deletions SukiUI/Controls/SukiWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ public bool CanMinimize
set => SetValue(CanMinimizeProperty, value);
}

public static readonly StyledProperty<bool> CanMaxSizeProperty =
AvaloniaProperty.Register<SukiWindow, bool>(nameof(CanMaxSize), defaultValue: true);

public bool CanMaxSize
{
get => GetValue(CanMaxSizeProperty);
set => SetValue(CanMaxSizeProperty, value);
}

public static readonly StyledProperty<bool> CanMoveProperty =
AvaloniaProperty.Register<SukiWindow, bool>(nameof(CanMove), defaultValue: true);

Expand Down
1 change: 1 addition & 0 deletions UotanToolbox/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public override void OnFrameworkInitializationCompleted()
desktop.MainWindow = viewLocator?.Build(mainVm) as Window;
desktop.MainWindow.MinWidth = 1220;
desktop.MainWindow.MaxWidth = 1220;
desktop.MainWindow.MaxHeight = 840;
desktop.MainWindow.Height = 840;
}

Expand Down
1 change: 1 addition & 0 deletions UotanToolbox/MainView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
BackgroundStyle="{Binding BackgroundStyle}"
BackgroundTransitionsEnabled="{Binding TransitionsEnabled}"
Icon="Assets/OIG.N5o-removebg-preview.png"
CanMaxSize="False"
IsMenuVisible="False"
mc:Ignorable="d">
<suki:SukiWindow.LogoContent>
Expand Down

0 comments on commit f63794b

Please sign in to comment.