feat: add size classes
This commit is contained in:
@@ -15,5 +15,8 @@
|
|||||||
<StackPanel Margin="20" Spacing="20">
|
<StackPanel Margin="20" Spacing="20">
|
||||||
<u:ButtonGroup Classes="Primary Solid" ItemsSource="{Binding Items}" />
|
<u:ButtonGroup Classes="Primary Solid" ItemsSource="{Binding Items}" />
|
||||||
<u:ButtonGroup Classes="Primary" ItemsSource="{Binding Items}" />
|
<u:ButtonGroup Classes="Primary" ItemsSource="{Binding Items}" />
|
||||||
|
<u:ButtonGroup Classes="Primary Borderless" ItemsSource="{Binding Items}" />
|
||||||
|
<u:ButtonGroup Classes="Primary Large" ItemsSource="{Binding Items}" />
|
||||||
|
<u:ButtonGroup Classes="Primary Small" ItemsSource="{Binding Items}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
<Setter Property="Padding" Value="{DynamicResource ButtonGroupDefaultPadding}" />
|
||||||
<Setter Property="FontWeight" Value="{DynamicResource ButtonGroupDefaultFontWeight}" />
|
<Setter Property="FontWeight" Value="{DynamicResource ButtonGroupDefaultFontWeight}" />
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Setter Property="Button.Template">
|
<Setter Property="Button.Template">
|
||||||
@@ -53,12 +54,12 @@
|
|||||||
DockPanel.Dock="Right"
|
DockPanel.Dock="Right"
|
||||||
Fill="{DynamicResource ButtonGroupSeparatorForeground}" />
|
Fill="{DynamicResource ButtonGroupSeparatorForeground}" />
|
||||||
<Border
|
<Border
|
||||||
Padding="8"
|
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}">
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
|
Margin="{TemplateBinding Padding}"
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Content="{TemplateBinding Content}"
|
Content="{TemplateBinding Content}"
|
||||||
|
|||||||
@@ -21,6 +21,12 @@
|
|||||||
<Style Selector="u|ButtonGroup.Borderless">
|
<Style Selector="u|ButtonGroup.Borderless">
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style Selector="u|ButtonGroup.Large Button">
|
||||||
|
<Setter Property="Padding" Value="{DynamicResource ButtonGroupLargePadding}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="u|ButtonGroup.Small Button">
|
||||||
|
<Setter Property="Padding" Value="{DynamicResource ButtonGroupSmallPadding}" />
|
||||||
|
</Style>
|
||||||
<Style Selector="u|ButtonGroup Button:pointerover">
|
<Style Selector="u|ButtonGroup Button:pointerover">
|
||||||
<Setter Property="Background" Value="{DynamicResource ButtonGroupDefaultPointeroverBackground}" />
|
<Setter Property="Background" Value="{DynamicResource ButtonGroupDefaultPointeroverBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
<!-- Add Resources Here -->
|
<!-- Add Resources Here -->
|
||||||
|
|
||||||
<x:Double x:Key="ButtonGroupDefaultFontSize">14</x:Double>
|
|
||||||
<FontWeight x:Key="ButtonGroupDefaultFontWeight">600</FontWeight>
|
|
||||||
<CornerRadius x:Key="ButtonGroupCornerRadius">3</CornerRadius>
|
|
||||||
|
|
||||||
<SolidColorBrush x:Key="ButtonGroupSeparatorForeground" Opacity="0.08" Color="#FF1C1F23" />
|
<SolidColorBrush x:Key="ButtonGroupSeparatorForeground" Opacity="0.08" Color="#FF1C1F23" />
|
||||||
<!-- Light -->
|
<!-- Light -->
|
||||||
<SolidColorBrush x:Key="ButtonGroupDefaultPrimaryForeground" Color="#0077FA" />
|
<SolidColorBrush x:Key="ButtonGroupDefaultPrimaryForeground" Color="#0077FA" />
|
||||||
|
|||||||
10
src/Ursa.Themes.Semi/Themes/Shared/ButtonGroup.axaml
Normal file
10
src/Ursa.Themes.Semi/Themes/Shared/ButtonGroup.axaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<!-- Add Resources Here -->
|
||||||
|
<x:Double x:Key="ButtonGroupDefaultFontSize">14</x:Double>
|
||||||
|
<FontWeight x:Key="ButtonGroupDefaultFontWeight">600</FontWeight>
|
||||||
|
<CornerRadius x:Key="ButtonGroupCornerRadius">3</CornerRadius>
|
||||||
|
|
||||||
|
<Thickness x:Key="ButtonGroupDefaultPadding">12 6</Thickness>
|
||||||
|
<Thickness x:Key="ButtonGroupLargePadding">16 10</Thickness>
|
||||||
|
<Thickness x:Key="ButtonGroupSmallPadding">6 2</Thickness>
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<MergeResourceInclude Source="Badge.axaml" />
|
<MergeResourceInclude Source="Badge.axaml" />
|
||||||
<MergeResourceInclude Source="Banner.axaml" />
|
<MergeResourceInclude Source="Banner.axaml" />
|
||||||
|
<MergeResourceInclude Source="ButtonGroup.axaml" />
|
||||||
<MergeResourceInclude Source="Divider.axaml" />
|
<MergeResourceInclude Source="Divider.axaml" />
|
||||||
<MergeResourceInclude Source="IPv4Box.axaml" />
|
<MergeResourceInclude Source="IPv4Box.axaml" />
|
||||||
<MergeResourceInclude Source="NavigationMenu.axaml" />
|
<MergeResourceInclude Source="NavigationMenu.axaml" />
|
||||||
|
|||||||
Reference in New Issue
Block a user