Skip to content

Commit

Permalink
For hc:Window
Browse files Browse the repository at this point in the history
-Fixed the bug that property ShowMaxButton will cause the window to fail to restore  ghost1372#228
-Fixed the bug that NonClientAreaHeight property does not take effect
  • Loading branch information
Waheal committed Oct 20, 2024
1 parent 42da7c6 commit 97f107a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Shared/HandyControl_Shared/Controls/Window/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public Brush NonClientAreaForeground

public static readonly DependencyProperty NonClientAreaHeightProperty = DependencyProperty.Register(
nameof(NonClientAreaHeight), typeof(double), typeof(Window),
new PropertyMetadata(22.0));
new PropertyMetadata(30.0));

public double NonClientAreaHeight
{
Expand Down Expand Up @@ -441,7 +441,8 @@ private IntPtr HwndSourceHook(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam
{
if ((int) wparam == InteropValues.SC_MAXIMIZE || (int) wparam == InteropValues.SC_RESTORE)
{
handled = true;
if (WindowState != WindowState.Minimized)
handled = true;
}
}
if (!ShowMinButton)
Expand Down
4 changes: 2 additions & 2 deletions src/Shared/HandyControl_Shared/Themes/Styles/Window.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Background="{TemplateBinding NonClientAreaBackground}" Name="PART_NonClientArea" TextElement.Foreground="{TemplateBinding NonClientAreaForeground}">
<Grid Height="{TemplateBinding NonClientAreaHeight}" Background="{TemplateBinding NonClientAreaBackground}" Name="PART_NonClientArea" TextElement.Foreground="{TemplateBinding NonClientAreaForeground}">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
Expand Down Expand Up @@ -177,7 +177,7 @@
<AdornerDecorator>
<hc:SimplePanel>
<ContentPresenter ClipToBounds="True"/>
<Grid Background="{TemplateBinding NonClientAreaBackground}" Name="PART_NonClientArea" TextElement.Foreground="{TemplateBinding NonClientAreaForeground}" VerticalAlignment="Top">
<Grid Height="{TemplateBinding NonClientAreaHeight}" Background="{TemplateBinding NonClientAreaBackground}" Name="PART_NonClientArea" TextElement.Foreground="{TemplateBinding NonClientAreaForeground}" VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
Expand Down

0 comments on commit 97f107a

Please sign in to comment.