feat: add theme and function.

This commit is contained in:
rabbitism
2024-03-05 21:07:15 +08:00
parent 47f3bd759e
commit 390b581cb8
8 changed files with 227 additions and 23 deletions

View File

@@ -0,0 +1,39 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:ScrollToButton}" TargetType="u:ScrollToButton">
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Bottom" />
<Setter Property="Cursor" Value="Hand"></Setter>
<Setter Property="Margin" Value="0, 0, 32, 32" />
<Setter Property="Template">
<ControlTemplate TargetType="u:ScrollToButton">
<Border
Name="PART_Background"
Background="{DynamicResource ButtonDefaultBackground}"
CornerRadius="{DynamicResource ButtonCornerRadius}">
<PathIcon
Name="PART_Icon"
Margin="8"
Width="16"
Height="16"
Data="{DynamicResource ScrollToButtonIconGlyph}"
Foreground="{DynamicResource ButtonDefaultPrimaryForeground}" />
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:pressed">
<Setter Property="RenderTransform" Value="scale(0.98)" />
</Style>
<Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
</Style>
<Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -25,6 +25,7 @@
<ResourceInclude Source="NumberDisplayer.axaml" />
<ResourceInclude Source="Pagination.axaml" />
<ResourceInclude Source="RangeSlider.axaml" />
<ResourceInclude Source="ScrollToButton.axaml" />
<ResourceInclude Source="SelectionList.axaml" />
<ResourceInclude Source="TagInput.axaml" />
<ResourceInclude Source="ThemeSelector.axaml" />