feat: update button themes.
This commit is contained in:
parent
94b30bdb29
commit
cd09457710
@ -1,7 +1,8 @@
|
||||
<Application xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="Semi.Avalonia.Demo.App">
|
||||
<Application
|
||||
x:Class="Semi.Avalonia.Demo.App"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Semi.Avalonia/Themes/LightTheme.axaml"></StyleInclude>
|
||||
<StyleInclude Source="avares://Semi.Avalonia/Themes/LightTheme.axaml" />
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
|
@ -1,10 +1,20 @@
|
||||
<Window 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"
|
||||
xmlns:pages="using:Semi.Avalonia.Demo.Pages"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Semi.Avalonia.Demo.MainWindow"
|
||||
Title="Semi.Demo">
|
||||
<pages:ButtonDemo></pages:ButtonDemo>
|
||||
<Window
|
||||
Title="Semi.Demo"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d"
|
||||
x:Class="Semi.Avalonia.Demo.MainWindow"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pages="using:Semi.Avalonia.Demo.Pages"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<TabControl TabStripPlacement="Left">
|
||||
<TabItem Header="Button">
|
||||
<pages:ButtonDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="CheckBox">
|
||||
<pages:CheckBoxDemo />
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Window>
|
||||
|
@ -1,14 +1,32 @@
|
||||
<UserControl 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"
|
||||
mc:Ignorable="d" d:DesignWidth="800"
|
||||
d:DesignHeight="450"
|
||||
x:Class="Semi.Avalonia.Demo.Pages.ButtonDemo">
|
||||
<StackPanel Spacing="20" Margin="20" HorizontalAlignment="Left">
|
||||
<Button>Primary</Button>
|
||||
<Button Classes="Large">Primary</Button>
|
||||
<Button Classes="Small">Primary</Button>
|
||||
<Button Classes="Primary">Secondary</Button>
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.ButtonDemo" 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="450" d:DesignWidth="800" mc:Ignorable="d">
|
||||
<StackPanel Margin="20" HorizontalAlignment="Left" Spacing="20">
|
||||
<TextBlock>Light (Default)</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary">Primary</Button>
|
||||
<Button Classes="Secondary">Secondary</Button>
|
||||
<Button Classes="Tertiary">Tertiary</Button>
|
||||
<Button Classes="Warning">Warning</Button>
|
||||
<Button Classes="Danger">Danger</Button>
|
||||
<Button Classes="Primary" IsEnabled="False">Danger</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Solid</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary" Theme="{DynamicResource SolidButton}">Primary</Button>
|
||||
<Button Classes="Secondary" Theme="{DynamicResource SolidButton}">Secondary</Button>
|
||||
<Button Classes="Tertiary" Theme="{DynamicResource SolidButton}">Tertiary</Button>
|
||||
<Button Classes="Warning" Theme="{DynamicResource SolidButton}">Warning</Button>
|
||||
<Button Classes="Danger" Theme="{DynamicResource SolidButton}">Danger</Button>
|
||||
<Button Classes="Primary" IsEnabled="False" Theme="{DynamicResource SolidButton}">Danger</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Borderless</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary" Theme="{DynamicResource BorderlessButton}">Primary</Button>
|
||||
<Button Classes="Secondary" Theme="{DynamicResource BorderlessButton}">Secondary</Button>
|
||||
<Button Classes="Tertiary" Theme="{DynamicResource BorderlessButton}">Tertiary</Button>
|
||||
<Button Classes="Warning" Theme="{DynamicResource BorderlessButton}">Warning</Button>
|
||||
<Button Classes="Danger" Theme="{DynamicResource BorderlessButton}">Danger</Button>
|
||||
<Button Classes="Primary" IsEnabled="False" Theme="{DynamicResource BorderlessButton}">Danger</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
24
src/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml
Normal file
24
src/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml
Normal file
@ -0,0 +1,24 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.CheckBoxDemo"
|
||||
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="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel Margin="48" HorizontalAlignment="Left">
|
||||
<CheckBox>Unchecked</CheckBox>
|
||||
<CheckBox IsEnabled="False">Unchecked</CheckBox>
|
||||
<CheckBox IsChecked="True">Checked</CheckBox>
|
||||
<CheckBox IsChecked="True" IsEnabled="False">Checked</CheckBox>
|
||||
<CheckBox IsChecked="{x:Null}" IsThreeState="True">Indeterminate</CheckBox>
|
||||
<CheckBox
|
||||
IsChecked="{x:Null}"
|
||||
IsEnabled="False"
|
||||
IsThreeState="True">
|
||||
Indeterminate
|
||||
</CheckBox>
|
||||
<CheckBox Width="120">Checkbox should wrap its text</CheckBox>
|
||||
</StackPanel>
|
||||
</UserControl>
|
18
src/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml.cs
Normal file
18
src/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class CheckBoxDemo : UserControl
|
||||
{
|
||||
public CheckBoxDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
@ -16,6 +16,7 @@ namespace Semi.Avalonia.Demo
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
=> AppBuilder.Configure<App>()
|
||||
.UsePlatformDetect()
|
||||
.With(new Win32PlatformOptions(){ UseCompositor = false})
|
||||
.LogToTrace();
|
||||
}
|
||||
}
|
@ -18,11 +18,11 @@
|
||||
<TrimmableAssembly Include="Avalonia.Themes.Default" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="11.0.0-preview3" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview3" />
|
||||
<PackageReference Include="Avalonia" Version="11.0.0-preview4" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview4" />
|
||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview3" />
|
||||
<PackageReference Include="XamlNameReferenceGenerator" Version="1.3.4" />
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview4" />
|
||||
<PackageReference Include="XamlNameReferenceGenerator" Version="1.4.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia\Semi.Avalonia.csproj" />
|
||||
|
@ -1,54 +1,66 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Button Theme Key: Solid Light Borderless; Default is Light -->
|
||||
<!-- Button Default Classes: Primary Secondary, Tertiary, Warning, Danger; Default is Primary -->
|
||||
<!-- State: default pointerover pressed disabled -->
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Button Theme Key: Solid Light Border Borderless; Default is Light -->
|
||||
<!-- Button Default Classes: Primary Secondary, Tertiary, Warning, Danger; Default is Primary -->
|
||||
<!-- State: default pointerover pressed disabled -->
|
||||
|
||||
<!-- Button Light -->
|
||||
<ControlTheme x:Key="{x:Type Button}" TargetType="Button">
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonDefaultBackground}"/>
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonDefaultForeground}"/>
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}"/>
|
||||
<Setter Property="Button.CornerRadius" Value="3"/>
|
||||
<Setter Property="Button.BorderThickness" Value="1"/>
|
||||
<Setter Property="Button.Padding" Value="{DynamicResource ButtonDefaultPadding}"/>
|
||||
<Setter Property="Button.RenderTransform" Value="none"/>
|
||||
<Setter Property="Button.FontSize" Value="{DynamicResource ButtonDefaultFontSize}"></Setter>
|
||||
<Setter Property="Button.FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}"></Setter>
|
||||
<Setter Property="Button.HorizontalContentAlignment" Value="Center"></Setter>
|
||||
<Setter Property="Button.VerticalContentAlignment" Value="Center"></Setter>
|
||||
<Setter Property="Button.MinHeight" Value="12"></Setter>
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonDefaultBackground}" />
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
|
||||
<Setter Property="Button.CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
|
||||
<Setter Property="Button.BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
|
||||
<Setter Property="Button.Padding" Value="{DynamicResource ButtonDefaultPadding}" />
|
||||
<Setter Property="Button.RenderTransform" Value="none" />
|
||||
<Setter Property="Button.FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
|
||||
<Setter Property="Button.FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
|
||||
<Setter Property="Button.HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="Button.VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Button.MinHeight" Value="12" />
|
||||
<Setter Property="Button.Template">
|
||||
<ControlTemplate TargetType="Button">
|
||||
<ContentPresenter
|
||||
x:Name="PART_ContentPresenter"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
TextElement.FontWeight="{TemplateBinding FontWeight}"
|
||||
TextElement.FontSize="{TemplateBinding FontSize}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
RecognizesAccessKey="True"
|
||||
UseLayoutRounding="False"
|
||||
>
|
||||
|
||||
</ContentPresenter>
|
||||
TextElement.FontSize="{TemplateBinding FontSize}"
|
||||
TextElement.FontWeight="{TemplateBinding FontWeight}"
|
||||
UseLayoutRounding="False" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^.Primary">
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Secondary">
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonDefaultSecondaryForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Tertiary">
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Warning">
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonDefaultWarningForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Danger">
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonDefaultPointerOverBorderBrush}" />
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonDefaultPointerOverBackground}" />
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonDefaultPointerOverForeground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonDefaultPressedForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
@ -58,13 +70,99 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.Large">
|
||||
<Setter Property="Button.Padding" Value="{DynamicResource ButtonLargePadding}"></Setter>
|
||||
<Setter Property="Button.Padding" Value="{DynamicResource ButtonLargePadding}" />
|
||||
</Style>
|
||||
<Style Selector="^.Small">
|
||||
<Setter Property="Button.Padding" Value="{DynamicResource ButtonSmallPadding}"></Setter>
|
||||
<Setter Property="Button.Padding" Value="{DynamicResource ButtonSmallPadding}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="LightButtonTheme" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}"/>
|
||||
<ControlTheme x:Key="SolidButton" BasedOn="{StaticResource {x:Type Button}}" TargetType="Button">
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
|
||||
|
||||
<Style Selector="^.Primary">
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.Secondary">
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidSecondaryPointeroverBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidSecondaryPressedBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPressedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.Tertiary">
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidTertiaryPointeroverBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidTertiaryPressedBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPressedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.Warning">
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidWarningPointeroverBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidWarningPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidWarningPressedBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidWarningPressedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.Danger">
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidDangerBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidDangerPointeroverBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidDangerPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidDangerPressedBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidDangerPressedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="BorderlessButton" BasedOn="{StaticResource {x:Type Button}}" TargetType="Button">
|
||||
<Setter Property="Button.Background" Value="Transparent" />
|
||||
<Setter Property="Button.BorderBrush" Value="Transparent" />
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="Button.BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Button.Background" Value="Transparent" />
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
|
184
src/Semi.Avalonia/Controls/CheckBox.axaml
Normal file
184
src/Semi.Avalonia/Controls/CheckBox.axaml
Normal file
@ -0,0 +1,184 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme TargetType="CheckBox" x:Key="{x:Type CheckBox}">
|
||||
<Setter Property="Padding" Value="8,0,0,0" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="FontSize" Value="{DynamicResource FontCheckboxFontSize}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource CornerRadiusCheckboxBox}" />
|
||||
<Setter Property="MinHeight" Value="32" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ColorCheckboxForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ColorCheckboxDefaultBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ColorCheckboxDefaultBorderBrush}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="CheckBox">
|
||||
<Grid ColumnDefinitions="Auto,*" x:Name="RootGrid">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Grid.ColumnSpan="2"
|
||||
x:Name="PART_Border" />
|
||||
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
Margin="0,2,0,0"
|
||||
VerticalAlignment="Top">
|
||||
<Border
|
||||
Background="{DynamicResource ColorCheckboxDefaultBackground}"
|
||||
BorderBrush="{DynamicResource ColorCheckboxDefaultBorderBrush}"
|
||||
BorderThickness="{DynamicResource ThicknessCheckboxBoxBorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Height="{DynamicResource SizeCheckboxBoxHeight}"
|
||||
UseLayoutRounding="False"
|
||||
Width="{DynamicResource SizeCheckboxBoxWidth}"
|
||||
x:Name="NormalRectangle" />
|
||||
|
||||
<Viewbox Height="{DynamicResource SizeCheckboxBoxWidth}" UseLayoutRounding="False">
|
||||
<Panel>
|
||||
<Panel Height="{DynamicResource SizeCheckboxBoxWidth}" Width="{DynamicResource SizeCheckboxBoxWidth}" />
|
||||
<Path
|
||||
Fill="{DynamicResource ColorCheckboxGlyphFill}"
|
||||
Opacity="0"
|
||||
Stretch="Uniform"
|
||||
VerticalAlignment="Center"
|
||||
x:Name="CheckGlyph" />
|
||||
</Panel>
|
||||
</Viewbox>
|
||||
</Grid>
|
||||
<ContentPresenter
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
RecognizesAccessKey="True"
|
||||
TextWrapping="Wrap"
|
||||
VerticalAlignment="Top"
|
||||
x:Name="ContentPresenter" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- Unchecked PointerOver State -->
|
||||
<Style Selector="^:pointerover">
|
||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ColorCheckboxPointOverBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ColorCheckboxPointOverBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Unchecked Pressed State -->
|
||||
<Style Selector="^:pressed">
|
||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ColorCheckboxPressedBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ColorCheckboxPressedBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Unchecked Disabled state -->
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ ContentPresenter#ContentPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ColorCheckboxDisabledForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ColorCheckboxDefaultDisabledBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ColorCheckboxDefaultDisabledBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:checked">
|
||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ColorCheckboxCheckedDefaultBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ColorCheckboxCheckedDefaultBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Path#CheckGlyph">
|
||||
<Setter Property="Fill" Value="{DynamicResource ColorCheckboxGlyphFill}" />
|
||||
<Setter Property="Data" Value="M1507 31L438 1101L-119 543L-29 453L438 919L1417 -59L1507 31Z" />
|
||||
<Setter Property="Width" Value="9" />
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
<Setter Property="FlowDirection" Value="LeftToRight" />
|
||||
</Style>
|
||||
|
||||
<!-- Checked PointerOver State -->
|
||||
<Style Selector="^:pointerover">
|
||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ColorCheckboxCheckedPointOverBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ColorCheckboxCheckedPointOverBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Checked Pressed State -->
|
||||
<Style Selector="^:pressed">
|
||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ColorCheckboxCheckedPressedBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ColorCheckboxCheckedPressedBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Checked Disabled State -->
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ ContentPresenter#ContentPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ColorCheckboxDisabledForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ColorCheckboxCheckedDisabledBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ColorCheckboxCheckedDisabledBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Path#CheckGlyph">
|
||||
<Setter Property="Fill" Value="{DynamicResource ColorCheckboxGlyphDisabledFill}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:indeterminate">
|
||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ColorCheckboxCheckedDefaultBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ColorCheckboxCheckedDefaultBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Path#CheckGlyph">
|
||||
<Setter Property="Fill" Value="{DynamicResource ColorCheckboxGlyphFill}" />
|
||||
<Setter Property="Data" Value="M1536 1536v-0h-1024v128h1024z" />
|
||||
<Setter Property="Width" Value="9" />
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
<Setter Property="FlowDirection" Value="LeftToRight" />
|
||||
</Style>
|
||||
|
||||
<!-- Checked PointerOver State -->
|
||||
<Style Selector="^:pointerover">
|
||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ColorCheckboxCheckedPointOverBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ColorCheckboxCheckedPointOverBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Checked Pressed State -->
|
||||
<Style Selector="^:pressed">
|
||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ColorCheckboxCheckedPressedBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ColorCheckboxCheckedPressedBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Checked Disabled State -->
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ ContentPresenter#ContentPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ColorCheckboxDisabledForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ColorCheckboxCheckedDisabledBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ColorCheckboxCheckedDisabledBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Path#CheckGlyph">
|
||||
<Setter Property="Fill" Value="{DynamicResource ColorCheckboxGlyphDisabledFill}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
@ -1,9 +1,11 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Button.axaml"/>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/UserControl.axaml"/>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Window.axaml"/>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Button.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/CheckBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/TabControl.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/TabItem.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/UserControl.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Window.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
45
src/Semi.Avalonia/Controls/TabControl.axaml
Normal file
45
src/Semi.Avalonia/Controls/TabControl.axaml
Normal file
@ -0,0 +1,45 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme TargetType="TabControl" x:Key="{x:Type TabControl}">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Padding" Value="{DynamicResource TabItemMargin}" />
|
||||
<Setter Property="Background" Value="{DynamicResource TabControlBackground}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="TabControl">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}">
|
||||
<DockPanel>
|
||||
<ItemsPresenter
|
||||
DockPanel.Dock="{TemplateBinding TabStripPlacement}"
|
||||
ItemTemplate="{TemplateBinding ItemTemplate}"
|
||||
Items="{TemplateBinding Items}"
|
||||
ItemsPanel="{TemplateBinding ItemsPanel}"
|
||||
Name="PART_ItemsPresenter" />
|
||||
<ContentPresenter
|
||||
Content="{TemplateBinding SelectedContent}"
|
||||
ContentTemplate="{TemplateBinding SelectedContentTemplate}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
Name="PART_SelectedContentHost"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^[TabStripPlacement=Left] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel">
|
||||
<Setter Property="Orientation" Value="Vertical" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Right] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel">
|
||||
<Setter Property="Orientation" Value="Vertical" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Top] /template/ ItemsPresenter#PART_ItemsPresenter">
|
||||
<Setter Property="Margin" Value="{DynamicResource TabControlTopPlacementItemMargin}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
114
src/Semi.Avalonia/Controls/TabItem.axaml
Normal file
114
src/Semi.Avalonia/Controls/TabItem.axaml
Normal file
@ -0,0 +1,114 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Theme: Card, Strip default is Strip -->
|
||||
<ControlTheme x:Key="{x:Type TabItem}" TargetType="TabItem">
|
||||
<Setter Property="FontSize" Value="{DynamicResource TabItemHeaderFontSize}" />
|
||||
<Setter Property="FontWeight" Value="{DynamicResource TabItemHeaderThemeFontWeight}" />
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundUnselected}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselected}" />
|
||||
<Setter Property="Padding" Value="8" />
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="MinHeight" Value="5" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="TabItem">
|
||||
<Border
|
||||
Name="PART_LayoutRoot"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Panel>
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}" />
|
||||
<Border
|
||||
Name="PART_SelectedPipe"
|
||||
Background="{DynamicResource TabItemHeaderSelectedPipeFill}"
|
||||
CornerRadius="{DynamicResource ControlCornerRadius}"
|
||||
IsVisible="False" />
|
||||
</Panel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- Selected state -->
|
||||
<!-- We don't use selector to PART_LayoutRoot, so developer can override selected item background with TabStripItem.Background -->
|
||||
<Style Selector="^:selected">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelected}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabItemHeaderForegroundSelected}" />
|
||||
</Style>
|
||||
<Style Selector="^:selected /template/ Border#PART_SelectedPipe">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
|
||||
<!-- PointerOver state -->
|
||||
<Style Selector="^:pointerover /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundUnselectedPointerOver}" />
|
||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPointerOver}" />
|
||||
</Style>
|
||||
|
||||
<!-- Selected PointerOver state -->
|
||||
<Style Selector="^:selected:pointerover /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelectedPointerOver}" />
|
||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundSelectedPointerOver}" />
|
||||
</Style>
|
||||
|
||||
<!-- Pressed state -->
|
||||
<Style Selector="^:pressed /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundUnselectedPressed}" />
|
||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPressed}" />
|
||||
</Style>
|
||||
|
||||
<!-- Selected Pressed state -->
|
||||
<Style Selector="^:selected:pressed /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelectedPressed}" />
|
||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundSelectedPressed}" />
|
||||
</Style>
|
||||
|
||||
<!-- Disabled state -->
|
||||
<Style Selector="^:disabled /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundDisabled}" />
|
||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundDisabled}" />
|
||||
</Style>
|
||||
|
||||
<!-- TabStripPlacement States Group -->
|
||||
<Style Selector="^[TabStripPlacement=Left] /template/ Border#PART_SelectedPipe">
|
||||
<Setter Property="Width" Value="{DynamicResource TabItemPipeThickness}" />
|
||||
<Setter Property="Height" Value="{DynamicResource TabItemVerticalPipeHeight}" />
|
||||
<Setter Property="Margin" Value="0,0,2,0" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Left] /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Margin" Value="8,0,0,0" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[TabStripPlacement=Top] /template/ Border#PART_SelectedPipe, ^[TabStripPlacement=Bottom] /template/ Border#PART_SelectedPipe">
|
||||
<Setter Property="Height" Value="{DynamicResource TabItemPipeThickness}" />
|
||||
<Setter Property="Margin" Value="0,0,0,2" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Bottom" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[TabStripPlacement=Right] /template/ Border#PART_SelectedPipe">
|
||||
<Setter Property="Width" Value="{DynamicResource TabItemPipeThickness}" />
|
||||
<Setter Property="Height" Value="{DynamicResource TabItemVerticalPipeHeight}" />
|
||||
<Setter Property="Margin" Value="2,0,0,0" />
|
||||
<Setter Property="HorizontalAlignment" Value="Right" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Right] /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Margin" Value="0,0,8,0" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Right]">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Right" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
@ -6,7 +6,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="11.0.0-preview3" />
|
||||
<PackageReference Include="Avalonia" Version="11.0.0-preview4" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
54
src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
Normal file
54
src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
Normal file
@ -0,0 +1,54 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:sys="clr-namespace:System;assembly=System.Runtime"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<SolidColorBrush Color="#1C1F23" x:Key="ColorCheckboxForeground" />
|
||||
<SolidColorBrush
|
||||
Color="#1C1F23"
|
||||
Opacity="0.35"
|
||||
x:Key="ColorCheckboxDisabledForeground" />
|
||||
|
||||
<SolidColorBrush Color="White" x:Key="ColorCheckboxGlyphFill" />
|
||||
<SolidColorBrush Color="White" x:Key="ColorCheckboxGlyphDisabledFill" />
|
||||
|
||||
<SolidColorBrush Color="Transparent" x:Key="ColorCheckboxDefaultBackground" />
|
||||
<SolidColorBrush
|
||||
Color="#1C1F23"
|
||||
Opacity="0.35"
|
||||
x:Key="ColorCheckboxDefaultBorderBrush" />
|
||||
<SolidColorBrush
|
||||
Color="#2E3238"
|
||||
Opacity="0.05"
|
||||
x:Key="ColorCheckboxPointOverBackground" />
|
||||
<SolidColorBrush Color="#0077FA" x:Key="ColorCheckboxPointOverBorderBrush" />
|
||||
<SolidColorBrush Color="#004FB3" x:Key="ColorCheckboxPressedBackground" />
|
||||
<SolidColorBrush Color="#004FB3" x:Key="ColorCheckboxPressedBorderBrush" />
|
||||
|
||||
<SolidColorBrush Color="#0077FA" x:Key="ColorCheckboxCheckedDefaultBackground" />
|
||||
<SolidColorBrush Color="#0077FA" x:Key="ColorCheckboxCheckedDefaultBorderBrush" />
|
||||
<SolidColorBrush Color="#0062D6" x:Key="ColorCheckboxCheckedPointOverBackground" />
|
||||
<SolidColorBrush Color="#0062D6" x:Key="ColorCheckboxCheckedPointOverBorderBrush" />
|
||||
<SolidColorBrush Color="#004FB3" x:Key="ColorCheckboxCheckedPressedBackground" />
|
||||
<SolidColorBrush Color="#004FB3" x:Key="ColorCheckboxCheckedPressedBorderBrush" />
|
||||
|
||||
<SolidColorBrush
|
||||
Color="#2E3238"
|
||||
Opacity="0.04"
|
||||
x:Key="ColorCheckboxDefaultDisabledBackground" />
|
||||
<SolidColorBrush
|
||||
Color="#1C1F23"
|
||||
Opacity="0.08"
|
||||
x:Key="ColorCheckboxDefaultDisabledBorderBrush" />
|
||||
<SolidColorBrush Color="#98CDFD" x:Key="ColorCheckboxCheckedDisabledBackground" />
|
||||
<SolidColorBrush Color="#98CDFD" x:Key="ColorCheckboxCheckedDisabledBorderBrush" />
|
||||
|
||||
<sys:Double x:Key="FontCheckboxFontSize">14</sys:Double>
|
||||
<sys:Double x:Key="SizeCheckboxBoxWidth">16</sys:Double>
|
||||
<sys:Double x:Key="SizeCheckboxBoxHeight">16</sys:Double>
|
||||
<FontWeight x:Key="FontCheckboxFontWeight">400</FontWeight>
|
||||
|
||||
<CornerRadius x:Key="CornerRadiusCheckboxBox">3</CornerRadius>
|
||||
<Thickness x:Key="ThicknessCheckboxContentMargin">8 0 0 0</Thickness>
|
||||
<Thickness x:Key="ThicknessCheckboxBoxBorderThickness">1</Thickness>
|
||||
</ResourceDictionary>
|
@ -1,10 +1,10 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Palette.axaml"/>
|
||||
<!-- Controls -->
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Button.axaml"/>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Window.axaml"/>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Palette.axaml" />
|
||||
<!-- Controls -->
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Button.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/CheckBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Window.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
3
src/Semi.Avalonia/Themes/Dark/TabControl.axaml
Normal file
3
src/Semi.Avalonia/Themes/Dark/TabControl.axaml
Normal file
@ -0,0 +1,3 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
</ResourceDictionary>
|
3
src/Semi.Avalonia/Themes/Dark/TabItem.axaml
Normal file
3
src/Semi.Avalonia/Themes/Dark/TabItem.axaml
Normal file
@ -0,0 +1,3 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
</ResourceDictionary>
|
@ -1,6 +1,4 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=System.Runtime">
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=System.Runtime">
|
||||
|
||||
<sys:Double x:Key="ButtonDefaultFontSize">14</sys:Double>
|
||||
<FontWeight x:Key="ButtonDefaultFontWeight">600</FontWeight>
|
||||
@ -9,17 +7,103 @@
|
||||
<Thickness x:Key="ButtonLargePadding">16 10</Thickness>
|
||||
<Thickness x:Key="ButtonSmallPadding">6 2</Thickness>
|
||||
|
||||
<SolidColorBrush x:Key="ButtonDefaultForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="ButtonDefaultBackground" Color="#0077FA"/>
|
||||
<SolidColorBrush x:Key="ButtonDefaultBorderBrush" Color="#0077FA"/>
|
||||
<SolidColorBrush x:Key="ButtonDefaultPointerOverForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="ButtonDefaultPointerOverBackground" Color="#0062D6"/>
|
||||
<SolidColorBrush x:Key="ButtonDefaultPointerOverBorderBrush" Color="#0062D6"/>
|
||||
<SolidColorBrush x:Key="ButtonDefaultPressedForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="ButtonDefaultPressedBackground" Color="#004FB3"/>
|
||||
<SolidColorBrush x:Key="ButtonDefaultPressedBorderBrush" Color="#004FB3"/>
|
||||
<SolidColorBrush x:Key="ButtonDefaultDisabledForeground" Color="#E6E8EA"/>
|
||||
<SolidColorBrush x:Key="ButtonDefaultDisabledBackground" Color="White"/>
|
||||
<SolidColorBrush x:Key="ButtonDefaultDisabledBorderBrush" Color="#E6E8EA"/>
|
||||
<Thickness x:Key="ButtonBorderThickness">1</Thickness>
|
||||
|
||||
<CornerRadius x:Key="ButtonCornerRadius">3</CornerRadius>
|
||||
|
||||
<!-- Light -->
|
||||
<SolidColorBrush x:Key="ButtonDefaultPrimaryForeground" Color="#0077FA" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultSecondaryForeground" Color="#0095EE" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultTertiaryForeground" Color="#6B7075" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultWarningForeground" Color="#FC8800" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultDangerForeground" Color="#F93920" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultDisabledForeground" Color="#E6E8EA" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonDefaultBackground" Opacity="0.05" Color="#2E3238" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultPointeroverBackground" Opacity="0.09" Color="#2E3238" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultPressedBackground" Opacity="0.13" Color="#2E3238" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultDisabledBackground" Opacity="0.05" Color="#2E3238" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonDefaultBorderBrush" Opacity="0.05" Color="#2E3238" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultPointeroverBorderBrush" Opacity="0.09" Color="#2E3238" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultPressedBorderBrush" Opacity="0.13" Color="#2E3238" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultDisabledBorderBrush" Opacity="0.05" Color="#2E3238" />
|
||||
|
||||
<!-- end Light -->
|
||||
|
||||
<!-- Solid -->
|
||||
<SolidColorBrush x:Key="ButtonSolidForeground" Color="White" />
|
||||
<SolidColorBrush x:Key="ButtonSolidDisabledForeground" Color="Gray" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidPrimaryBackground" Color="#0077FA" />
|
||||
<SolidColorBrush x:Key="ButtonSolidPrimaryPointeroverBackground" Color="#0062D6" />
|
||||
<SolidColorBrush x:Key="ButtonSolidPrimaryPressedBackground" Color="#004FB3" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidSecondaryBackground" Color="#0095EE" />
|
||||
<SolidColorBrush x:Key="ButtonSolidSecondaryPointeroverBackground" Color="#007BCA" />
|
||||
<SolidColorBrush x:Key="ButtonSolidSecondaryPressedBackground" Color="#0063A7" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidTertiaryBackground" Color="#6B7075" />
|
||||
<SolidColorBrush x:Key="ButtonSolidTertiaryPointeroverBackground" Color="#555B61" />
|
||||
<SolidColorBrush x:Key="ButtonSolidTertiaryPressedBackground" Color="#41464C" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidWarningBackground" Color="#FC8800" />
|
||||
<SolidColorBrush x:Key="ButtonSolidWarningPointeroverBackground" Color="#D26700" />
|
||||
<SolidColorBrush x:Key="ButtonSolidWarningPressedBackground" Color="#A84A00" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidDangerBackground" Color="#F93920" />
|
||||
<SolidColorBrush x:Key="ButtonSolidDangerPointeroverBackground" Color="#D52515" />
|
||||
<SolidColorBrush x:Key="ButtonSolidDangerPressedBackground" Color="#B2140C" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidDisabledBackground" Color="Gray" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidPrimaryBorderBrush" Color="#0077FA" />
|
||||
<SolidColorBrush x:Key="ButtonSolidPrimaryPointeroverBorderBrush" Color="#0062D6" />
|
||||
<SolidColorBrush x:Key="ButtonSolidPrimaryPressedBorderBrush" Color="#004FB3" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidSecondaryBorderBrush" Color="#0095EE" />
|
||||
<SolidColorBrush x:Key="ButtonSolidSecondaryPointeroverBorderBrush" Color="#007BCA" />
|
||||
<SolidColorBrush x:Key="ButtonSolidSecondaryPressedBorderBrush" Color="#0063A7" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidTertiaryBorderBrush" Color="#6B7075" />
|
||||
<SolidColorBrush x:Key="ButtonSolidTertiaryPointeroverBorderBrush" Color="#555B61" />
|
||||
<SolidColorBrush x:Key="ButtonSolidTertiaryPressedBorderBrush" Color="#41464C" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidWarningBorderBrush" Color="#FC8800" />
|
||||
<SolidColorBrush x:Key="ButtonSolidWarningPointeroverBorderBrush" Color="#D26700" />
|
||||
<SolidColorBrush x:Key="ButtonSolidWarningPressedBorderBrush" Color="#A84A00" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidDangerBorderBrush" Color="#F93920" />
|
||||
<SolidColorBrush x:Key="ButtonSolidDangerPointeroverBorderBrush" Color="#D52515" />
|
||||
<SolidColorBrush x:Key="ButtonSolidDangerPressedBorderBrush" Color="#B2140C" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidDisabledBorderBrush" Color="Gray" />
|
||||
<!-- end Solid -->
|
||||
|
||||
<!--
|
||||
<SolidColorBrush x:Key="ButtonDefaultForeground" Color="White" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultBackground" Color="#0077FA" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultBorderBrush" Color="#0077FA" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultPointerOverForeground" Color="White" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultPointerOverBackground" Color="#0062D6" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultPointerOverBorderBrush" Color="#0062D6" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultPressedForeground" Color="White" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultPressedBackground" Color="#004FB3" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultPressedBorderBrush" Color="#004FB3" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultDisabledForeground" Color="#E6E8EA" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultDisabledBackground" Color="White" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultDisabledBorderBrush" Color="#E6E8EA" />
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidForeground" Color="White" />
|
||||
<SolidColorBrush x:Key="ButtonSolidBackground" Color="#0077FA" />
|
||||
<SolidColorBrush x:Key="ButtonSolidBorderBrush" Color="#0077FA" />
|
||||
<SolidColorBrush x:Key="ButtonSolidPointerOverForeground" Color="White" />
|
||||
<SolidColorBrush x:Key="ButtonSolidPointerOverBackground" Color="#0062D6" />
|
||||
<SolidColorBrush x:Key="ButtonSolidPointerOverBorderBrush" Color="#0062D6" />
|
||||
<SolidColorBrush x:Key="ButtonSolidPressedForeground" Color="White" />
|
||||
<SolidColorBrush x:Key="ButtonSolidPressedBackground" Color="#004FB3" />
|
||||
<SolidColorBrush x:Key="ButtonSolidPressedBorderBrush" Color="#004FB3" />
|
||||
<SolidColorBrush x:Key="ButtonSolidDisabledForeground" Color="#E6E8EA" />
|
||||
<SolidColorBrush x:Key="ButtonSolidDisabledBackground" Color="White" />
|
||||
<SolidColorBrush x:Key="ButtonSolidDisabledBorderBrush" Color="#E6E8EA" />-->
|
||||
</ResourceDictionary>
|
||||
|
53
src/Semi.Avalonia/Themes/Light/CheckBox.axaml
Normal file
53
src/Semi.Avalonia/Themes/Light/CheckBox.axaml
Normal file
@ -0,0 +1,53 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:sys="clr-namespace:System;assembly=System.Runtime"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<SolidColorBrush Color="#1C1F23" x:Key="ColorCheckboxForeground" />
|
||||
<SolidColorBrush
|
||||
Color="#1C1F23"
|
||||
Opacity="0.35"
|
||||
x:Key="ColorCheckboxDisabledForeground" />
|
||||
|
||||
<SolidColorBrush Color="White" x:Key="ColorCheckboxGlyphFill" />
|
||||
<SolidColorBrush Color="White" x:Key="ColorCheckboxGlyphDisabledFill" />
|
||||
|
||||
<SolidColorBrush Color="Transparent" x:Key="ColorCheckboxDefaultBackground" />
|
||||
<SolidColorBrush
|
||||
Color="#1C1F23"
|
||||
Opacity="0.35"
|
||||
x:Key="ColorCheckboxDefaultBorderBrush" />
|
||||
<SolidColorBrush
|
||||
Color="#2E3238"
|
||||
Opacity="0.05"
|
||||
x:Key="ColorCheckboxPointOverBackground" />
|
||||
<SolidColorBrush Color="#0077FA" x:Key="ColorCheckboxPointOverBorderBrush" />
|
||||
<SolidColorBrush Color="#004FB3" x:Key="ColorCheckboxPressedBackground" />
|
||||
<SolidColorBrush Color="#004FB3" x:Key="ColorCheckboxPressedBorderBrush" />
|
||||
|
||||
<SolidColorBrush Color="#0077FA" x:Key="ColorCheckboxCheckedDefaultBackground" />
|
||||
<SolidColorBrush Color="#0077FA" x:Key="ColorCheckboxCheckedDefaultBorderBrush" />
|
||||
<SolidColorBrush Color="#0062D6" x:Key="ColorCheckboxCheckedPointOverBackground" />
|
||||
<SolidColorBrush Color="#0062D6" x:Key="ColorCheckboxCheckedPointOverBorderBrush" />
|
||||
<SolidColorBrush Color="#004FB3" x:Key="ColorCheckboxCheckedPressedBackground" />
|
||||
<SolidColorBrush Color="#004FB3" x:Key="ColorCheckboxCheckedPressedBorderBrush" />
|
||||
|
||||
<SolidColorBrush
|
||||
Color="#2E3238"
|
||||
Opacity="0.04"
|
||||
x:Key="ColorCheckboxDefaultDisabledBackground" />
|
||||
<SolidColorBrush
|
||||
Color="#1C1F23"
|
||||
Opacity="0.08"
|
||||
x:Key="ColorCheckboxDefaultDisabledBorderBrush" />
|
||||
<SolidColorBrush Color="#98CDFD" x:Key="ColorCheckboxCheckedDisabledBackground" />
|
||||
<SolidColorBrush Color="#98CDFD" x:Key="ColorCheckboxCheckedDisabledBorderBrush" />
|
||||
|
||||
<sys:Double x:Key="FontCheckboxFontSize">14</sys:Double>
|
||||
<sys:Double x:Key="SizeCheckboxBoxWidth">16</sys:Double>
|
||||
<sys:Double x:Key="SizeCheckboxBoxHeight">16</sys:Double>
|
||||
<FontWeight x:Key="FontCheckboxFontWeight">400</FontWeight>
|
||||
|
||||
<CornerRadius x:Key="CornerRadiusCheckboxBox">3</CornerRadius>
|
||||
<Thickness x:Key="ThicknessCheckboxContentMargin">8 0 0 0</Thickness>
|
||||
<Thickness x:Key="ThicknessCheckboxBoxBorderThickness">1</Thickness>
|
||||
</ResourceDictionary>
|
@ -1,9 +1,9 @@
|
||||
<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">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Palette.axaml"/>
|
||||
<!-- Controls -->
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Button.axaml"/>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Window.axaml"/>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Palette.axaml" />
|
||||
<!-- Controls -->
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Button.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/CheckBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Window.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
3
src/Semi.Avalonia/Themes/Light/TabControl.axaml
Normal file
3
src/Semi.Avalonia/Themes/Light/TabControl.axaml
Normal file
@ -0,0 +1,3 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
</ResourceDictionary>
|
3
src/Semi.Avalonia/Themes/Light/TabItem.axaml
Normal file
3
src/Semi.Avalonia/Themes/Light/TabItem.axaml
Normal file
@ -0,0 +1,3 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
</ResourceDictionary>
|
Loading…
x
Reference in New Issue
Block a user