mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-12 12:16:36 +08:00
feat: Properly handle nc hit test for caption buttons. (#745)
(cherry picked from commit fdbfd91b8f)
This commit is contained in:
@@ -50,21 +50,33 @@
|
|||||||
Data="{StaticResource WindowExpandGlyph}"
|
Data="{StaticResource WindowExpandGlyph}"
|
||||||
Foreground="{Binding $parent[Button].Foreground}" />
|
Foreground="{Binding $parent[Button].Foreground}" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button Name="PART_MinimizeButton" Theme="{StaticResource CaptionButton}">
|
<Button
|
||||||
|
Name="PART_MinimizeButton"
|
||||||
|
Theme="{StaticResource CaptionButton}"
|
||||||
|
AutomationProperties.Name="Minimize"
|
||||||
|
Win32Properties.NonClientHitTestResult="MinButton">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Name="PART_MinimizeButtonIcon"
|
Name="PART_MinimizeButtonIcon"
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
Theme="{StaticResource InnerPathIcon}"
|
||||||
Data="{StaticResource WindowMinimizeGlyph}"
|
Data="{StaticResource WindowMinimizeGlyph}"
|
||||||
Foreground="{Binding $parent[Button].Foreground}" />
|
Foreground="{Binding $parent[Button].Foreground}" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button Name="PART_RestoreButton" Theme="{StaticResource CaptionButton}">
|
<Button
|
||||||
|
Name="PART_RestoreButton"
|
||||||
|
Theme="{StaticResource CaptionButton}"
|
||||||
|
AutomationProperties.Name="Maximize"
|
||||||
|
Win32Properties.NonClientHitTestResult="MaxButton">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Name="PART_RestoreButtonIcon"
|
Name="PART_RestoreButtonIcon"
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
Theme="{StaticResource InnerPathIcon}"
|
||||||
Data="{StaticResource WindowMaximizeGlyph}"
|
Data="{StaticResource WindowMaximizeGlyph}"
|
||||||
Foreground="{Binding $parent[Button].Foreground}" />
|
Foreground="{Binding $parent[Button].Foreground}" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button Name="PART_CloseButton" Theme="{StaticResource CaptionButton}">
|
<Button
|
||||||
|
Name="PART_CloseButton"
|
||||||
|
Theme="{StaticResource CaptionButton}"
|
||||||
|
AutomationProperties.Name="Close"
|
||||||
|
Win32Properties.NonClientHitTestResult="Close">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Name="PART_CloseButtonIcon"
|
Name="PART_CloseButtonIcon"
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
Theme="{StaticResource InnerPathIcon}"
|
||||||
|
|||||||
@@ -16,12 +16,14 @@
|
|||||||
<Border
|
<Border
|
||||||
Name="PART_Background"
|
Name="PART_Background"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
IsHitTestVisible="False" />
|
IsHitTestVisible="False"
|
||||||
|
Win32Properties.NonClientHitTestResult="Caption" />
|
||||||
<CaptionButtons
|
<CaptionButtons
|
||||||
Name="PART_CaptionButtons"
|
Name="PART_CaptionButtons"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Foreground="{TemplateBinding Foreground}" />
|
Foreground="{TemplateBinding Foreground}"
|
||||||
|
Win32Properties.NonClientHitTestResult="Client" />
|
||||||
</Panel>
|
</Panel>
|
||||||
</Panel>
|
</Panel>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|||||||
Reference in New Issue
Block a user