CalendarDayButton.axaml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <ControlTheme x:Key="SukiCalendarDayButtonStyle" TargetType="CalendarDayButton">
  3. <Setter Property="ClickMode" Value="Release" />
  4. <Setter Property="MinWidth" Value="32" />
  5. <Setter Property="MinHeight" Value="32" />
  6. <Setter Property="Foreground" Value="{DynamicResource SukiText}" />
  7. <Setter Property="Background" Value="Transparent" />
  8. <Setter Property="BorderBrush" Value="Transparent" />
  9. <Setter Property="BorderThickness" Value="0" />
  10. <Setter Property="IsVisible" Value="True" />
  11. <Setter Property="Padding" Value="2" />
  12. <Setter Property="ClipToBounds" Value="False" />
  13. <Setter Property="CornerRadius" Value="{DynamicResource SmallCornerRadius}" />
  14. <Setter Property="HorizontalAlignment" Value="Center" />
  15. <Setter Property="VerticalAlignment" Value="Center" />
  16. <Setter Property="HorizontalContentAlignment" Value="Center" />
  17. <Setter Property="VerticalContentAlignment" Value="Center" />
  18. <Setter Property="Template">
  19. <ControlTemplate>
  20. <Border Name="PART_RootBorder"
  21. Padding="{TemplateBinding Padding}"
  22. Background="{TemplateBinding Background}"
  23. BorderBrush="{TemplateBinding BorderBrush}"
  24. BorderThickness="{TemplateBinding BorderThickness}"
  25. CornerRadius="{TemplateBinding CornerRadius}">
  26. <Panel Name="PART_RootPanel">
  27. <Border Name="PART_EffectBorder"
  28. Background="{DynamicResource SukiPrimaryColor0}"
  29. CornerRadius="{TemplateBinding CornerRadius}">
  30. <Border.Transitions>
  31. <Transitions>
  32. <BrushTransition Property="Background" Duration="{DynamicResource ShortAnimationDuration}" />
  33. <BrushTransition Property="BorderBrush" Duration="{DynamicResource ShortAnimationDuration}" />
  34. </Transitions>
  35. </Border.Transitions>
  36. </Border>
  37. <ContentPresenter Name="PART_ContentPresenter"
  38. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  39. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  40. Content="{TemplateBinding Content}"
  41. ContentTemplate="{TemplateBinding ContentTemplate}" />
  42. </Panel>
  43. </Border>
  44. </ControlTemplate>
  45. </Setter>
  46. <Style Selector="^:pointerover /template/ Border#PART_EffectBorder">
  47. <Setter Property="Background" Value="{DynamicResource SukiPrimaryColor25}" />
  48. </Style>
  49. <Style Selector="^:selected /template/ Border#PART_EffectBorder">
  50. <Setter Property="Background" Value="{DynamicResource SukiPrimaryColor}" />
  51. <Setter Property="TextElement.FontWeight" Value="Bold" />
  52. <Setter Property="TextElement.Foreground" Value="White" />
  53. </Style>
  54. <Style Selector="^:selected /template/ Border#PART_RootBorder">
  55. <Setter Property="TextElement.FontWeight" Value="Bold" />
  56. </Style>
  57. <Style Selector="^:today /template/ Border#PART_EffectBorder">
  58. <Setter Property="Background" Value="{DynamicResource SukiAccentColor50}" />
  59. <Setter Property="BorderThickness" Value="0" />
  60. <Setter Property="TextElement.FontWeight" Value="Bold" />
  61. <Setter Property="TextElement.Foreground" Value="White" />
  62. </Style>
  63. <Style Selector="^:today /template/ TextBlock">
  64. <Setter Property="TextElement.FontWeight" Value="Bold" />
  65. <Setter Property="TextElement.Foreground" Value="White" />
  66. <Setter Property="FontWeight" Value="Bold" />
  67. <Setter Property="Foreground" Value="White" />
  68. </Style>
  69. <Style Selector="^:today /template/ ContentPresenter">
  70. <Setter Property="FontWeight" Value="Bold" />
  71. <Setter Property="Foreground" Value="White" />
  72. </Style>
  73. <Style Selector="^:selected /template/ TextBlock">
  74. <Setter Property="TextElement.FontWeight" Value="Bold" />
  75. <Setter Property="TextElement.Foreground" Value="White" />
  76. <Setter Property="FontWeight" Value="Bold" />
  77. <Setter Property="Foreground" Value="White" />
  78. </Style>
  79. <Style Selector="^:selected /template/ ContentPresenter">
  80. <Setter Property="FontWeight" Value="Bold" />
  81. <Setter Property="Foreground" Value="White" />
  82. </Style>
  83. <Style Selector="^:inactive /template/ Border#PART_RootBorder">
  84. <Setter Property="Opacity" Value="0.24" />
  85. </Style>
  86. <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
  87. <Setter Property="Opacity" Value="0.32" />
  88. </Style>
  89. <Style Selector="^:blackout">
  90. <Setter Property="IsVisible" Value="False" />
  91. </Style>
  92. </ControlTheme>
  93. <ControlTheme x:Key="{x:Type CalendarDayButton}"
  94. BasedOn="{StaticResource SukiCalendarDayButtonStyle}"
  95. TargetType="CalendarDayButton" />
  96. </ResourceDictionary>