mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-11 04:00:48 +08:00
feat: add Semi theme styling for CommandBar, AppBarButton, AppBarToggleButton, AppBarSeparator
Co-authored-by: zdpcdt <54255897+zdpcdt@users.noreply.github.com>
This commit is contained in:
committed by
Zhang Dian
parent
c144056ab0
commit
4ddcca529c
152
demo/Semi.Avalonia.Demo/Pages/CommandBarDemo.axaml
Normal file
152
demo/Semi.Avalonia.Demo/Pages/CommandBarDemo.axaml
Normal file
@@ -0,0 +1,152 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.CommandBarDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="600"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="16" Margin="0,0,0,16">
|
||||
|
||||
<!-- Default: label below icon (Bottom) -->
|
||||
<HeaderedContentControl Theme="{StaticResource GroupBox}">
|
||||
<HeaderedContentControl.Header>
|
||||
<TextBlock Text="CommandBar — Label Position: Bottom (default)" />
|
||||
</HeaderedContentControl.Header>
|
||||
<CommandBar>
|
||||
<AppBarButton Label="New">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarButton Label="Open">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M19,20H4C2.89,20 2,19.1 2,18V6C2,4.89 2.89,4 4,4H10L12,6H19A2,2 0 0,1 21,8H21L4,8V18L6.14,10H23.21L20.93,18.5C20.7,19.37 19.92,20 19,20Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarButton Label="Save">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarSeparator />
|
||||
<AppBarToggleButton Label="Bold">
|
||||
<AppBarToggleButton.Icon>
|
||||
<PathIcon Data="M15.6,10.79C17.04,10.07 18,8.64 18,7C18,4.79 16.21,3 14,3H7V21H14.73C16.78,21 18.5,19.37 18.5,17.32C18.5,15.82 17.72,14.53 16.5,13.77C16.2,13.59 15.9,13.44 15.6,13.32V10.79M10,6.5H13C13.83,6.5 14.5,7.17 14.5,8C14.5,8.83 13.83,9.5 13,9.5H10V6.5M13.5,17.5H10V14H13.5C14.33,14 15,14.67 15,15.5C15,16.33 14.33,17.5 13.5,17.5Z" />
|
||||
</AppBarToggleButton.Icon>
|
||||
</AppBarToggleButton>
|
||||
<AppBarToggleButton Label="Italic" IsChecked="True">
|
||||
<AppBarToggleButton.Icon>
|
||||
<PathIcon Data="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z" />
|
||||
</AppBarToggleButton.Icon>
|
||||
</AppBarToggleButton>
|
||||
<AppBarButton Label="Disabled" IsEnabled="False">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
</CommandBar>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<!-- LabelPosition=Right -->
|
||||
<HeaderedContentControl Theme="{StaticResource GroupBox}">
|
||||
<HeaderedContentControl.Header>
|
||||
<TextBlock Text="CommandBar — Label Position: Right" />
|
||||
</HeaderedContentControl.Header>
|
||||
<CommandBar DefaultLabelPosition="Right">
|
||||
<AppBarButton Label="New">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarButton Label="Save">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarSeparator />
|
||||
<AppBarToggleButton Label="Bold" IsChecked="True">
|
||||
<AppBarToggleButton.Icon>
|
||||
<PathIcon Data="M15.6,10.79C17.04,10.07 18,8.64 18,7C18,4.79 16.21,3 14,3H7V21H14.73C16.78,21 18.5,19.37 18.5,17.32C18.5,15.82 17.72,14.53 16.5,13.77C16.2,13.59 15.9,13.44 15.6,13.32V10.79M10,6.5H13C13.83,6.5 14.5,7.17 14.5,8C14.5,8.83 13.83,9.5 13,9.5H10V6.5M13.5,17.5H10V14H13.5C14.33,14 15,14.67 15,15.5C15,16.33 14.33,17.5 13.5,17.5Z" />
|
||||
</AppBarToggleButton.Icon>
|
||||
</AppBarToggleButton>
|
||||
</CommandBar>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<!-- Compact (icons only) -->
|
||||
<HeaderedContentControl Theme="{StaticResource GroupBox}">
|
||||
<HeaderedContentControl.Header>
|
||||
<TextBlock Text="CommandBar — Compact (icons only)" />
|
||||
</HeaderedContentControl.Header>
|
||||
<CommandBar DefaultLabelPosition="Collapsed">
|
||||
<AppBarButton Label="New">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarButton Label="Open">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M19,20H4C2.89,20 2,19.1 2,18V6C2,4.89 2.89,4 4,4H10L12,6H19A2,2 0 0,1 21,8H21L4,8V18L6.14,10H23.21L20.93,18.5C20.7,19.37 19.92,20 19,20Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarButton Label="Save">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarSeparator />
|
||||
<AppBarToggleButton Label="Bold">
|
||||
<AppBarToggleButton.Icon>
|
||||
<PathIcon Data="M15.6,10.79C17.04,10.07 18,8.64 18,7C18,4.79 16.21,3 14,3H7V21H14.73C16.78,21 18.5,19.37 18.5,17.32C18.5,15.82 17.72,14.53 16.5,13.77C16.2,13.59 15.9,13.44 15.6,13.32V10.79M10,6.5H13C13.83,6.5 14.5,7.17 14.5,8C14.5,8.83 13.83,9.5 13,9.5H10V6.5M13.5,17.5H10V14H13.5C14.33,14 15,14.67 15,15.5C15,16.33 14.33,17.5 13.5,17.5Z" />
|
||||
</AppBarToggleButton.Icon>
|
||||
</AppBarToggleButton>
|
||||
</CommandBar>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<!-- With secondary commands (overflow) -->
|
||||
<HeaderedContentControl Theme="{StaticResource GroupBox}">
|
||||
<HeaderedContentControl.Header>
|
||||
<TextBlock Text="CommandBar — With Secondary Commands (overflow)" />
|
||||
</HeaderedContentControl.Header>
|
||||
<CommandBar>
|
||||
<AppBarButton Label="Cut">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.89,16 6,16A2,2 0 0,1 8,18C8,19.11 7.11,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.89,4 6,4A2,2 0 0,1 8,6C8,7.11 7.11,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarButton Label="Copy">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarButton Label="Paste">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<CommandBar.SecondaryCommands>
|
||||
<AppBarButton Label="Select All">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M17,13H13V17H11V13H7V11H11V7H13V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarSeparator />
|
||||
<AppBarButton Label="Find">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarToggleButton Label="Wrap Text">
|
||||
<AppBarToggleButton.Icon>
|
||||
<PathIcon Data="M21,5H3V7H21V5M3,10H16A3,3 0 0,1 19,13A3,3 0 0,1 16,16H14V14L11,17L14,20V18H16A5,5 0 0,0 21,13A5,5 0 0,0 16,8H3V10M3,19H10V17H3V19Z" />
|
||||
</AppBarToggleButton.Icon>
|
||||
</AppBarToggleButton>
|
||||
</CommandBar.SecondaryCommands>
|
||||
</CommandBar>
|
||||
</HeaderedContentControl>
|
||||
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
11
demo/Semi.Avalonia.Demo/Pages/CommandBarDemo.axaml.cs
Normal file
11
demo/Semi.Avalonia.Demo/Pages/CommandBarDemo.axaml.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class CommandBarDemo : UserControl
|
||||
{
|
||||
public CommandBarDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -269,6 +269,9 @@
|
||||
<TabItem
|
||||
Theme="{DynamicResource CategoryTabItem}"
|
||||
Header="Other" />
|
||||
<TabItem Header="CommandBar">
|
||||
<pages:CommandBarDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="GridSplitter">
|
||||
<pages:GridSplitterDemo />
|
||||
</TabItem>
|
||||
|
||||
406
src/Semi.Avalonia/Controls/CommandBar.axaml
Normal file
406
src/Semi.Avalonia/Controls/CommandBar.axaml
Normal file
@@ -0,0 +1,406 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Design.PreviewWith>
|
||||
<Border Padding="16" Width="600" Background="{DynamicResource SemiColorBackground0}">
|
||||
<StackPanel Spacing="16">
|
||||
<CommandBar>
|
||||
<AppBarButton Label="New">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarButton Label="Save">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarSeparator />
|
||||
<AppBarToggleButton Label="Bold">
|
||||
<AppBarToggleButton.Icon>
|
||||
<PathIcon Data="M15.6,10.79C17.04,10.07 18,8.64 18,7C18,4.79 16.21,3 14,3H7V21H14.73C16.78,21 18.5,19.37 18.5,17.32C18.5,15.82 17.72,14.53 16.5,13.77C16.2,13.59 15.9,13.44 15.6,13.32V10.79M10,6.5H13C13.83,6.5 14.5,7.17 14.5,8C14.5,8.83 13.83,9.5 13,9.5H10V6.5M13.5,17.5H10V14H13.5C14.33,14 15,14.67 15,15.5C15,16.33 14.33,17.5 13.5,17.5Z" />
|
||||
</AppBarToggleButton.Icon>
|
||||
</AppBarToggleButton>
|
||||
<AppBarButton Label="Disabled" IsEnabled="False">
|
||||
<AppBarButton.Icon>
|
||||
<PathIcon Data="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
</CommandBar>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<!-- AppBarButton -->
|
||||
<ControlTheme x:Key="{x:Type AppBarButton}" TargetType="AppBarButton">
|
||||
<Setter Property="Background" Value="{DynamicResource AppBarButtonBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonForeground}" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Padding" Value="{DynamicResource AppBarButtonPadding}" />
|
||||
<Setter Property="Width" Value="{DynamicResource AppBarButtonWidth}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource AppBarButtonMinHeight}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource AppBarButtonCornerRadius}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="AppBarButton">
|
||||
<Border
|
||||
x:Name="PART_Border"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<StackPanel
|
||||
x:Name="PART_LayoutRoot"
|
||||
Spacing="4"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<ContentPresenter
|
||||
x:Name="PART_IconPresenter"
|
||||
Content="{TemplateBinding Icon}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Width="{DynamicResource AppBarButtonIconSize}"
|
||||
Height="{DynamicResource AppBarButtonIconSize}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBlock
|
||||
x:Name="PART_Label"
|
||||
Text="{TemplateBinding Label}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
FontSize="{DynamicResource AppBarButtonLabelFontSize}"
|
||||
HorizontalAlignment="Center"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- Pointer over -->
|
||||
<Style Selector="^:pointerover /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{DynamicResource AppBarButtonPointeroverBackground}" />
|
||||
</Style>
|
||||
|
||||
<!-- Pressed -->
|
||||
<Style Selector="^:pressed /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{DynamicResource AppBarButtonPressedBackground}" />
|
||||
</Style>
|
||||
|
||||
<!-- Disabled -->
|
||||
<Style Selector="^:disabled /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonDisabledForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:disabled /template/ TextBlock#PART_Label">
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonDisabledForeground}" />
|
||||
</Style>
|
||||
|
||||
<!-- IsCompact: hide label, use compact width -->
|
||||
<Style Selector="^[IsCompact=True]">
|
||||
<Setter Property="Width" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^[IsCompact=True] /template/ TextBlock#PART_Label">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<!-- LabelPosition=Collapsed: hide label, use compact width -->
|
||||
<Style Selector="^[LabelPosition=Collapsed]">
|
||||
<Setter Property="Width" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^[LabelPosition=Collapsed] /template/ TextBlock#PART_Label">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<!-- LabelPosition=Right: horizontal layout, auto-width -->
|
||||
<Style Selector="^[LabelPosition=Right]">
|
||||
<Setter Property="Width" Value="NaN" />
|
||||
<Setter Property="MinWidth" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^[LabelPosition=Right] /template/ StackPanel#PART_LayoutRoot">
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
</Style>
|
||||
<Style Selector="^[LabelPosition=Right] /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style Selector="^[LabelPosition=Right] /template/ TextBlock#PART_Label">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<!-- IsInOverflow: full-width horizontal layout for use inside overflow popup -->
|
||||
<Style Selector="^[IsInOverflow=True]">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="Width" Value="NaN" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource AppBarButtonOverflowMinHeight}" />
|
||||
<Setter Property="Padding" Value="{DynamicResource AppBarButtonOverflowPadding}" />
|
||||
</Style>
|
||||
<Style Selector="^[IsInOverflow=True] /template/ StackPanel#PART_LayoutRoot">
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
</Style>
|
||||
<Style Selector="^[IsInOverflow=True] /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style Selector="^[IsInOverflow=True] /template/ TextBlock#PART_Label">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- AppBarToggleButton -->
|
||||
<ControlTheme x:Key="{x:Type AppBarToggleButton}" TargetType="AppBarToggleButton">
|
||||
<Setter Property="Background" Value="{DynamicResource AppBarButtonBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonForeground}" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Padding" Value="{DynamicResource AppBarButtonPadding}" />
|
||||
<Setter Property="Width" Value="{DynamicResource AppBarButtonWidth}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource AppBarButtonMinHeight}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource AppBarButtonCornerRadius}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="AppBarToggleButton">
|
||||
<Border
|
||||
x:Name="PART_Border"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<StackPanel
|
||||
x:Name="PART_LayoutRoot"
|
||||
Spacing="4"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<ContentPresenter
|
||||
x:Name="PART_IconPresenter"
|
||||
Content="{TemplateBinding Icon}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Width="{DynamicResource AppBarButtonIconSize}"
|
||||
Height="{DynamicResource AppBarButtonIconSize}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBlock
|
||||
x:Name="PART_Label"
|
||||
Text="{TemplateBinding Label}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
FontSize="{DynamicResource AppBarButtonLabelFontSize}"
|
||||
HorizontalAlignment="Center"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- Pointer over -->
|
||||
<Style Selector="^:pointerover /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{DynamicResource AppBarButtonPointeroverBackground}" />
|
||||
</Style>
|
||||
|
||||
<!-- Pressed -->
|
||||
<Style Selector="^:pressed /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{DynamicResource AppBarButtonPressedBackground}" />
|
||||
</Style>
|
||||
|
||||
<!-- Checked -->
|
||||
<Style Selector="^:checked /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{DynamicResource AppBarToggleButtonCheckedBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^:checked /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppBarToggleButtonCheckedForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:checked /template/ TextBlock#PART_Label">
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppBarToggleButtonCheckedForeground}" />
|
||||
</Style>
|
||||
|
||||
<!-- Checked + Pointer over -->
|
||||
<Style Selector="^:checked:pointerover /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{DynamicResource AppBarToggleButtonCheckedPointeroverBackground}" />
|
||||
</Style>
|
||||
|
||||
<!-- Disabled -->
|
||||
<Style Selector="^:disabled /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonDisabledForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:disabled /template/ TextBlock#PART_Label">
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonDisabledForeground}" />
|
||||
</Style>
|
||||
|
||||
<!-- IsCompact: hide label, use compact width -->
|
||||
<Style Selector="^[IsCompact=True]">
|
||||
<Setter Property="Width" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^[IsCompact=True] /template/ TextBlock#PART_Label">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<!-- LabelPosition=Collapsed: hide label, use compact width -->
|
||||
<Style Selector="^[LabelPosition=Collapsed]">
|
||||
<Setter Property="Width" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^[LabelPosition=Collapsed] /template/ TextBlock#PART_Label">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<!-- LabelPosition=Right: horizontal layout, auto-width -->
|
||||
<Style Selector="^[LabelPosition=Right]">
|
||||
<Setter Property="Width" Value="NaN" />
|
||||
<Setter Property="MinWidth" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^[LabelPosition=Right] /template/ StackPanel#PART_LayoutRoot">
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
</Style>
|
||||
<Style Selector="^[LabelPosition=Right] /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style Selector="^[LabelPosition=Right] /template/ TextBlock#PART_Label">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<!-- IsInOverflow: full-width horizontal layout -->
|
||||
<Style Selector="^[IsInOverflow=True]">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="Width" Value="NaN" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource AppBarButtonOverflowMinHeight}" />
|
||||
<Setter Property="Padding" Value="{DynamicResource AppBarButtonOverflowPadding}" />
|
||||
</Style>
|
||||
<Style Selector="^[IsInOverflow=True] /template/ StackPanel#PART_LayoutRoot">
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
</Style>
|
||||
<Style Selector="^[IsInOverflow=True] /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style Selector="^[IsInOverflow=True] /template/ TextBlock#PART_Label">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- AppBarSeparator -->
|
||||
<ControlTheme x:Key="{x:Type AppBarSeparator}" TargetType="AppBarSeparator">
|
||||
<Setter Property="Background" Value="{DynamicResource AppBarSeparatorBackground}" />
|
||||
<Setter Property="Width" Value="{DynamicResource AppBarSeparatorWidth}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource AppBarSeparatorMinHeight}" />
|
||||
<Setter Property="Margin" Value="{DynamicResource AppBarSeparatorMargin}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="AppBarSeparator">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
Width="{TemplateBinding Width}"
|
||||
MinHeight="{TemplateBinding MinHeight}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- IsInOverflow: horizontal line separator -->
|
||||
<Style Selector="^[IsInOverflow=True]">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Width" Value="NaN" />
|
||||
<Setter Property="Height" Value="{DynamicResource AppBarSeparatorOverflowHeight}" />
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="Margin" Value="{DynamicResource AppBarSeparatorOverflowMargin}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- CommandBar -->
|
||||
<ControlTheme x:Key="{x:Type CommandBar}" TargetType="CommandBar">
|
||||
<Setter Property="Background" Value="{DynamicResource CommandBarBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource CommandBarForeground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CommandBarBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource CommandBarBorderThickness}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource CommandBarCornerRadius}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource CommandBarMinHeight}" />
|
||||
<Setter Property="Padding" Value="{DynamicResource CommandBarPadding}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="CommandBar">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
MinHeight="{TemplateBinding MinHeight}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<Panel>
|
||||
<DockPanel>
|
||||
<!-- Overflow button (docked right) -->
|
||||
<Button
|
||||
x:Name="PART_OverflowButton"
|
||||
DockPanel.Dock="Right"
|
||||
Theme="{DynamicResource AppBarOverflowButton}"
|
||||
IsVisible="{TemplateBinding IsOverflowButtonVisible}"
|
||||
VerticalAlignment="Stretch">
|
||||
<PathIcon
|
||||
Width="{DynamicResource AppBarButtonIconSize}"
|
||||
Height="{DynamicResource AppBarButtonIconSize}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Data="{DynamicResource CommandBarOverflowButtonGlyph}" />
|
||||
</Button>
|
||||
|
||||
<!-- Custom content (docked left) -->
|
||||
<ContentPresenter
|
||||
x:Name="PART_ContentPresenter"
|
||||
DockPanel.Dock="Left"
|
||||
Content="{TemplateBinding Content}"
|
||||
VerticalAlignment="Center" />
|
||||
|
||||
<!-- Primary commands (fills remaining space, right-aligned) -->
|
||||
<ItemsControl
|
||||
x:Name="PART_PrimaryCommands"
|
||||
ItemsSource="{Binding VisiblePrimaryCommands, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Stretch"
|
||||
ClipToBounds="True">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" Spacing="2" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</DockPanel>
|
||||
|
||||
<!-- Overflow popup -->
|
||||
<Popup
|
||||
x:Name="PART_OverflowPopup"
|
||||
IsOpen="{TemplateBinding IsOpen, Mode=TwoWay}"
|
||||
PlacementTarget="{Binding #PART_OverflowButton}"
|
||||
Placement="Bottom"
|
||||
IsLightDismissEnabled="True"
|
||||
WindowManagerAddShadowHint="False">
|
||||
<Border
|
||||
Background="{DynamicResource CommandBarOverflowBackground}"
|
||||
BorderBrush="{DynamicResource CommandBarOverflowBorderBrush}"
|
||||
BorderThickness="{DynamicResource CommandBarBorderThickness}"
|
||||
BoxShadow="{DynamicResource CommandBarOverflowBoxShadow}"
|
||||
CornerRadius="{DynamicResource CommandBarOverflowCornerRadius}"
|
||||
Padding="{DynamicResource CommandBarOverflowPadding}"
|
||||
MinWidth="{DynamicResource CommandBarOverflowMinWidth}">
|
||||
<ItemsControl
|
||||
ItemsSource="{Binding OverflowItems, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Spacing="2" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Panel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- Overflow button inner theme (borderless, transparent) -->
|
||||
<ControlTheme x:Key="AppBarOverflowButton" TargetType="Button"
|
||||
BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Padding" Value="{DynamicResource AppBarButtonPadding}" />
|
||||
<Setter Property="MinWidth" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource AppBarButtonCornerRadius}" />
|
||||
</ControlTheme>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -12,6 +12,7 @@
|
||||
<ResourceInclude Source="Carousel.axaml" />
|
||||
<ResourceInclude Source="CheckBox.axaml" />
|
||||
<ResourceInclude Source="ComboBox.axaml" />
|
||||
<ResourceInclude Source="CommandBar.axaml" />
|
||||
<ResourceInclude Source="ContextMenu.axaml" />
|
||||
<ResourceInclude Source="DataValidationErrors.axaml" />
|
||||
<ResourceInclude Source="DatePicker.axaml" />
|
||||
|
||||
22
src/Semi.Avalonia/Themes/Dark/CommandBar.axaml
Normal file
22
src/Semi.Avalonia/Themes/Dark/CommandBar.axaml
Normal file
@@ -0,0 +1,22 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- AppBarButton / AppBarToggleButton -->
|
||||
<SolidColorBrush x:Key="AppBarButtonBackground" Color="Transparent" />
|
||||
<StaticResource x:Key="AppBarButtonForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="AppBarButtonPointeroverBackground" ResourceKey="SemiColorFill0" />
|
||||
<StaticResource x:Key="AppBarButtonPressedBackground" ResourceKey="SemiColorFill1" />
|
||||
<StaticResource x:Key="AppBarButtonDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||
<!-- AppBarToggleButton checked state -->
|
||||
<StaticResource x:Key="AppBarToggleButtonCheckedForeground" ResourceKey="SemiColorPrimary" />
|
||||
<StaticResource x:Key="AppBarToggleButtonCheckedBackground" ResourceKey="SemiColorPrimaryLight" />
|
||||
<StaticResource x:Key="AppBarToggleButtonCheckedPointeroverBackground" ResourceKey="SemiColorPrimaryLightPointerover" />
|
||||
<!-- AppBarSeparator -->
|
||||
<StaticResource x:Key="AppBarSeparatorBackground" ResourceKey="SemiColorBorder" />
|
||||
<!-- CommandBar -->
|
||||
<StaticResource x:Key="CommandBarBackground" ResourceKey="SemiColorBackground1" />
|
||||
<StaticResource x:Key="CommandBarForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="CommandBarBorderBrush" ResourceKey="SemiColorBorder" />
|
||||
<!-- CommandBar overflow popup -->
|
||||
<StaticResource x:Key="CommandBarOverflowBackground" ResourceKey="SemiColorBackground3" />
|
||||
<StaticResource x:Key="CommandBarOverflowBorderBrush" ResourceKey="SemiColorBorder" />
|
||||
<StaticResource x:Key="CommandBarOverflowBoxShadow" ResourceKey="SemiShadowElevated" />
|
||||
</ResourceDictionary>
|
||||
@@ -11,6 +11,7 @@
|
||||
<ResourceInclude Source="Carousel.axaml" />
|
||||
<ResourceInclude Source="CheckBox.axaml" />
|
||||
<ResourceInclude Source="ComboBox.axaml" />
|
||||
<ResourceInclude Source="CommandBar.axaml" />
|
||||
<ResourceInclude Source="DataValidationErrors.axaml" />
|
||||
<ResourceInclude Source="DatePicker.axaml" />
|
||||
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
||||
|
||||
21
src/Semi.Avalonia/Themes/HighContrast/CommandBar.axaml
Normal file
21
src/Semi.Avalonia/Themes/HighContrast/CommandBar.axaml
Normal file
@@ -0,0 +1,21 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- AppBarButton / AppBarToggleButton -->
|
||||
<SolidColorBrush x:Key="AppBarButtonBackground" Color="Transparent" />
|
||||
<StaticResource x:Key="AppBarButtonForeground" ResourceKey="SemiColorWindowText" />
|
||||
<StaticResource x:Key="AppBarButtonPointeroverBackground" ResourceKey="SemiColorHighlight" />
|
||||
<StaticResource x:Key="AppBarButtonPressedBackground" ResourceKey="SemiColorHighlight" />
|
||||
<StaticResource x:Key="AppBarButtonDisabledForeground" ResourceKey="SemiColorGrayText" />
|
||||
<!-- AppBarToggleButton checked state -->
|
||||
<StaticResource x:Key="AppBarToggleButtonCheckedForeground" ResourceKey="SemiColorHighlightText" />
|
||||
<StaticResource x:Key="AppBarToggleButtonCheckedBackground" ResourceKey="SemiColorHighlight" />
|
||||
<StaticResource x:Key="AppBarToggleButtonCheckedPointeroverBackground" ResourceKey="SemiColorButtonText" />
|
||||
<!-- AppBarSeparator -->
|
||||
<StaticResource x:Key="AppBarSeparatorBackground" ResourceKey="SemiColorWindowText" />
|
||||
<!-- CommandBar -->
|
||||
<StaticResource x:Key="CommandBarBackground" ResourceKey="SemiColorWindow" />
|
||||
<StaticResource x:Key="CommandBarForeground" ResourceKey="SemiColorWindowText" />
|
||||
<StaticResource x:Key="CommandBarBorderBrush" ResourceKey="SemiColorWindowText" />
|
||||
<!-- CommandBar overflow popup -->
|
||||
<StaticResource x:Key="CommandBarOverflowBackground" ResourceKey="SemiColorWindow" />
|
||||
<StaticResource x:Key="CommandBarOverflowBorderBrush" ResourceKey="SemiColorWindowText" />
|
||||
</ResourceDictionary>
|
||||
@@ -11,6 +11,7 @@
|
||||
<ResourceInclude Source="Carousel.axaml" />
|
||||
<ResourceInclude Source="CheckBox.axaml" />
|
||||
<ResourceInclude Source="ComboBox.axaml" />
|
||||
<ResourceInclude Source="CommandBar.axaml" />
|
||||
<ResourceInclude Source="DataValidationErrors.axaml" />
|
||||
<ResourceInclude Source="DatePicker.axaml" />
|
||||
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
||||
|
||||
22
src/Semi.Avalonia/Themes/Light/CommandBar.axaml
Normal file
22
src/Semi.Avalonia/Themes/Light/CommandBar.axaml
Normal file
@@ -0,0 +1,22 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- AppBarButton / AppBarToggleButton -->
|
||||
<SolidColorBrush x:Key="AppBarButtonBackground" Color="Transparent" />
|
||||
<StaticResource x:Key="AppBarButtonForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="AppBarButtonPointeroverBackground" ResourceKey="SemiColorFill0" />
|
||||
<StaticResource x:Key="AppBarButtonPressedBackground" ResourceKey="SemiColorFill1" />
|
||||
<StaticResource x:Key="AppBarButtonDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||
<!-- AppBarToggleButton checked state -->
|
||||
<StaticResource x:Key="AppBarToggleButtonCheckedForeground" ResourceKey="SemiColorPrimary" />
|
||||
<StaticResource x:Key="AppBarToggleButtonCheckedBackground" ResourceKey="SemiColorPrimaryLight" />
|
||||
<StaticResource x:Key="AppBarToggleButtonCheckedPointeroverBackground" ResourceKey="SemiColorPrimaryLightPointerover" />
|
||||
<!-- AppBarSeparator -->
|
||||
<StaticResource x:Key="AppBarSeparatorBackground" ResourceKey="SemiColorBorder" />
|
||||
<!-- CommandBar -->
|
||||
<StaticResource x:Key="CommandBarBackground" ResourceKey="SemiColorBackground1" />
|
||||
<StaticResource x:Key="CommandBarForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="CommandBarBorderBrush" ResourceKey="SemiColorBorder" />
|
||||
<!-- CommandBar overflow popup -->
|
||||
<StaticResource x:Key="CommandBarOverflowBackground" ResourceKey="SemiColorBackground3" />
|
||||
<StaticResource x:Key="CommandBarOverflowBorderBrush" ResourceKey="SemiColorBorder" />
|
||||
<StaticResource x:Key="CommandBarOverflowBoxShadow" ResourceKey="SemiShadowElevated" />
|
||||
</ResourceDictionary>
|
||||
@@ -11,6 +11,7 @@
|
||||
<ResourceInclude Source="Carousel.axaml" />
|
||||
<ResourceInclude Source="CheckBox.axaml" />
|
||||
<ResourceInclude Source="ComboBox.axaml" />
|
||||
<ResourceInclude Source="CommandBar.axaml" />
|
||||
<ResourceInclude Source="DataValidationErrors.axaml" />
|
||||
<ResourceInclude Source="DatePicker.axaml" />
|
||||
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
||||
|
||||
29
src/Semi.Avalonia/Themes/Shared/CommandBar.axaml
Normal file
29
src/Semi.Avalonia/Themes/Shared/CommandBar.axaml
Normal file
@@ -0,0 +1,29 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- AppBarButton / AppBarToggleButton -->
|
||||
<x:Double x:Key="AppBarButtonWidth">68</x:Double>
|
||||
<x:Double x:Key="AppBarButtonCompactWidth">40</x:Double>
|
||||
<x:Double x:Key="AppBarButtonMinHeight">40</x:Double>
|
||||
<x:Double x:Key="AppBarButtonIconSize">20</x:Double>
|
||||
<Thickness x:Key="AppBarButtonPadding">8 4</Thickness>
|
||||
<StaticResource x:Key="AppBarButtonCornerRadius" ResourceKey="SemiBorderRadiusSmall" />
|
||||
<StaticResource x:Key="AppBarButtonLabelFontSize" ResourceKey="SemiFontSizeSmall" />
|
||||
<x:Double x:Key="AppBarButtonOverflowMinHeight">36</x:Double>
|
||||
<Thickness x:Key="AppBarButtonOverflowPadding">12 6</Thickness>
|
||||
<!-- AppBarSeparator -->
|
||||
<x:Double x:Key="AppBarSeparatorWidth">1</x:Double>
|
||||
<x:Double x:Key="AppBarSeparatorMinHeight">24</x:Double>
|
||||
<Thickness x:Key="AppBarSeparatorMargin">8 4</Thickness>
|
||||
<x:Double x:Key="AppBarSeparatorOverflowHeight">1</x:Double>
|
||||
<Thickness x:Key="AppBarSeparatorOverflowMargin">4 4</Thickness>
|
||||
<!-- CommandBar -->
|
||||
<x:Double x:Key="CommandBarMinHeight">48</x:Double>
|
||||
<Thickness x:Key="CommandBarPadding">4 0</Thickness>
|
||||
<StaticResource x:Key="CommandBarCornerRadius" ResourceKey="SemiBorderRadiusMedium" />
|
||||
<StaticResource x:Key="CommandBarBorderThickness" ResourceKey="SemiBorderThicknessControl" />
|
||||
<!-- CommandBar overflow popup -->
|
||||
<StaticResource x:Key="CommandBarOverflowCornerRadius" ResourceKey="SemiBorderRadiusMedium" />
|
||||
<Thickness x:Key="CommandBarOverflowPadding">0 4</Thickness>
|
||||
<x:Double x:Key="CommandBarOverflowMinWidth">160</x:Double>
|
||||
<!-- Overflow button glyph -->
|
||||
<StaticResource x:Key="CommandBarOverflowButtonGlyph" ResourceKey="SemiIconMore" />
|
||||
</ResourceDictionary>
|
||||
@@ -11,6 +11,7 @@
|
||||
<ResourceInclude Source="Carousel.axaml" />
|
||||
<ResourceInclude Source="CheckBox.axaml" />
|
||||
<ResourceInclude Source="ComboBox.axaml" />
|
||||
<ResourceInclude Source="CommandBar.axaml" />
|
||||
<ResourceInclude Source="DataValidationErrors.axaml" />
|
||||
<ResourceInclude Source="DatePicker.axaml" />
|
||||
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
||||
|
||||
Reference in New Issue
Block a user