Browse Source

Expanded HitTest regions of internal elements

Set Backgrounds to Transparent for various buttons in the control
templates to allow for expanded HitTest regions allowing for better
PointerOver and Clicking behavior
pull/1244/head
sdoroff 9 years ago
parent
commit
ebcaa0742c
  1. 2
      src/Avalonia.Themes.Default/CalendarDayButton.xaml
  2. 13
      src/Avalonia.Themes.Default/CalendarItem.xaml

2
src/Avalonia.Themes.Default/CalendarDayButton.xaml

@ -16,7 +16,7 @@
<Setter Property="Focusable" Value="False"/> <Setter Property="Focusable" Value="False"/>
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Panel> <Panel Background="Transparent">
<Rectangle Name="TodayBackground" <Rectangle Name="TodayBackground"
Fill="{DynamicResource HighlightBrush}"/> Fill="{DynamicResource HighlightBrush}"/>

13
src/Avalonia.Themes.Default/CalendarItem.xaml

@ -35,7 +35,8 @@
<Style Selector="Button.Header"> <Style Selector="Button.Header">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Panel Cursor="Hand"> <Panel Cursor="Hand"
Background="Transparent">
<ContentControl Name="Content" <ContentControl Name="Content"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
@ -56,7 +57,8 @@
<Style Selector="Button.Previous"> <Style Selector="Button.Previous">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Panel Cursor="Hand"> <Panel Cursor="Hand"
Background="Transparent">
<Path Name="IconPath" <Path Name="IconPath"
Margin="14,-6,0,0" Margin="14,-6,0,0"
Height="10" Height="10"
@ -79,7 +81,8 @@
<Style Selector="Button.Next"> <Style Selector="Button.Next">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Panel Cursor="Hand"> <Panel Cursor="Hand"
Background="Transparent">
<Path Name="IconPath" <Path Name="IconPath"
Margin="0,-6,14,0" Margin="0,-6,14,0"
Height="10" Height="10"
@ -105,7 +108,7 @@
Stretch="Fill" Stretch="Fill"
VerticalAlignment="Top" VerticalAlignment="Top"
Height="22"/> Height="22"/>
<Button Name="PreviousButton" <Button Name="PreviousButton"
Classes="Previous" Classes="Previous"
Height="20" Height="20"
@ -205,5 +208,5 @@
<Style Selector="CalendarItem:calendardisabled /template/ Rectangle#DisabledVisual"> <Style Selector="CalendarItem:calendardisabled /template/ Rectangle#DisabledVisual">
<Setter Property="IsVisible" Value="True"/> <Setter Property="IsVisible" Value="True"/>
</Style> </Style>
</Styles> </Styles>
Loading…
Cancel
Save