mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-17 06:36:35 +08:00
Merge branch '12.0.0-rc2'
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageIcon>irihi.png</PackageIcon>
|
||||
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
<AvaloniaVersion>11.3.7</AvaloniaVersion>
|
||||
<DataGridVersion>11.3.7</DataGridVersion>
|
||||
<AvaloniaVersion>12.0.0-rc2</AvaloniaVersion>
|
||||
<DataGridVersion>12.0.0-rc2</DataGridVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Controls.TreeDataGrid" Version="11.1.1"/>
|
||||
<PackageVersion Include="Irihi.Avalonia.Shared" Version="0.4.0-rc1"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -6,6 +6,7 @@
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceInclude x:Key="Default" Source="Light.axaml" />
|
||||
<ResourceInclude x:Key="Light" Source="Light.axaml" />
|
||||
<ResourceInclude x:Key="Dark" Source="Dark.axaml" />
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:iri="https://irihi.tech/shared"
|
||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
||||
<converters:CornerRadiusFilterConverter x:Key="LeftCornerRadiusFilterConverter" Filter="TopLeft, BottomLeft" />
|
||||
<converters:ToBrushConverter x:Key="ToBrushConverter" />
|
||||
|
||||
<ControlTheme x:Key="{x:Type ColorPicker}" TargetType="ColorPicker">
|
||||
@@ -16,11 +16,11 @@
|
||||
<Border
|
||||
Margin="1,1,0,1"
|
||||
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}"
|
||||
CornerRadius="{TemplateBinding CornerRadius, Converter={StaticResource LeftCornerRadiusFilterConverter}}" />
|
||||
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Left}}" />
|
||||
<Border
|
||||
Margin="1,1,0,1"
|
||||
Background="{TemplateBinding HsvColor, Converter={StaticResource ToBrushConverter}}"
|
||||
CornerRadius="{TemplateBinding CornerRadius, Converter={StaticResource LeftCornerRadiusFilterConverter}}" />
|
||||
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Left}}" />
|
||||
</Panel>
|
||||
</Template>
|
||||
</Setter>
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="using:Avalonia.Controls.Converters"
|
||||
xmlns:iri="https://irihi.tech/shared"
|
||||
xmlns:pc="using:Avalonia.Controls.Primitives.Converters">
|
||||
<pc:AccentColorConverter x:Key="AccentColorConverter" />
|
||||
<converters:CornerRadiusFilterConverter x:Key="LeftCornerRadiusFilterConverter" Filter="TopLeft, BottomLeft" />
|
||||
<converters:CornerRadiusFilterConverter x:Key="RightCornerRadiusFilterConverter" Filter="TopRight, BottomRight" />
|
||||
|
||||
<ControlTheme x:Key="{x:Type ColorPreviewer}" TargetType="ColorPreviewer">
|
||||
<Setter Property="Height" Value="{DynamicResource ColorPreviewerHeight}" />
|
||||
@@ -34,7 +32,7 @@
|
||||
Background="{TemplateBinding HsvColor,
|
||||
Converter={StaticResource AccentColorConverter},
|
||||
ConverterParameter='-2'}"
|
||||
CornerRadius="{TemplateBinding CornerRadius,Converter={StaticResource LeftCornerRadiusFilterConverter}}"
|
||||
CornerRadius="{TemplateBinding CornerRadius,Converter={iri:CornerRadiusMixerConverter Left}}"
|
||||
Tag="-2" />
|
||||
<Border
|
||||
Name="PART_AccentDecrement1Border"
|
||||
@@ -70,7 +68,7 @@
|
||||
Background="{TemplateBinding HsvColor,
|
||||
Converter={StaticResource AccentColorConverter},
|
||||
ConverterParameter='2'}"
|
||||
CornerRadius="{TemplateBinding CornerRadius,Converter={StaticResource RightCornerRadiusFilterConverter}}"
|
||||
CornerRadius="{TemplateBinding CornerRadius,Converter={iri:CornerRadiusMixerConverter Right}}"
|
||||
Tag="2" />
|
||||
</Grid>
|
||||
<!-- Preview color: Must be last for drop shadow Z-index -->
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
|
||||
<Version>11.3.7.3</Version>
|
||||
<PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 11.3.7.3</PackageReleaseNotes>
|
||||
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
||||
<Version>12.0.0-rc1</Version>
|
||||
<PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 12.0.0-rc1</PackageReleaseNotes>
|
||||
<Title>Semi.Avalonia.ColorPicker</Title>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Controls.ColorPicker"/>
|
||||
<PackageReference Include="Irihi.Avalonia.Shared"/>
|
||||
<None Include="README.md" Pack="true" PackagePath="\"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Utilities;
|
||||
using Irihi.Avalonia.Shared.Helpers;
|
||||
|
||||
namespace Semi.Avalonia.ColorPicker;
|
||||
|
||||
@@ -220,8 +221,8 @@ public class SemiColorDarkPalette: IColorPalette
|
||||
public Color GetColor(int colorIndex, int shadeIndex)
|
||||
{
|
||||
return Colors[
|
||||
MathUtilities.Clamp(colorIndex, 0, ColorCount - 1),
|
||||
MathUtilities.Clamp(shadeIndex, 0, ShadeCount - 1)
|
||||
MathHelpers.SafeClamp(colorIndex, 0, ColorCount - 1),
|
||||
MathHelpers.SafeClamp(shadeIndex, 0, ShadeCount - 1)
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Utilities;
|
||||
using Irihi.Avalonia.Shared.Helpers;
|
||||
|
||||
namespace Semi.Avalonia.ColorPicker;
|
||||
|
||||
@@ -220,8 +221,8 @@ public class SemiColorLightPalette: IColorPalette
|
||||
public Color GetColor(int colorIndex, int shadeIndex)
|
||||
{
|
||||
return Colors[
|
||||
MathUtilities.Clamp(colorIndex, 0, ColorCount - 1),
|
||||
MathUtilities.Clamp(shadeIndex, 0, ShadeCount - 1)
|
||||
MathHelpers.SafeClamp(colorIndex, 0, ColorCount - 1),
|
||||
MathHelpers.SafeClamp(shadeIndex, 0, ShadeCount - 1)
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceInclude x:Key="Default" Source="Light.axaml" />
|
||||
<ResourceInclude x:Key="Light" Source="Light.axaml" />
|
||||
<ResourceInclude x:Key="Dark" Source="Dark.axaml" />
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
|
||||
<Version>11.3.7.3</Version>
|
||||
<PackageReleaseNotes>Update to Semi.Avalonia.DataGrid 11.3.7.3</PackageReleaseNotes>
|
||||
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
||||
<Version>12.0.0-rc1</Version>
|
||||
<PackageReleaseNotes>Update to Semi.Avalonia.DataGrid 12.0.0-rc1</PackageReleaseNotes>
|
||||
<Title>Semi.Avalonia.DataGrid</Title>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
x:Class="Semi.Avalonia.SemiPopupAnimations"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="clr-namespace:Semi.Avalonia.Converters">
|
||||
xmlns:semi="https://irihi.tech/semi">
|
||||
<Style Selector="Popup LayoutTransformControl#PART_LayoutTransform">
|
||||
<Setter Property="RenderTransformOrigin" Value="{Binding $parent[Popup].Placement, Converter={x:Static converters:PlacementToRenderTransformOriginConverter.Instance}}" />
|
||||
<Setter Property="RenderTransformOrigin" Value="{Binding $parent[Popup].Placement, Converter={semi:PlacementToRenderTransformOriginConverter}}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="Popup[IsOpen=True] LayoutTransformControl#PART_LayoutTransform">
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:iri="https://irihi.tech/shared">
|
||||
<Design.PreviewWith>
|
||||
<StackPanel Margin="20" Spacing="20">
|
||||
<TextBox Text="Hello" />
|
||||
<AutoCompleteBox Width="100" />
|
||||
<AutoCompleteBox Width="100" PlaceholderText="Hello" />
|
||||
</StackPanel>
|
||||
</Design.PreviewWith>
|
||||
<ControlTheme x:Key="{x:Type AutoCompleteBox}" TargetType="AutoCompleteBox">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxDefaultHeight}" />
|
||||
<Setter Property="MaxDropDownHeight" Value="{DynamicResource AutoCompleteMaxDropdownHeight}" />
|
||||
<Setter Property="Template">
|
||||
@@ -24,7 +26,8 @@
|
||||
Theme="{DynamicResource NonErrorTextBox}"
|
||||
InnerLeftContent="{TemplateBinding InnerLeftContent}"
|
||||
InnerRightContent="{TemplateBinding InnerRightContent}"
|
||||
Watermark="{TemplateBinding Watermark}" />
|
||||
PlaceholderForeground="{TemplateBinding PlaceholderForeground}"
|
||||
PlaceholderText="{TemplateBinding PlaceholderText}" />
|
||||
<Popup
|
||||
Name="PART_Popup"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
||||
@@ -55,45 +58,13 @@
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^.Bordered">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="AutoCompleteBox">
|
||||
<Panel>
|
||||
<TextBox
|
||||
Name="PART_TextBox"
|
||||
VerticalAlignment="Stretch"
|
||||
MinHeight="0"
|
||||
Classes="Bordered"
|
||||
ClearSelectionOnLostFocus="{TemplateBinding ClearSelectionOnLostFocus}"
|
||||
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
|
||||
Watermark="{TemplateBinding Watermark}" />
|
||||
<Popup
|
||||
Name="PART_Popup"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
||||
InheritsTransform="True"
|
||||
IsLightDismissEnabled="True"
|
||||
PlacementTarget="{TemplateBinding}">
|
||||
<Border
|
||||
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Margin="{DynamicResource AutoCompleteBoxPopupMargin}"
|
||||
Padding="{DynamicResource AutoCompleteBoxPopupPadding}"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{DynamicResource AutoCompleteBoxPopupBackground}"
|
||||
BorderBrush="{DynamicResource AutoCompleteBoxPopupBorderBrush}"
|
||||
BorderThickness="{DynamicResource AutoCompleteBoxPopupBorderThickness}"
|
||||
BoxShadow="{DynamicResource AutoCompleteBoxPopupBoxShadow}"
|
||||
CornerRadius="{DynamicResource AutoCompleteBoxPopupCornerRadius}">
|
||||
<ListBox
|
||||
Name="PART_SelectingItemsControl"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
ItemTemplate="{TemplateBinding ItemTemplate}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.IsScrollChainingEnabled="False" />
|
||||
</Border>
|
||||
</Popup>
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ TextBox#PART_TextBox">
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="iri:ClassHelper.Classes" Value="Bordered" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ListBox#PART_SelectingItemsControl">
|
||||
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="False" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.Large">
|
||||
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxLargeHeight}" />
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
@@ -92,7 +93,7 @@
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^[ButtonSpinnerLocation=Left] /template/ Border#ButtonGroup">
|
||||
<Style Selector="^:left /template/ Border#ButtonGroup">
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="Margin" Value="0 0 4 0" />
|
||||
</Style>
|
||||
@@ -100,4 +101,70 @@
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSpinnerRepeatButtonPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="SplitButtonSpinner" TargetType="ButtonSpinner">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSpinnerRepeatButtonBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="MinWidth" Value="200" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="ButtonSpinner">
|
||||
<Grid ColumnDefinitions="Auto, *, Auto">
|
||||
<RepeatButton
|
||||
Name="PART_DecreaseButton"
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Stretch"
|
||||
Padding="{DynamicResource SplitButtonSpinnerButtonPadding}"
|
||||
BorderBrush="{DynamicResource ButtonSpinnerRepeatButtonBorderBrush}"
|
||||
BorderThickness="{DynamicResource ButtonSpinnerButtonGroupBorderThickness}"
|
||||
CornerRadius="{DynamicResource SplitButtonSpinnerLeftButtonCornerRadius}"
|
||||
IsVisible="{TemplateBinding ShowButtonSpinner}"
|
||||
Theme="{StaticResource ButtonSpinnerRepeatButton}">
|
||||
<PathIcon
|
||||
Theme="{DynamicResource InnerPathIcon}"
|
||||
Classes="Small"
|
||||
Data="{DynamicResource SplitButtonSpinnerDecreaseButtonGlyph}"
|
||||
Foreground="{DynamicResource ButtonSpinnerRepeatButtonForeground}" />
|
||||
</RepeatButton>
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Margin="2 0"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</Border>
|
||||
<RepeatButton
|
||||
Name="PART_IncreaseButton"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Stretch"
|
||||
Padding="{DynamicResource SplitButtonSpinnerButtonPadding}"
|
||||
BorderBrush="{DynamicResource ButtonSpinnerRepeatButtonBorderBrush}"
|
||||
BorderThickness="{DynamicResource ButtonSpinnerButtonGroupBorderThickness}"
|
||||
CornerRadius="{DynamicResource SplitButtonSpinnerRightButtonCornerRadius}"
|
||||
IsVisible="{TemplateBinding ShowButtonSpinner}"
|
||||
Theme="{StaticResource ButtonSpinnerRepeatButton}">
|
||||
<PathIcon
|
||||
Theme="{DynamicResource InnerPathIcon}"
|
||||
Classes="Small"
|
||||
Data="{DynamicResource SplitButtonSpinnerIncreaseButtonGlyph}"
|
||||
Foreground="{DynamicResource ButtonSpinnerRepeatButtonForeground}" />
|
||||
</RepeatButton>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:left /template/ RepeatButton#PART_DecreaseButton">
|
||||
<Setter Property="Grid.Column" Value="2" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource SplitButtonSpinnerRightButtonCornerRadius}" />
|
||||
</Style>
|
||||
<Style Selector="^:left /template/ RepeatButton#PART_IncreaseButton">
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource SplitButtonSpinnerLeftButtonCornerRadius}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -9,6 +9,7 @@
|
||||
<ControlTheme x:Key="{x:Type CalendarDatePicker}" TargetType="CalendarDatePicker">
|
||||
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerForeground}" />
|
||||
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource CalendarDatePickerBorderThickness}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource CalendarDatePickerCornerRadius}" />
|
||||
@@ -52,8 +53,9 @@
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Theme="{DynamicResource NonErrorTextBox}"
|
||||
UseFloatingWatermark="{TemplateBinding UseFloatingWatermark}"
|
||||
Watermark="{TemplateBinding Watermark}">
|
||||
UseFloatingPlaceholder="{TemplateBinding UseFloatingPlaceholder}"
|
||||
PlaceholderForeground="{TemplateBinding PlaceholderForeground}"
|
||||
PlaceholderText="{TemplateBinding PlaceholderText}">
|
||||
<TextBox.Styles>
|
||||
<Style Selector="TextBox#PART_TextBox:pointerover /template/ Border#PART_ContentPresenterBorder">
|
||||
<!-- By default the TextBox has its own focused state, override this to disable it here -->
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<CaptionButtons />
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ControlTheme x:Key="CaptionButton" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonForeground}" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="CornerRadius" Value="{StaticResource CaptionButtonCornerRadius}" />
|
||||
<Setter Property="Padding" Value="{StaticResource CaptionButtonPadding}" />
|
||||
<Setter Property="Width" Value="{StaticResource CaptionButtonWidth}" />
|
||||
<Setter Property="Height" Value="{StaticResource CaptionButtonHeight}" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Button">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonPointeroverBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonPressedBackground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type CaptionButtons}" TargetType="CaptionButtons">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonForeground}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="CaptionButtons">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Name="PART_FullScreenButton" Theme="{StaticResource CaptionButton}">
|
||||
<PathIcon
|
||||
Name="PART_FullScreenButtonIcon"
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{StaticResource WindowExpandGlyph}"
|
||||
Foreground="{Binding $parent[Button].Foreground}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="PART_MinimizeButton"
|
||||
Theme="{StaticResource CaptionButton}"
|
||||
AutomationProperties.Name="Minimize"
|
||||
Win32Properties.NonClientHitTestResult="MinButton">
|
||||
<PathIcon
|
||||
Name="PART_MinimizeButtonIcon"
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{StaticResource WindowMinimizeGlyph}"
|
||||
Foreground="{Binding $parent[Button].Foreground}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="PART_RestoreButton"
|
||||
Theme="{StaticResource CaptionButton}"
|
||||
AutomationProperties.Name="Maximize"
|
||||
Win32Properties.NonClientHitTestResult="MaxButton">
|
||||
<PathIcon
|
||||
Name="PART_RestoreButtonIcon"
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{StaticResource WindowMaximizeGlyph}"
|
||||
Foreground="{Binding $parent[Button].Foreground}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="PART_CloseButton"
|
||||
Theme="{StaticResource CaptionButton}"
|
||||
AutomationProperties.Name="Close"
|
||||
Win32Properties.NonClientHitTestResult="Close">
|
||||
<PathIcon
|
||||
Name="PART_CloseButtonIcon"
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{StaticResource WindowCloseIconGlyph}"
|
||||
Foreground="{Binding $parent[Button].Foreground}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^ /template/ Button#PART_CloseButton:pointerover">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonCloseForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonClosePointeroverBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Button#PART_CloseButton:pressed">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonCloseForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonClosePressedBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:maximized /template/ PathIcon#PART_RestoreButtonIcon">
|
||||
<Setter Property="Data" Value="{StaticResource WindowRestoreGlyph}" />
|
||||
</Style>
|
||||
<Style Selector="^:fullscreen /template/ PathIcon#PART_FullScreenButtonIcon">
|
||||
<Setter Property="Data" Value="{StaticResource WindowCollapseGlyph}" />
|
||||
</Style>
|
||||
<Style Selector="^:fullscreen /template/ Button#PART_RestoreButton">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^:fullscreen /template/ Button#PART_MinimizeButton">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -1,7 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converter="clr-namespace:Semi.Avalonia.Converters">
|
||||
xmlns:semi="https://irihi.tech/semi">
|
||||
<Design.PreviewWith>
|
||||
<StackPanel Spacing="20" Width="800" Height="800">
|
||||
<StackPanel.Styles>
|
||||
@@ -156,7 +156,7 @@
|
||||
Theme="{DynamicResource InnerPathIcon}"
|
||||
Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Data="{DynamicResource CarouselButtonGlyph}"
|
||||
Data="{TemplateBinding Content}"
|
||||
Foreground="{TemplateBinding Foreground}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
@@ -197,8 +197,8 @@
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
ItemContainerTheme="{DynamicResource CarouselIndicatorDotListBoxItem}"
|
||||
ItemsSource="{TemplateBinding ItemCount, Converter={x:Static converter:ItemConverter.ItemToObjectConverter}}"
|
||||
IsVisible="{TemplateBinding ItemCount, Converter={x:Static converter:ItemConverter.ItemVisibleConverter}}"
|
||||
ItemsSource="{TemplateBinding ItemCount, Converter={x:Static semi:ItemConverter.ItemToObjectConverter}}"
|
||||
IsVisible="{TemplateBinding ItemCount, Converter={x:Static semi:ItemConverter.ItemVisibleConverter}}"
|
||||
SelectedIndex="{TemplateBinding SelectedIndex, Mode=TwoWay}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
@@ -213,7 +213,8 @@
|
||||
Theme="{DynamicResource CarouselButton}"
|
||||
Margin="{DynamicResource CarouselButtonMargin}"
|
||||
Foreground="{DynamicResource CarouselButtonForeground}"
|
||||
IsVisible="{TemplateBinding ItemCount, Converter={x:Static converter:ItemConverter.ItemVisibleConverter}}"
|
||||
Content="{StaticResource SemiIconChevronLeft}"
|
||||
IsVisible="{TemplateBinding ItemCount, Converter={x:Static semi:ItemConverter.ItemVisibleConverter}}"
|
||||
Command="{Binding $parent[Carousel].Previous}" />
|
||||
<Button
|
||||
Grid.Row="0"
|
||||
@@ -222,9 +223,9 @@
|
||||
Theme="{DynamicResource CarouselButton}"
|
||||
Margin="{DynamicResource CarouselButtonMargin}"
|
||||
Foreground="{DynamicResource CarouselButtonForeground}"
|
||||
IsVisible="{TemplateBinding ItemCount, Converter={x:Static converter:ItemConverter.ItemVisibleConverter}}"
|
||||
Command="{Binding $parent[Carousel].Next}"
|
||||
RenderTransform="rotate(180deg)" />
|
||||
Content="{StaticResource SemiIconChevronRight}"
|
||||
IsVisible="{TemplateBinding ItemCount, Converter={x:Static semi:ItemConverter.ItemVisibleConverter}}"
|
||||
Command="{Binding $parent[Carousel].Next}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
19
src/Semi.Avalonia/Controls/CarouselPage.axaml
Normal file
19
src/Semi.Avalonia/Controls/CarouselPage.axaml
Normal file
@@ -0,0 +1,19 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type CarouselPage}" TargetType="CarouselPage">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Carousel
|
||||
Name="PART_Carousel"
|
||||
Background="{TemplateBinding Background}"
|
||||
ItemTemplate="{TemplateBinding PageTemplate}"
|
||||
PageTransition="{TemplateBinding PageTransition}"
|
||||
ItemsPanel="{TemplateBinding ItemsPanel}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -92,7 +92,7 @@
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Text="{TemplateBinding Text, Mode=TwoWay}"
|
||||
Watermark="{TemplateBinding PlaceholderText}"
|
||||
PlaceholderText="{TemplateBinding PlaceholderText}"
|
||||
IsVisible="{TemplateBinding IsEditable}" />
|
||||
|
||||
<Button
|
||||
|
||||
371
src/Semi.Avalonia/Controls/CommandBar.axaml
Normal file
371
src/Semi.Avalonia/Controls/CommandBar.axaml
Normal file
@@ -0,0 +1,371 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:collections="clr-namespace:Avalonia.Collections;assembly=Avalonia.Base">
|
||||
|
||||
<Design.PreviewWith>
|
||||
<GroupBox Height="500">
|
||||
<GroupBox.Header>
|
||||
<StackPanel>
|
||||
<ComboBox
|
||||
Name="lc"
|
||||
ItemsSource="{DynamicResource LabelPositionList}"
|
||||
SelectedValue="{x:Static CommandBarDefaultLabelPosition.Bottom}">
|
||||
<ComboBox.Resources>
|
||||
<collections:AvaloniaList x:TypeArguments="CommandBarDefaultLabelPosition" x:Key="LabelPositionList">
|
||||
<CommandBarDefaultLabelPosition>Bottom</CommandBarDefaultLabelPosition>
|
||||
<CommandBarDefaultLabelPosition>Collapsed</CommandBarDefaultLabelPosition>
|
||||
<CommandBarDefaultLabelPosition>Right</CommandBarDefaultLabelPosition>
|
||||
</collections:AvaloniaList>
|
||||
</ComboBox.Resources>
|
||||
</ComboBox>
|
||||
<ToggleSwitch Name="idfe" IsChecked="True" />
|
||||
<Slider Name="ws" Width="500" Minimum="0" Maximum="500" Value="200" />
|
||||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Top">
|
||||
<CommandBar
|
||||
DefaultLabelPosition="{Binding #lc.SelectedValue}"
|
||||
IsDynamicOverflowEnabled="{Binding #idfe.IsChecked}"
|
||||
Width="{Binding #ws.Value}">
|
||||
<CommandBarButton Label="New" Icon="{DynamicResource SemiIconPlus}" />
|
||||
<CommandBarButton Label="Save" Icon="{DynamicResource SemiIconSave}" />
|
||||
<CommandBarSeparator />
|
||||
<CommandBarToggleButton Label="Bold" Icon="{DynamicResource SemiIconBold}" />
|
||||
<CommandBarToggleButton Label="Italic" Icon="{DynamicResource SemiIconItalic}" />
|
||||
<CommandBarToggleButton IsEnabled="False" IsChecked="True" Label="Underline" Icon="{DynamicResource SemiIconUnderline}" />
|
||||
<CommandBarSeparator />
|
||||
<CommandBarButton Label="Share" Icon="{DynamicResource SemiIconShare}" />
|
||||
<CommandBarButton Label="Export" Icon="{DynamicResource SemiIconExport}" />
|
||||
<CommandBarButton Label="Print" Icon="{DynamicResource SemiIconPrint}" />
|
||||
<CommandBarSeparator />
|
||||
<CommandBarButton Label="Delete" Icon="{DynamicResource SemiIconDelete}" />
|
||||
</CommandBar>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ControlTheme x:Key="CommandBarButtonBaseTheme" TargetType="Button">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border
|
||||
Name="PART_Border"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<StackPanel
|
||||
Name="PART_LayoutRoot"
|
||||
Spacing="{DynamicResource CommandBarButtonPanelSpacing}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
|
||||
<ContentPresenter
|
||||
Name="PART_IconPresenter"
|
||||
Foreground="{TemplateBinding Foreground}">
|
||||
<ContentPresenter.DataTemplates>
|
||||
<DataTemplate DataType="Geometry">
|
||||
<PathIcon
|
||||
Theme="{DynamicResource InnerPathIcon}"
|
||||
Data="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ContentPresenter.DataTemplates>
|
||||
</ContentPresenter>
|
||||
<TextBlock
|
||||
Name="PART_Label"
|
||||
MaxLines="1"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
FontSize="{DynamicResource CommandBarButtonLabelFontSize}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Setter Property="Background" Value="{DynamicResource CommandBarButtonBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource CommandBarButtonForeground}" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Padding" Value="{DynamicResource CommandBarButtonPadding}" />
|
||||
<Setter Property="Width" Value="{DynamicResource CommandBarButtonWidth}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource CommandBarButtonMinHeight}" />
|
||||
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource CommandBarButtonCornerRadius}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
|
||||
<Style Selector="^:pointerover /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{DynamicResource CommandBarButtonPointeroverBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{DynamicResource CommandBarButtonPressedBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CommandBarButtonDisabledForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CommandBarButtonDisabledForeground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- CommandBarButton -->
|
||||
<ControlTheme
|
||||
x:Key="{x:Type CommandBarButton}"
|
||||
BasedOn="{StaticResource CommandBarButtonBaseTheme}"
|
||||
TargetType="CommandBarButton">
|
||||
|
||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||
<Setter Property="Text" Value="{TemplateBinding Label}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="Content" Value="{TemplateBinding Icon}" />
|
||||
</Style>
|
||||
|
||||
<!-- IsCompact: hide label, use compact width -->
|
||||
<Style Selector="^[IsCompact=True]">
|
||||
<Setter Property="Width" Value="{DynamicResource CommandBarButtonCompactWidth}" />
|
||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- LabelPosition=Collapsed: hide label, use compact width -->
|
||||
<Style Selector="^[LabelPosition=Collapsed]">
|
||||
<Setter Property="Width" Value="{DynamicResource CommandBarButtonCompactWidth}" />
|
||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- LabelPosition=Right: horizontal layout, auto-width -->
|
||||
<Style Selector="^[LabelPosition=Right]">
|
||||
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||
<Setter Property="MinWidth" Value="{DynamicResource CommandBarButtonCompactWidth}" />
|
||||
<Style Selector="^ /template/ StackPanel#PART_LayoutRoot">
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- IsInOverflow: full-width horizontal layout for use inside overflow popup -->
|
||||
<Style Selector="^[IsInOverflow=True]">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource CommandBarButtonOverflowMinHeight}" />
|
||||
<Setter Property="Padding" Value="{DynamicResource CommandBarButtonOverflowPadding}" />
|
||||
<Style Selector="^ /template/ StackPanel#PART_LayoutRoot">
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- CommandBarToggleButton -->
|
||||
<ControlTheme
|
||||
x:Key="{x:Type CommandBarToggleButton}"
|
||||
BasedOn="{StaticResource CommandBarButtonBaseTheme}"
|
||||
TargetType="CommandBarToggleButton">
|
||||
|
||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||
<Setter Property="Text" Value="{TemplateBinding Label}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="Content" Value="{TemplateBinding Icon}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:checked">
|
||||
<Style Selector="^ /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{DynamicResource CommandBarToggleButtonCheckedBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CommandBarToggleButtonCheckedForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pointerover /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{DynamicResource CommandBarToggleButtonCheckedPointeroverBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{DynamicResource CommandBarToggleButtonCheckedPressedBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^:disabled /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CommandBarToggleButtonCheckedDisabledForeground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- IsCompact: hide label, use compact width -->
|
||||
<Style Selector="^[IsCompact=True]">
|
||||
<Setter Property="Width" Value="{DynamicResource CommandBarButtonCompactWidth}" />
|
||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- LabelPosition=Collapsed: hide label, use compact width -->
|
||||
<Style Selector="^[LabelPosition=Collapsed]">
|
||||
<Setter Property="Width" Value="{DynamicResource CommandBarButtonCompactWidth}" />
|
||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- LabelPosition=Right: horizontal layout, auto-width -->
|
||||
<Style Selector="^[LabelPosition=Right]">
|
||||
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||
<Setter Property="MinWidth" Value="{DynamicResource CommandBarButtonCompactWidth}" />
|
||||
<Style Selector="^ /template/ StackPanel#PART_LayoutRoot">
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- IsInOverflow: full-width horizontal layout for use inside overflow popup -->
|
||||
<Style Selector="^[IsInOverflow=True]">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource CommandBarButtonOverflowMinHeight}" />
|
||||
<Setter Property="Padding" Value="{DynamicResource CommandBarButtonOverflowPadding}" />
|
||||
<Style Selector="^ /template/ StackPanel#PART_LayoutRoot">
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- CommandBarSeparator -->
|
||||
<ControlTheme x:Key="{x:Type CommandBarSeparator}" TargetType="CommandBarSeparator">
|
||||
<Setter Property="Background" Value="{DynamicResource CommandBarSeparatorBackground}" />
|
||||
<Setter Property="Width" Value="{DynamicResource CommandBarSeparatorWidth}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource CommandBarSeparatorMinHeight}" />
|
||||
<Setter Property="Margin" Value="{DynamicResource CommandBarSeparatorMargin}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="CommandBarSeparator">
|
||||
<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="{x:Static x:Double.NaN}" />
|
||||
<Setter Property="Height" Value="{DynamicResource CommandBarSeparatorOverflowHeight}" />
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="Margin" Value="{DynamicResource CommandBarSeparatorOverflowMargin}" />
|
||||
</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 KeyboardNavigation.TabNavigation="Cycle">
|
||||
<!-- Overflow button (docked right) -->
|
||||
<CommandBarButton
|
||||
Name="PART_OverflowButton"
|
||||
DockPanel.Dock="Right"
|
||||
Icon="{DynamicResource CommandBarOverflowButtonGlyph}"
|
||||
IsCompact="True"
|
||||
IsVisible="{TemplateBinding IsOverflowButtonVisible}" />
|
||||
|
||||
<!-- Custom content (docked left) -->
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
DockPanel.Dock="Left"
|
||||
Content="{TemplateBinding Content}"
|
||||
VerticalAlignment="Center" />
|
||||
|
||||
<!-- Primary commands (fills remaining space, right-aligned) -->
|
||||
<ItemsControl
|
||||
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
|
||||
Name="PART_OverflowPopup"
|
||||
IsOpen="{TemplateBinding IsOpen, Mode=TwoWay}"
|
||||
PlacementTarget="{Binding #PART_OverflowButton}"
|
||||
Placement="Bottom"
|
||||
IsLightDismissEnabled="True"
|
||||
WindowManagerAddShadowHint="False">
|
||||
<Border
|
||||
MinHeight="{DynamicResource CommandBarOverflowMinHeight}"
|
||||
MaxWidth="{DynamicResource CommandBarOverflowMaxWidth}"
|
||||
MaxHeight="{DynamicResource CommandBarOverflowMaxHeight}"
|
||||
Margin="{DynamicResource CommandBarOverflowMargin}"
|
||||
Padding="{DynamicResource CommandBarOverflowPadding}"
|
||||
Background="{DynamicResource CommandBarOverflowBackground}"
|
||||
BorderBrush="{DynamicResource CommandBarOverflowBorderBrush}"
|
||||
BorderThickness="{DynamicResource CommandBarBorderThickness}"
|
||||
BoxShadow="{DynamicResource CommandBarOverflowBoxShadow}"
|
||||
CornerRadius="{DynamicResource CommandBarOverflowCornerRadius}">
|
||||
|
||||
<ItemsControl
|
||||
Name="PART_OverflowPresenter"
|
||||
ItemsSource="{Binding OverflowItems, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Panel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
</ResourceDictionary>
|
||||
43
src/Semi.Avalonia/Controls/ContentPage.axaml
Normal file
43
src/Semi.Avalonia/Controls/ContentPage.axaml
Normal file
@@ -0,0 +1,43 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<ContentPage
|
||||
Width="400"
|
||||
Height="300"
|
||||
Background="White">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="ContentPage" />
|
||||
</ContentPage>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ControlTheme x:Key="{x:Type ContentPage}" TargetType="ContentPage">
|
||||
<Setter Property="Background" Value="{DynamicResource ContentPageBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ContentPageForeground}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="ContentPage">
|
||||
<Grid RowDefinitions="Auto,*,Auto" Background="{TemplateBinding Background}">
|
||||
<ContentPresenter
|
||||
Name="PART_TopCommandBar"
|
||||
Grid.Row="0"
|
||||
Content="{TemplateBinding TopCommandBar}" />
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Grid.Row="1"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
<ContentPresenter
|
||||
Name="PART_BottomCommandBar"
|
||||
Grid.Row="2"
|
||||
Content="{TemplateBinding BottomCommandBar}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -261,7 +261,7 @@
|
||||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerButtonDisabledIconForeground}" />
|
||||
</Style>
|
||||
|
||||
<!-- Changes foreground for watermark text when SelectedDate is null -->
|
||||
<!-- Changes foreground for placeholder text when SelectedDate is null -->
|
||||
<Style Selector="^:hasnodate /template/ Button#PART_FlyoutButton TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerEmptyForeground}" />
|
||||
</Style>
|
||||
|
||||
149
src/Semi.Avalonia/Controls/DrawerPage.axaml
Normal file
149
src/Semi.Avalonia/Controls/DrawerPage.axaml
Normal file
@@ -0,0 +1,149 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<DrawerPage Width="400" Height="300" />
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ControlTheme x:Key="{x:Type DrawerPage}" TargetType="DrawerPage">
|
||||
<Setter Property="Background" Value="{DynamicResource DrawerPageBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource DrawerPageForeground}" />
|
||||
<Setter Property="DrawerBackground" Value="{DynamicResource DrawerPageDrawerBackground}" />
|
||||
<Setter Property="DrawerLength" Value="{DynamicResource DrawerPageDrawerLength}" />
|
||||
<Setter Property="CompactDrawerLength" Value="{DynamicResource DrawerPageCompactDrawerLength}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="DrawerPage">
|
||||
<Grid RowDefinitions="Auto,*" Background="{TemplateBinding Background}">
|
||||
|
||||
<!-- Top bar with pane toggle button -->
|
||||
<Border
|
||||
Name="PART_TopBar"
|
||||
Grid.Row="0"
|
||||
MinHeight="{DynamicResource DrawerPageTopBarMinHeight}"
|
||||
Padding="{DynamicResource DrawerPageTopBarPadding}"
|
||||
Background="{DynamicResource DrawerPageTopBarBackground}"
|
||||
BorderBrush="{DynamicResource DrawerPageTopBarBorderBrush}"
|
||||
BorderThickness="{DynamicResource DrawerPageTopBarBorderThickness}">
|
||||
<Grid ColumnDefinitions="Auto,Auto,*">
|
||||
<!-- Pane toggle button (hamburger) -->
|
||||
<ToggleButton
|
||||
Name="PART_PaneButton"
|
||||
Grid.Column="0"
|
||||
Width="{DynamicResource DrawerPagePaneButtonSize}"
|
||||
Height="{DynamicResource DrawerPagePaneButtonSize}"
|
||||
Margin="{DynamicResource DrawerPagePaneButtonMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Background="{DynamicResource DrawerPagePaneButtonBackground}"
|
||||
Foreground="{DynamicResource DrawerPagePaneButtonForeground}"
|
||||
IsChecked="{TemplateBinding IsOpen, Mode=TwoWay}">
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="{DynamicResource DrawerPageMenuGlyph}"
|
||||
Foreground="{DynamicResource DrawerPagePaneButtonForeground}" />
|
||||
</ToggleButton>
|
||||
|
||||
<!-- Drawer icon (shown in top bar) -->
|
||||
<ContentPresenter
|
||||
Name="PART_PaneIconPresenter"
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding DrawerIcon}"
|
||||
ContentTemplate="{TemplateBinding DrawerIconTemplate}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Main area: SplitView + Backdrop -->
|
||||
<Panel Grid.Row="1">
|
||||
<SplitView
|
||||
Name="PART_SplitView"
|
||||
CompactPaneLength="{TemplateBinding CompactDrawerLength}"
|
||||
DisplayMode="{TemplateBinding DisplayMode}"
|
||||
IsPaneOpen="{TemplateBinding IsOpen, Mode=TwoWay}"
|
||||
OpenPaneLength="{TemplateBinding DrawerLength}"
|
||||
PaneBackground="{TemplateBinding DrawerBackground}">
|
||||
<SplitView.Pane>
|
||||
<DockPanel>
|
||||
<!-- Drawer header -->
|
||||
<ContentPresenter
|
||||
Name="PART_DrawerHeader"
|
||||
DockPanel.Dock="Top"
|
||||
Background="{TemplateBinding DrawerHeaderBackground}"
|
||||
Content="{TemplateBinding DrawerHeader}"
|
||||
ContentTemplate="{TemplateBinding DrawerHeaderTemplate}" />
|
||||
|
||||
<!-- Drawer footer -->
|
||||
<ContentPresenter
|
||||
Name="PART_DrawerFooter"
|
||||
DockPanel.Dock="Bottom"
|
||||
Background="{TemplateBinding DrawerFooterBackground}"
|
||||
Content="{TemplateBinding DrawerFooter}"
|
||||
ContentTemplate="{TemplateBinding DrawerFooterTemplate}" />
|
||||
|
||||
<!-- Compact pane icon (compact mode) -->
|
||||
<ContentPresenter
|
||||
Name="PART_CompactPaneIconPresenter"
|
||||
DockPanel.Dock="Top"
|
||||
IsVisible="False"
|
||||
Content="{TemplateBinding DrawerIcon}"
|
||||
ContentTemplate="{TemplateBinding DrawerIconTemplate}" />
|
||||
|
||||
<!-- Bottom pane icon -->
|
||||
<ContentPresenter
|
||||
Name="PART_BottomPaneIconPresenter"
|
||||
DockPanel.Dock="Bottom"
|
||||
IsVisible="False"
|
||||
Content="{TemplateBinding DrawerIcon}"
|
||||
ContentTemplate="{TemplateBinding DrawerIconTemplate}" />
|
||||
|
||||
<!-- Drawer main content -->
|
||||
<ContentPresenter
|
||||
Name="PART_DrawerPresenter"
|
||||
Content="{TemplateBinding Drawer}"
|
||||
ContentTemplate="{TemplateBinding DrawerTemplate}" />
|
||||
</DockPanel>
|
||||
</SplitView.Pane>
|
||||
|
||||
<!-- Main page content -->
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</SplitView>
|
||||
|
||||
<!-- Backdrop overlay (shown in overlay/flyout modes) -->
|
||||
<Border
|
||||
Name="PART_Backdrop"
|
||||
Background="{TemplateBinding BackdropBrush}"
|
||||
IsHitTestVisible="False"
|
||||
IsVisible="False" />
|
||||
|
||||
<!-- Compact pane toggle -->
|
||||
<ToggleButton
|
||||
Name="PART_CompactPaneToggle"
|
||||
IsVisible="False" />
|
||||
</Panel>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- Pseudo-class: right-side drawer -->
|
||||
<Style Selector="^:placement-right /template/ SplitView#PART_SplitView">
|
||||
<Setter Property="PanePlacement" Value="Right" />
|
||||
</Style>
|
||||
|
||||
<!-- Pseudo-class: top drawer -->
|
||||
<Style Selector="^:placement-top /template/ SplitView#PART_SplitView">
|
||||
<Setter Property="PanePlacement" Value="Top" />
|
||||
</Style>
|
||||
|
||||
<!-- Pseudo-class: bottom drawer -->
|
||||
<Style Selector="^:placement-bottom /template/ SplitView#PART_SplitView">
|
||||
<Setter Property="PanePlacement" Value="Bottom" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -10,7 +10,7 @@
|
||||
<Panel>
|
||||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
|
||||
<Border Background="{TemplateBinding Background}">
|
||||
<VisualLayerManager>
|
||||
<VisualLayerManager Name="PART_VisualLayerManager">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
|
||||
5
src/Semi.Avalonia/Controls/GroupBox.axaml
Normal file
5
src/Semi.Avalonia/Controls/GroupBox.axaml
Normal file
@@ -0,0 +1,5 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<StaticResource x:Key="{x:Type GroupBox}" ResourceKey="GroupBox"/>
|
||||
</ResourceDictionary>
|
||||
@@ -1,7 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls">
|
||||
xmlns:iri="https://irihi.tech/shared">
|
||||
<Design.PreviewWith>
|
||||
<StackPanel Spacing="20">
|
||||
<HeaderedContentControl
|
||||
@@ -23,7 +23,6 @@
|
||||
</HeaderedContentControl>
|
||||
</StackPanel>
|
||||
</Design.PreviewWith>
|
||||
<converters:MarginMultiplierConverter x:Key="SeparatorBorderMultiplier" Top="True" Indent="1" />
|
||||
|
||||
<ControlTheme x:Key="{x:Type HeaderedContentControl}" TargetType="HeaderedContentControl">
|
||||
<Setter Property="Padding" Value="3" />
|
||||
@@ -97,7 +96,7 @@
|
||||
Name="SeparatorBorder"
|
||||
Grid.Row="1"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness, Converter={StaticResource SeparatorBorderMultiplier}}">
|
||||
BorderThickness="{TemplateBinding BorderThickness, Converter={iri:ThicknessMixerConverter Top}}">
|
||||
<Border.IsVisible>
|
||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||
<TemplateBinding Property="Header" Converter="{x:Static ObjectConverters.IsNotNull}" />
|
||||
@@ -117,5 +116,13 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Setter Property="RecognizesAccessKey" Value="True" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="RecognizesAccessKey" Value="True" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -1,9 +1,9 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="using:Semi.Avalonia.Converters"
|
||||
xmlns:dialogs="clr-namespace:Avalonia.Dialogs;assembly=Avalonia.Dialogs"
|
||||
xmlns:internal="clr-namespace:Avalonia.Dialogs.Internal;assembly=Avalonia.Dialogs"
|
||||
xmlns:iri="https://irihi.tech/shared"
|
||||
xmlns:dialogs="using:Avalonia.Dialogs"
|
||||
xmlns:internal="using:Avalonia.Dialogs.Internal"
|
||||
xmlns:cvt="using:Avalonia.Controls.Converters">
|
||||
<Design.PreviewWith>
|
||||
<Border
|
||||
@@ -14,11 +14,11 @@
|
||||
</Border>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<converters:KeyToPathConverter x:Key="Icons">
|
||||
<iri:ResourceConverter x:Key="Icons">
|
||||
<StreamGeometry x:Key="Icon_Folder">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</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icon_File">M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M15,18V16H6V18H15M18,14V12H6V14H18Z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icon_Volume">M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2M12,4A6,6 0 0,0 6,10C6,13.31 8.69,16 12.1,16L11.22,13.77C10.95,13.29 11.11,12.68 11.59,12.4L12.45,11.9C12.93,11.63 13.54,11.79 13.82,12.27L15.74,14.69C17.12,13.59 18,11.9 18,10A6,6 0 0,0 12,4M12,9A1,1 0 0,1 13,10A1,1 0 0,1 12,11A1,1 0 0,1 11,10A1,1 0 0,1 12,9M7,18A1,1 0 0,0 6,19A1,1 0 0,0 7,20A1,1 0 0,0 8,19A1,1 0 0,0 7,18M12.09,13.27L14.58,19.58L17.17,18.08L12.95,12.77L12.09,13.27Z</StreamGeometry>
|
||||
</converters:KeyToPathConverter>
|
||||
</iri:ResourceConverter>
|
||||
<ControlTheme x:Key="{x:Type dialogs:ManagedFileChooser}" TargetType="dialogs:ManagedFileChooser">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate x:DataType="internal:ManagedFileChooserViewModel" TargetType="dialogs:ManagedFileChooser">
|
||||
@@ -77,7 +77,7 @@
|
||||
<TextBox
|
||||
IsVisible="{Binding !SelectingFolder}"
|
||||
Text="{Binding FileName}"
|
||||
Watermark="{DynamicResource STRING_CHOOSER_FILE_NAME}" />
|
||||
PlaceholderText="{DynamicResource STRING_CHOOSER_FILE_NAME}" />
|
||||
</DockPanel>
|
||||
<CheckBox
|
||||
VerticalAlignment="Center"
|
||||
|
||||
@@ -54,4 +54,17 @@
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme
|
||||
x:Key="HorizontalMenuFlyoutPresenter"
|
||||
TargetType="MenuFlyoutPresenter"
|
||||
BasedOn="{StaticResource {x:Type MenuFlyoutPresenter}}">
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="MinWidth" Value="{DynamicResource HorizontalMenuFlyoutThemeMinWidth}" />
|
||||
<Setter Property="ItemsPanel">
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
94
src/Semi.Avalonia/Controls/NavigationPage.axaml
Normal file
94
src/Semi.Avalonia/Controls/NavigationPage.axaml
Normal file
@@ -0,0 +1,94 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<NavigationPage Width="400" Height="300" />
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ControlTheme x:Key="{x:Type NavigationPage}" TargetType="NavigationPage">
|
||||
<Setter Property="Background" Value="{DynamicResource NavigationPageBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource NavigationPageForeground}" />
|
||||
<Setter Property="BarHeight" Value="{DynamicResource NavigationPageBarMinHeight}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="NavigationPage">
|
||||
<Grid RowDefinitions="Auto,*,Auto" Background="{TemplateBinding Background}">
|
||||
<!-- Top command bar -->
|
||||
<ContentPresenter
|
||||
Name="PART_TopCommandBar"
|
||||
Grid.Row="0" />
|
||||
|
||||
<!-- Content host (pages + navigation bar) -->
|
||||
<Panel Name="PART_ContentHost" Grid.Row="1">
|
||||
<!-- Previous page (back animation target) -->
|
||||
<ContentPresenter Name="PART_PageBackPresenter" />
|
||||
|
||||
<!-- Current page -->
|
||||
<ContentPresenter Name="PART_PagePresenter" />
|
||||
|
||||
<!-- Modal back page -->
|
||||
<ContentPresenter Name="PART_ModalBackPresenter" />
|
||||
|
||||
<!-- Modal page -->
|
||||
<ContentPresenter Name="PART_ModalPresenter" />
|
||||
|
||||
<!-- Navigation bar (overlaid on content by default) -->
|
||||
<Border
|
||||
Name="PART_NavigationBar"
|
||||
MinHeight="{TemplateBinding BarHeight}"
|
||||
Padding="{DynamicResource NavigationPageBarPadding}"
|
||||
VerticalAlignment="Top"
|
||||
Background="{DynamicResource NavigationPageBarBackground}"
|
||||
BorderBrush="{DynamicResource NavigationPageBarBorderBrush}"
|
||||
BorderThickness="{DynamicResource NavigationPageBarBorderThickness}">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<Button
|
||||
Name="PART_BackButton"
|
||||
Grid.Column="0"
|
||||
MinHeight="{DynamicResource NavigationPageBarMinHeight}"
|
||||
MinWidth="{DynamicResource NavigationPageBarMinHeight}"
|
||||
Padding="8"
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{TemplateBinding IsBackButtonEffectivelyVisible}"
|
||||
Background="{DynamicResource NavigationPageBackButtonBackground}"
|
||||
Theme="{StaticResource BorderlessButton}">
|
||||
<Panel Background="Transparent">
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Classes="Large"
|
||||
Data="{DynamicResource NavigationPageBackButtonGlyph}"
|
||||
Foreground="{DynamicResource NavigationPageBackButtonForeground}"
|
||||
IsVisible="{Binding CurrentPage?.(NavigationPage.BackButtonContent), RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNull}, FallbackValue=False}" />
|
||||
<ContentPresenter
|
||||
Content="{Binding CurrentPage?.(NavigationPage.BackButtonContent), RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}"
|
||||
IsVisible="{Binding CurrentPage?.(NavigationPage.BackButtonContent), RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}, FallbackValue=False}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" />
|
||||
</Panel>
|
||||
</Button>
|
||||
<ContentPresenter
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</Panel>
|
||||
|
||||
<!-- Bottom command bar -->
|
||||
<ContentPresenter
|
||||
Name="PART_BottomCommandBar"
|
||||
Grid.Row="2" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- Navigation bar is inset (content flows under the bar) -->
|
||||
<Style Selector="^:nav-bar-inset /template/ Border#PART_NavigationBar">
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
</Style>
|
||||
|
||||
<!-- Compact navigation bar -->
|
||||
<Style Selector="^:nav-bar-compact /template/ Border#PART_NavigationBar">
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -6,6 +6,7 @@
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownDefaultHeight}" />
|
||||
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="NumericUpDown">
|
||||
<DataValidationErrors>
|
||||
@@ -38,7 +39,8 @@
|
||||
Theme="{DynamicResource NonErrorTextBox}"
|
||||
InnerLeftContent="{TemplateBinding InnerLeftContent}"
|
||||
InnerRightContent="{TemplateBinding InnerRightContent}"
|
||||
Watermark="{TemplateBinding Watermark}" />
|
||||
PlaceholderForeground="{TemplateBinding PlaceholderForeground}"
|
||||
PlaceholderText="{TemplateBinding PlaceholderText}" />
|
||||
</ButtonSpinner>
|
||||
</DataValidationErrors>
|
||||
</ControlTemplate>
|
||||
@@ -50,6 +52,15 @@
|
||||
<Style Selector="^.Small">
|
||||
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownSmallHeight}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.Split">
|
||||
<Style Selector="^ /template/ ButtonSpinner#PART_Spinner">
|
||||
<Setter Property="Theme" Value="{DynamicResource SplitButtonSpinner}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ TextBox#PART_TextBox">
|
||||
<Setter Property="CornerRadius" Value="0" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:error">
|
||||
<Style Selector="^ /template/ TextBox#PART_TextBox">
|
||||
|
||||
130
src/Semi.Avalonia/Controls/PipsPager.axaml
Normal file
130
src/Semi.Avalonia/Controls/PipsPager.axaml
Normal file
@@ -0,0 +1,130 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Design.PreviewWith>
|
||||
<StackPanel Margin="20" >
|
||||
<PipsPager NumberOfPages="10" />
|
||||
</StackPanel>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ControlTheme x:Key="PipsPagerButton" TargetType="Button">
|
||||
<Setter Property="Width" Value="24" />
|
||||
<Setter Property="Height" Value="24" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource PipsPagerButtonForeground}" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Button">
|
||||
<PathIcon
|
||||
Theme="{DynamicResource InnerPathIcon}"
|
||||
Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Data="{TemplateBinding Content}"
|
||||
Foreground="{TemplateBinding Foreground}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover /template/ PathIcon">
|
||||
<Setter Property="Foreground" Value="{DynamicResource PipsPagerButtonPointeroverForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="PipsPagerIndicatorDotListBoxItem" TargetType="ListBoxItem">
|
||||
<Setter Property="Foreground" Value="{DynamicResource PipsPagerIndicatorForeground}" />
|
||||
<Setter Property="Margin" Value="4" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Ellipse
|
||||
Name="Container"
|
||||
Width="{DynamicResource CarouselIndicatorDotWidth}"
|
||||
Height="{DynamicResource CarouselIndicatorDotHeight}"
|
||||
Fill="{TemplateBinding Foreground}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Foreground" Value="{DynamicResource PipsPagerIndicatorPointeroverForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Foreground" Value="{DynamicResource PipsPagerIndicatorPressedForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:selected">
|
||||
<Setter Property="Foreground" Value="{DynamicResource PipsPagerIndicatorSelectedForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type PipsPager}" TargetType="PipsPager">
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="PreviousButtonTheme" Value="{StaticResource PipsPagerButton}" />
|
||||
<Setter Property="NextButtonTheme" Value="{StaticResource PipsPagerButton}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<StackPanel
|
||||
Name="PART_RootPanel"
|
||||
Orientation="{TemplateBinding Orientation}"
|
||||
Background="{TemplateBinding Background}"
|
||||
ClipToBounds="False">
|
||||
<Button
|
||||
Name="PART_PreviousButton"
|
||||
Theme="{TemplateBinding PreviousButtonTheme}"
|
||||
IsVisible="{TemplateBinding IsPreviousButtonVisible}"
|
||||
Foreground="{DynamicResource PipsPagerButtonForeground}"
|
||||
Content="{StaticResource SemiIconSmallTriangleLeft}" />
|
||||
|
||||
<ListBox
|
||||
Name="PART_PipsPagerList"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Hidden"
|
||||
ItemsSource="{Binding TemplateSettings.Pips, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
SelectedIndex="{TemplateBinding SelectedPageIndex, Mode=TwoWay}"
|
||||
AutoScrollToSelectedItem="False"
|
||||
ItemContainerTheme="{StaticResource PipsPagerIndicatorDotListBoxItem}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="{Binding $parent[PipsPager].Orientation}" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
</ListBox>
|
||||
|
||||
<Button
|
||||
Name="PART_NextButton"
|
||||
Theme="{TemplateBinding NextButtonTheme}"
|
||||
Foreground="{DynamicResource PipsPagerButtonForeground}"
|
||||
Content="{StaticResource SemiIconSmallTriangleRight}"
|
||||
IsVisible="{TemplateBinding IsNextButtonVisible}" />
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:horizontal /template/ StackPanel#PART_RootPanel">
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:vertical">
|
||||
|
||||
<Style Selector="^ /template/ StackPanel#PART_RootPanel">
|
||||
<Setter Property="Orientation" Value="Vertical" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Button#PART_PreviousButton">
|
||||
<Setter Property="Content" Value="{DynamicResource SemiIconSmallTriangleTop}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Button#PART_NextButton">
|
||||
<Setter Property="Content" Value="{DynamicResource SemiIconSmallTriangleDown}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:first-page /template/ Button#PART_PreviousButton">
|
||||
<Setter Property="Opacity" Value="0" />
|
||||
<Setter Property="IsHitTestVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:last-page /template/ Button#PART_NextButton">
|
||||
<Setter Property="Opacity" Value="0" />
|
||||
<Setter Property="IsHitTestVisible" Value="False" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -13,7 +13,7 @@
|
||||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
||||
<Panel>
|
||||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
|
||||
<VisualLayerManager IsPopup="True">
|
||||
<VisualLayerManager Name="PART_VisualLayerManager">
|
||||
<LayoutTransformControl Name="PART_LayoutTransform">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
@@ -37,7 +37,7 @@
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
||||
<VisualLayerManager IsPopup="True">
|
||||
<VisualLayerManager Name="PART_VisualLayerManager">
|
||||
<LayoutTransformControl Name="PART_LayoutTransform">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
|
||||
@@ -1,90 +1,57 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="using:Avalonia.Controls.Converters"
|
||||
xmlns:semiConverters="clr-namespace:Semi.Avalonia.Converters">
|
||||
xmlns:semi="https://irihi.tech/semi"
|
||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
||||
<Design.PreviewWith>
|
||||
<StackPanel Margin="20" Spacing="20">
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
IsIndeterminate="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Left"
|
||||
IsIndeterminate="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Left"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Right"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<StackPanel
|
||||
HorizontalAlignment="Left"
|
||||
Orientation="Horizontal"
|
||||
Spacing="20">
|
||||
<ProgressBar
|
||||
Classes="Left"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Classes="Right"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Classes="Left"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="False"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
IsIndeterminate="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
IsIndeterminate="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="False"
|
||||
Value="20" />
|
||||
<StackPanel Width="400" Margin="20">
|
||||
<ProgressBar />
|
||||
<ProgressBar Value="20" />
|
||||
<ProgressBar Value="50" Classes="Success" />
|
||||
<ProgressBar Value="80" Classes="Warning" />
|
||||
<ProgressBar Value="100" Classes="Error" />
|
||||
<ProgressBar ShowProgressText="True" />
|
||||
<ProgressBar Value="20" ShowProgressText="True" />
|
||||
<ProgressBar Value="50" Classes="Success" ShowProgressText="True" />
|
||||
<ProgressBar Value="80" Classes="Warning" ShowProgressText="True" />
|
||||
<ProgressBar Value="100" Classes="Error" ShowProgressText="True" />
|
||||
<ProgressBar Classes="Left" ShowProgressText="True" />
|
||||
<ProgressBar Value="20" Classes="Left" ShowProgressText="True" />
|
||||
<ProgressBar Value="50" Classes="Left Success" ShowProgressText="True" />
|
||||
<ProgressBar Value="80" Classes="Left Warning" ShowProgressText="True" />
|
||||
<ProgressBar Value="100" Classes="Left Error" ShowProgressText="True" />
|
||||
<ProgressBar Classes="Right" ShowProgressText="True" />
|
||||
<ProgressBar Value="20" Classes="Right" ShowProgressText="True" />
|
||||
<ProgressBar Value="50" Classes="Right Success" ShowProgressText="True" />
|
||||
<ProgressBar Value="80" Classes="Right Warning" ShowProgressText="True" />
|
||||
<ProgressBar Value="100" Classes="Right Error" ShowProgressText="True" />
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="ProgressBar">
|
||||
<Setter Property="Orientation" Value="Vertical" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<ProgressBar />
|
||||
<ProgressBar Value="20" />
|
||||
<ProgressBar Value="50" Classes="Success" />
|
||||
<ProgressBar Value="80" Classes="Warning" />
|
||||
<ProgressBar Value="100" Classes="Error" />
|
||||
<ProgressBar ShowProgressText="True" />
|
||||
<ProgressBar Value="20" ShowProgressText="True" />
|
||||
<ProgressBar Value="50" Classes="Success" ShowProgressText="True" />
|
||||
<ProgressBar Value="80" Classes="Warning" ShowProgressText="True" />
|
||||
<ProgressBar Value="100" Classes="Error" ShowProgressText="True" />
|
||||
<ProgressBar Classes="Top" ShowProgressText="True" />
|
||||
<ProgressBar Value="20" Classes="Top" ShowProgressText="True" />
|
||||
<ProgressBar Value="50" Classes="Top Success" ShowProgressText="True" />
|
||||
<ProgressBar Value="80" Classes="Top Warning" ShowProgressText="True" />
|
||||
<ProgressBar Value="100" Classes="Top Error" ShowProgressText="True" />
|
||||
<ProgressBar Classes="Bottom" ShowProgressText="True" />
|
||||
<ProgressBar Value="20" Classes="Bottom" ShowProgressText="True" />
|
||||
<ProgressBar Value="50" Classes="Bottom Success" ShowProgressText="True" />
|
||||
<ProgressBar Value="80" Classes="Bottom Warning" ShowProgressText="True" />
|
||||
<ProgressBar Value="100" Classes="Bottom Error" ShowProgressText="True" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Design.PreviewWith>
|
||||
@@ -115,7 +82,7 @@
|
||||
<Panel Name="DeterminateRoot" Opacity="1">
|
||||
<Panel.Transitions>
|
||||
<Transitions>
|
||||
<DoubleTransition Property="Opacity" Duration="0:0:0.197" />
|
||||
<DoubleTransition Property="Opacity" Duration="0:0:0.2" />
|
||||
</Transitions>
|
||||
</Panel.Transitions>
|
||||
<Border
|
||||
@@ -127,7 +94,7 @@
|
||||
<Panel Name="IndeterminateRoot" Opacity="0">
|
||||
<Panel.Transitions>
|
||||
<Transitions>
|
||||
<DoubleTransition Property="Opacity" Duration="0:0:0.197" />
|
||||
<DoubleTransition Property="Opacity" Duration="0:0:0.2" />
|
||||
</Transitions>
|
||||
</Panel.Transitions>
|
||||
<Border
|
||||
@@ -158,7 +125,7 @@
|
||||
<TextBlock.Text>
|
||||
<MultiBinding Converter="{StaticResource StringFormatConverter}">
|
||||
<TemplateBinding Property="ProgressTextFormat" />
|
||||
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
<TemplateBinding Property="Value" />
|
||||
<TemplateBinding Property="Percentage" />
|
||||
<TemplateBinding Property="Minimum" />
|
||||
<TemplateBinding Property="Maximum" />
|
||||
@@ -191,155 +158,159 @@
|
||||
<Style Selector="^.Error">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarErrorForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:horizontal /template/ Border#PART_Indicator">
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
<Style Selector="^:vertical /template/ Border#PART_Indicator">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:horizontal">
|
||||
<Setter Property="MinWidth" Value="200" />
|
||||
<Setter Property="MinHeight" Value="4" />
|
||||
<Style Selector="^ /template/ Border#PART_Indicator">
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator">
|
||||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator2">
|
||||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.Left,^.Top">
|
||||
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="Grid.Row" Value="1" />
|
||||
<Setter Property="Margin" Value="0 0 16 0" />
|
||||
<Setter Property="MinWidth" Value="45" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Border#ProgressBarRoot">
|
||||
<Setter Property="MinHeight" Value="4" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.Right,^.Bottom">
|
||||
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||
<Setter Property="Grid.Column" Value="2" />
|
||||
<Setter Property="Grid.Row" Value="1" />
|
||||
<Setter Property="Margin" Value="16 0 0 0" />
|
||||
<Setter Property="MinWidth" Value="45" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Border#ProgressBarRoot">
|
||||
<Setter Property="MinHeight" Value="4" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:vertical">
|
||||
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||
<Setter Property="LayoutTransform">
|
||||
<RotateTransform Angle="90" />
|
||||
</Setter>
|
||||
</Style>
|
||||
<Setter Property="MinWidth" Value="4" />
|
||||
<Setter Property="MinHeight" Value="200" />
|
||||
</Style>
|
||||
<Style Selector="^:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||
<Setter Property="LayoutTransform">
|
||||
<RotateTransform Angle="90" />
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="^:indeterminate /template/ Panel#DeterminateRoot">
|
||||
<Setter Property="Opacity" Value="0" />
|
||||
</Style>
|
||||
<Style Selector="^:indeterminate /template/ Panel#IndeterminateRoot">
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
</Style>
|
||||
<Style Selector="^:horizontal:indeterminate /template/ Border#IndeterminateProgressBarIndicator">
|
||||
<Style.Animations>
|
||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationStartPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:1.5">
|
||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
<Style Selector="^:horizontal:indeterminate /template/ Border#IndeterminateProgressBarIndicator2">
|
||||
<Style.Animations>
|
||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0.75">
|
||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationEndPosition}" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
<Style Selector="^:vertical:indeterminate /template/ Border#IndeterminateProgressBarIndicator">
|
||||
<Style.Animations>
|
||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationStartPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:1.5">
|
||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
<Style Selector="^:vertical:indeterminate /template/ Border#IndeterminateProgressBarIndicator2">
|
||||
<Style.Animations>
|
||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0.75">
|
||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationEndPosition}" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator">
|
||||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator2">
|
||||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" />
|
||||
</Style>
|
||||
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator">
|
||||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator2">
|
||||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" />
|
||||
</Style>
|
||||
<Style Selector="^.Left">
|
||||
<Style Selector="^:horizontal /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="Grid.Row" Value="1" />
|
||||
<Setter Property="Margin" Value="4 0" />
|
||||
<Style Selector="^ /template/ Border#PART_Indicator">
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
</Style>
|
||||
<Style Selector="^:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="Grid.Row" Value="0" />
|
||||
<Setter Property="Margin" Value="0 4" />
|
||||
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator">
|
||||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^:horizontal /template/ Border#ProgressBarRoot">
|
||||
<Setter Property="MinHeight" Value="4" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator2">
|
||||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" />
|
||||
</Style>
|
||||
<Style Selector="^:vertical /template/ Border#ProgressBarRoot">
|
||||
<Setter Property="MinWidth" Value="4" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Style Selector="^.Left,^.Top">
|
||||
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="Grid.Row" Value="0" />
|
||||
<Setter Property="Margin" Value="0 0 0 16" />
|
||||
<Setter Property="MinHeight" Value="45" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Border#ProgressBarRoot">
|
||||
<Setter Property="MinWidth" Value="4" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^ /template/ TextBlock#PART_ProgressText">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarOuterTextForeground}" />
|
||||
<Style Selector="^.Right,^.Bottom">
|
||||
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="Grid.Row" Value="2" />
|
||||
<Setter Property="Margin" Value="0 16 0 0" />
|
||||
<Setter Property="MinHeight" Value="45" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Border#ProgressBarRoot">
|
||||
<Setter Property="MinWidth" Value="4" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.Right">
|
||||
<Style Selector="^:horizontal /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||
<Setter Property="Grid.Column" Value="2" />
|
||||
<Setter Property="Grid.Row" Value="1" />
|
||||
<Setter Property="Margin" Value="4 0" />
|
||||
|
||||
<Style Selector="^:indeterminate">
|
||||
<Style Selector="^ /template/ Panel#DeterminateRoot">
|
||||
<Setter Property="Opacity" Value="0" />
|
||||
</Style>
|
||||
<Style Selector="^:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="Grid.Row" Value="2" />
|
||||
<Setter Property="Margin" Value="0 4" />
|
||||
<Style Selector="^ /template/ Panel#IndeterminateRoot">
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
</Style>
|
||||
<Style Selector="^:horizontal /template/ Border#ProgressBarRoot">
|
||||
<Setter Property="MinHeight" Value="4" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator">
|
||||
<Style.Animations>
|
||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationStartPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:1.5">
|
||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
<Style Selector="^:vertical /template/ Border#ProgressBarRoot">
|
||||
<Setter Property="MinWidth" Value="4" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator2">
|
||||
<Style.Animations>
|
||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0.75">
|
||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationEndPosition}" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
<Style Selector="^ /template/ TextBlock#PART_ProgressText">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarOuterTextForeground}" />
|
||||
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator">
|
||||
<Style.Animations>
|
||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationStartPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:1.5">
|
||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator2">
|
||||
<Style.Animations>
|
||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0.75">
|
||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
||||
</KeyFrame>
|
||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationEndPosition}" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<semiConverters:PositionToAngleConverter x:Key="AngleConverter" />
|
||||
|
||||
<ControlTheme x:Key="ProgressRing" TargetType="ProgressBar">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarIndicatorBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ProgressBarBackground}" />
|
||||
@@ -365,8 +336,7 @@
|
||||
StrokeJoin="Round"
|
||||
StrokeLineCap="Round"
|
||||
StrokeThickness="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
SweepAngle="{TemplateBinding Percentage,
|
||||
Converter={StaticResource AngleConverter}}" />
|
||||
SweepAngle="{TemplateBinding Percentage,Converter={semi:PositionToAngleConverter}}" />
|
||||
<Arc
|
||||
Name="IndeterminateIndicator"
|
||||
Opacity="0"
|
||||
@@ -376,8 +346,7 @@
|
||||
StrokeJoin="Round"
|
||||
StrokeLineCap="Round"
|
||||
StrokeThickness="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
SweepAngle="{TemplateBinding Percentage,
|
||||
Converter={StaticResource AngleConverter}}" />
|
||||
SweepAngle="{TemplateBinding Percentage,Converter={semi:PositionToAngleConverter}}" />
|
||||
<TextBlock
|
||||
Name="PART_ProgressText"
|
||||
HorizontalAlignment="Center"
|
||||
@@ -443,4 +412,4 @@
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary>
|
||||
@@ -1,7 +1,6 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<StackPanel>
|
||||
<ScrollBar Width="200" Orientation="Horizontal" />
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:iri="https://irihi.tech/shared">
|
||||
<Design.PreviewWith>
|
||||
<StackPanel Width="500" Height="500" Margin="20" Spacing="8">
|
||||
<SplitButton
|
||||
Theme="{DynamicResource SolidSplitButton}"
|
||||
Theme="{DynamicResource OutlineSplitButton}"
|
||||
Classes="Danger"
|
||||
CornerRadius="12"
|
||||
Content="Hello" />
|
||||
<ToggleSplitButton
|
||||
IsChecked="True"
|
||||
@@ -73,47 +76,40 @@
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="SplitButton">
|
||||
<Border
|
||||
BackgroundSizing="OuterBorderEdge"
|
||||
ClipToBounds="True"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<DockPanel>
|
||||
<Button
|
||||
Name="PART_SecondaryButton"
|
||||
Padding="4,0"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="0"
|
||||
DockPanel.Dock="Right"
|
||||
Theme="{DynamicResource SemiSplitButtonElement}">
|
||||
<PathIcon
|
||||
Theme="{DynamicResource InnerPathIcon}"
|
||||
Data="{DynamicResource SplitButtonIconGlyph}"
|
||||
Foreground="{Binding $parent[Button].Foreground}" />
|
||||
</Button>
|
||||
<Rectangle
|
||||
Name="SeparatorBorder"
|
||||
Width="{DynamicResource SplitButtonSeparatorWidth}"
|
||||
VerticalAlignment="Stretch"
|
||||
DockPanel.Dock="Right"
|
||||
Fill="Transparent"
|
||||
StrokeThickness="0" />
|
||||
<Button
|
||||
Name="PART_PrimaryButton"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Command="{TemplateBinding Command}"
|
||||
CommandParameter="{TemplateBinding CommandParameter}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="0"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Theme="{DynamicResource SemiSplitButtonElement}" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
<Grid
|
||||
ColumnDefinitions="*,Auto"
|
||||
ColumnSpacing="{DynamicResource SplitButtonSeparatorWidth}">
|
||||
<Button
|
||||
Name="PART_PrimaryButton"
|
||||
Grid.Column="0"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Command="{TemplateBinding Command}"
|
||||
CommandParameter="{TemplateBinding CommandParameter}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Left}}"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Theme="{DynamicResource SemiSplitButtonElement}" />
|
||||
<Button
|
||||
Name="PART_SecondaryButton"
|
||||
Grid.Column="1"
|
||||
Padding="0"
|
||||
MinHeight="{TemplateBinding MinHeight}"
|
||||
MinWidth="{Binding $self.MinHeight}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Right}}"
|
||||
Theme="{DynamicResource SemiSplitButtonElement}">
|
||||
<PathIcon
|
||||
Theme="{DynamicResource InnerPathIcon}"
|
||||
Data="{DynamicResource SplitButtonIconGlyph}"
|
||||
Foreground="{Binding $parent[Button].Foreground}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<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"
|
||||
x:CompileBindings="True">
|
||||
<ControlTheme x:Key="{x:Type SplitView}" TargetType="SplitView">
|
||||
<Setter Property="OpenPaneLength" Value="{DynamicResource SplitViewOpenPaneThemeLength}" />
|
||||
<Setter Property="CompactPaneLength" Value="{DynamicResource SplitViewCompactPaneThemeLength}" />
|
||||
@@ -49,7 +52,7 @@
|
||||
<Style Selector="^:overlay">
|
||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
||||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="2" />
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
||||
@@ -72,8 +75,7 @@
|
||||
|
||||
<Style Selector="^:compactoverlay">
|
||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
||||
<!-- ColumnSpan should be 2 -->
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="2" />
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
||||
</Style>
|
||||
|
||||
@@ -36,13 +36,19 @@
|
||||
ItemsPanel="{TemplateBinding ItemsPanel}" />
|
||||
<Border Name="PART_BorderSeparator" />
|
||||
</Panel>
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding SelectedContent}"
|
||||
ContentTemplate="{TemplateBinding SelectedContentTemplate}" />
|
||||
<Panel ClipToBounds="True">
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost2"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
IsVisible="False" />
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Panel>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
@@ -149,13 +155,19 @@
|
||||
Name="PART_ItemsPresenter"
|
||||
ItemsPanel="{TemplateBinding ItemsPanel}" />
|
||||
</Panel>
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding SelectedContent}"
|
||||
ContentTemplate="{TemplateBinding SelectedContentTemplate}" />
|
||||
<Panel ClipToBounds="True">
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost2"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
IsVisible="False" />
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Panel>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
@@ -200,13 +212,19 @@
|
||||
</ScrollViewer>
|
||||
<Border Name="PART_BorderSeparator" />
|
||||
</Panel>
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding SelectedContent}"
|
||||
ContentTemplate="{TemplateBinding SelectedContentTemplate}" />
|
||||
<Panel ClipToBounds="True">
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost2"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
IsVisible="False" />
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Panel>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
@@ -335,13 +353,19 @@
|
||||
ItemsPanel="{TemplateBinding ItemsPanel}" />
|
||||
</ScrollViewer>
|
||||
</Panel>
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding SelectedContent}"
|
||||
ContentTemplate="{TemplateBinding SelectedContentTemplate}" />
|
||||
<Panel ClipToBounds="True">
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost2"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
IsVisible="False" />
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Panel>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
|
||||
@@ -6,16 +6,12 @@
|
||||
Width="400"
|
||||
Height="400"
|
||||
Margin="20">
|
||||
<TabItem Theme="{DynamicResource CardTabItem}" Header="文档" Icon="{StaticResource SemiIconFile}" />
|
||||
<TabControl TabStripPlacement="Top" Theme="{DynamicResource LineTabControl}">
|
||||
<TabItem Header="文档">
|
||||
<TextBlock Text="Content1" />
|
||||
</TabItem>
|
||||
<TabItem Header="快速起步">
|
||||
<TextBlock Text="Content2" />
|
||||
</TabItem>
|
||||
<TabItem Header="帮助" IsSelected="True">
|
||||
<TextBlock Text="Content3" />
|
||||
</TabItem>
|
||||
<TabItem Content="Hello 1" Header="文档" Icon="{StaticResource SemiIconFile}" />
|
||||
<TabItem Content="Hello 2" Header="快速起步" Icon="{StaticResource SemiIconGlobe}" />
|
||||
<TabItem Content="Hello 4" Header="无效" Icon="{StaticResource SemiIconClear}" IsEnabled="False" />
|
||||
<TabItem Content="Hello 3" Header="帮助" Icon="{StaticResource SemiIconHelpCircle}" />
|
||||
</TabControl>
|
||||
</StackPanel>
|
||||
</Design.PreviewWith>
|
||||
@@ -25,20 +21,39 @@
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemLinePipeBackground}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="TabItem">
|
||||
<ContentPresenter
|
||||
Name="PART_HeaderPresenter"
|
||||
<Border
|
||||
Name="PART_RootBorder"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Foreground="{TemplateBinding Foreground}" />
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<DockPanel HorizontalSpacing="{DynamicResource TabItemIconHeaderSpacing}">
|
||||
<ContentPresenter
|
||||
Name="PART_IconPresenter"
|
||||
DockPanel.Dock="Left"
|
||||
Content="{TemplateBinding Icon}"
|
||||
ContentTemplate="{TemplateBinding IconTemplate}"
|
||||
IsVisible="{Binding $self.Content, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||
<ContentPresenter.DataTemplates>
|
||||
<DataTemplate DataType="Geometry">
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ContentPresenter.DataTemplates>
|
||||
</ContentPresenter>
|
||||
<ContentPresenter
|
||||
Name="PART_HeaderPresenter"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Foreground="{TemplateBinding Foreground}" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
@@ -46,17 +61,31 @@
|
||||
<Setter Property="RecognizesAccessKey" Value="True" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Setter Property="FontWeight" Value="{DynamicResource TabItemSelectedFontWeight}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderSelectedForeground}" />
|
||||
<Style Selector="^:selected">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Setter Property="FontWeight" Value="{DynamicResource TabItemSelectedFontWeight}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderSelectedForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabItemIconSelectedForeground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:not(:selected)">
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderPointeroverForeground}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter,^ /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderPointeroverForeground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter,^ /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabItemHeaderDisabledForeground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme
|
||||
@@ -65,15 +94,15 @@
|
||||
TargetType="TabItem">
|
||||
<Setter Property="Padding" Value="8 4" />
|
||||
|
||||
<Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:selected /template/ Border#PART_RootBorder">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipeSelectedBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:not(:selected)">
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:pointerover /template/ Border#PART_RootBorder">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:pressed /template/ Border#PART_RootBorder">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
@@ -98,27 +127,27 @@
|
||||
x:Key="LineTabItem"
|
||||
BasedOn="{StaticResource BaseTabItem}"
|
||||
TargetType="TabItem">
|
||||
<Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:selected /template/ Border#PART_RootBorder">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipeSelectedBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Left], ^[TabStripPlacement=Right]">
|
||||
<Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:selected /template/ Border#PART_RootBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemLineHeaderSelectedBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:not(:selected)">
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:pointerover /template/ Border#PART_RootBorder">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:pressed /template/ Border#PART_RootBorder">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Left], ^[TabStripPlacement=Right]">
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:pointerover /template/ Border#PART_RootBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemLineHeaderPointeroverBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:pressed /template/ Border#PART_RootBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemLineHeaderPressedBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
@@ -150,15 +179,15 @@
|
||||
TargetType="TabItem">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TabControlSeparatorBorderBrush}" />
|
||||
|
||||
<Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:selected /template/ Border#PART_RootBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemCardHeaderSelectedBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:not(:selected)">
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:pointerover /template/ Border#PART_RootBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemCardHeaderPointeroverBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:pressed /template/ Border#PART_RootBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemCardHeaderPressedBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
@@ -207,16 +236,20 @@
|
||||
TargetType="TabItem">
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource SemiBorderRadiusSmall}" />
|
||||
|
||||
<Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabItemButtonHeaderSelectedForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemButtonHeaderSelectedBackground}" />
|
||||
<Style Selector="^:selected">
|
||||
<Style Selector="^ /template/ Border#PART_RootBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemButtonHeaderSelectedBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabItemButtonHeaderSelectedForeground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:not(:selected)">
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:pointerover /template/ Border#PART_RootBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemButtonHeaderPointeroverBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Style Selector="^:pressed /template/ Border#PART_RootBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemButtonHeaderPressedBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
41
src/Semi.Avalonia/Controls/TabbedPage.axaml
Normal file
41
src/Semi.Avalonia/Controls/TabbedPage.axaml
Normal file
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<TabbedPage Width="400" Height="300" />
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ControlTheme x:Key="{x:Type TabbedPage}" TargetType="TabbedPage">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="TabbedPage">
|
||||
<TabControl
|
||||
Name="PART_TabControl"
|
||||
Background="{TemplateBinding Background}"
|
||||
Theme="{StaticResource LineTabControl}"
|
||||
ItemsSource="{TemplateBinding Pages}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
<ControlTheme x:Key="CardTabbedPage" TargetType="TabbedPage">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="TabbedPage">
|
||||
<TabControl
|
||||
Name="PART_TabControl"
|
||||
Background="{TemplateBinding Background}"
|
||||
Theme="{StaticResource CardTabControl}"
|
||||
ItemsSource="{TemplateBinding Pages}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
<ControlTheme x:Key="ButtonTabbedPage" TargetType="TabbedPage">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="TabbedPage">
|
||||
<TabControl
|
||||
Name="PART_TabControl"
|
||||
Background="{TemplateBinding Background}"
|
||||
Theme="{StaticResource ButtonTabControl}"
|
||||
ItemsSource="{TemplateBinding Pages}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -22,8 +22,30 @@
|
||||
IsEnabled="{Binding $parent[TextBox].CanPaste}" />
|
||||
</MenuFlyout>
|
||||
|
||||
<MenuFlyout
|
||||
x:Key="HorizontalTextBoxContextFlyout"
|
||||
ShowMode="{OnFormFactor Desktop=Standard, Mobile=Transient}"
|
||||
FlyoutPresenterTheme="{StaticResource HorizontalMenuFlyoutPresenter}"
|
||||
ItemContainerTheme="{StaticResource TopLevelMenuItem}">
|
||||
<MenuItem
|
||||
Command="{Binding $parent[TextBox].Cut}"
|
||||
Header="{DynamicResource STRING_MENU_CUT}"
|
||||
IsEnabled="{Binding $parent[TextBox].CanCut}"
|
||||
IsVisible="{Binding $parent[TextBox].CanCut}" />
|
||||
<MenuItem
|
||||
Command="{Binding $parent[TextBox].Copy}"
|
||||
Header="{DynamicResource STRING_MENU_COPY}"
|
||||
IsEnabled="{Binding $parent[TextBox].CanCopy}"
|
||||
IsVisible="{Binding $parent[TextBox].CanCopy}" />
|
||||
<MenuItem
|
||||
Command="{Binding $parent[TextBox].Paste}"
|
||||
Header="{DynamicResource STRING_MENU_PASTE}"
|
||||
IsEnabled="{Binding $parent[TextBox].CanPaste}" />
|
||||
</MenuFlyout>
|
||||
|
||||
<ControlTheme x:Key="{x:Type TextBox}" TargetType="TextBox">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
|
||||
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
|
||||
<Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
|
||||
@@ -67,11 +89,11 @@
|
||||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Name="PART_Watermark"
|
||||
Name="PART_Placeholder"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Opacity="0.5"
|
||||
Text="{TemplateBinding Watermark}"
|
||||
Foreground="{TemplateBinding PlaceholderForeground}"
|
||||
Text="{TemplateBinding PlaceholderText}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}">
|
||||
<TextBlock.IsVisible>
|
||||
@@ -133,6 +155,10 @@
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:touch-mode">
|
||||
<Setter Property="ContextFlyout" Value="{StaticResource HorizontalTextBoxContextFlyout}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource TextBoxPointeroverBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxPointeroverBorderBrush}" />
|
||||
@@ -258,6 +284,7 @@
|
||||
|
||||
<ControlTheme x:Key="NonErrorTextBox" TargetType="TextBox">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
|
||||
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
|
||||
<Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
|
||||
@@ -301,11 +328,11 @@
|
||||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Name="PART_Watermark"
|
||||
Name="PART_Placeholder"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Opacity="0.5"
|
||||
Text="{TemplateBinding Watermark}"
|
||||
Foreground="{TemplateBinding PlaceholderForeground}"
|
||||
Text="{TemplateBinding PlaceholderText}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}">
|
||||
<TextBlock.IsVisible>
|
||||
@@ -367,6 +394,10 @@
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:touch-mode">
|
||||
<Setter Property="ContextFlyout" Value="{StaticResource HorizontalTextBoxContextFlyout}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource TextBoxPointeroverBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxPointeroverBorderBrush}" />
|
||||
@@ -492,6 +523,7 @@
|
||||
|
||||
<ControlTheme x:Key="LooklessTextBox" TargetType="TextBox">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
|
||||
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
||||
<Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
|
||||
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" />
|
||||
<Setter Property="CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" />
|
||||
@@ -522,11 +554,11 @@
|
||||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Name="PART_Watermark"
|
||||
Name="PART_Placeholder"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Opacity="0.5"
|
||||
Text="{TemplateBinding Watermark}"
|
||||
Foreground="{TemplateBinding PlaceholderForeground}"
|
||||
Text="{TemplateBinding PlaceholderText}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}">
|
||||
<TextBlock.IsVisible>
|
||||
@@ -571,6 +603,10 @@
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:touch-mode">
|
||||
<Setter Property="ContextFlyout" Value="{StaticResource HorizontalTextBoxContextFlyout}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextBoxDisabledForeground}" />
|
||||
</Style>
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type TitleBar}" TargetType="TitleBar">
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Panel HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="Stretch">
|
||||
<Panel
|
||||
Name="PART_MouseTracker"
|
||||
Height="1"
|
||||
VerticalAlignment="Top" />
|
||||
<Panel Name="PART_Container">
|
||||
<Border
|
||||
Name="PART_Background"
|
||||
Background="{TemplateBinding Background}"
|
||||
IsHitTestVisible="False"
|
||||
Win32Properties.NonClientHitTestResult="Caption" />
|
||||
<CaptionButtons
|
||||
Name="PART_CaptionButtons"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Win32Properties.NonClientHitTestResult="Client" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:fullscreen /template/ Border#PART_Background">
|
||||
<Setter Property="IsHitTestVisible" Value="True" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:fullscreen /template/ Panel#PART_MouseTracker">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:fullscreen /template/ Panel#PART_Container">
|
||||
<Setter Property="RenderTransform" Value="translateY(-50px)" />
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.1" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:fullscreen:pointerover /template/ Panel#PART_Container">
|
||||
<Setter Property="RenderTransform" Value="none" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -1,7 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="clr-namespace:Semi.Avalonia.Converters">
|
||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
||||
|
||||
<Design.PreviewWith>
|
||||
<StackPanel
|
||||
|
||||
@@ -14,10 +14,7 @@
|
||||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
|
||||
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
|
||||
<Panel Margin="{TemplateBinding WindowDecorationMargin}" Background="Transparent" />
|
||||
<VisualLayerManager>
|
||||
<VisualLayerManager.ChromeOverlayLayer>
|
||||
<TitleBar />
|
||||
</VisualLayerManager.ChromeOverlayLayer>
|
||||
<VisualLayerManager Name="PART_VisualLayerManager">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
|
||||
217
src/Semi.Avalonia/Controls/WindowDrawnDecorations.axaml
Normal file
217
src/Semi.Avalonia/Controls/WindowDrawnDecorations.axaml
Normal file
@@ -0,0 +1,217 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<ControlTheme x:Key="CaptionButton" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonForeground}" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="CornerRadius" Value="{StaticResource CaptionButtonCornerRadius}" />
|
||||
<Setter Property="Padding" Value="{StaticResource CaptionButtonPadding}" />
|
||||
<Setter Property="Width" Value="{StaticResource CaptionButtonWidth}" />
|
||||
<Setter Property="Height" Value="{StaticResource CaptionButtonHeight}" />
|
||||
<Setter Property="WindowDecorationProperties.ElementRole" Value="DecorationsElement" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Button">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Foreground="{TemplateBinding Foreground}">
|
||||
<ContentPresenter.DataTemplates>
|
||||
<DataTemplate DataType="Geometry">
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ContentPresenter.DataTemplates>
|
||||
</ContentPresenter>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonPointeroverBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonPressedBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonDisabledForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type WindowDrawnDecorations}" TargetType="WindowDrawnDecorations">
|
||||
<Setter Property="DefaultTitleBarHeight" Value="32" />
|
||||
<Setter Property="DefaultFrameThickness" Value="1" />
|
||||
<Setter Property="DefaultShadowThickness" Value="8" />
|
||||
<Setter Property="Template">
|
||||
<WindowDrawnDecorationsTemplate>
|
||||
<WindowDrawnDecorationsContent>
|
||||
<WindowDrawnDecorationsContent.Underlay>
|
||||
<!-- Full-size: covers shadow area + frame + behind client area -->
|
||||
<Panel Name="PART_UnderlayWrapper">
|
||||
<Border
|
||||
Name="PART_WindowBorder"
|
||||
Background="{DynamicResource WindowBackground}"
|
||||
BorderBrush="{DynamicResource WindowBorderBrush}"
|
||||
BorderThickness="{TemplateBinding FrameThickness}"
|
||||
IsHitTestVisible="False" />
|
||||
<!-- Titlebar: background, title text, and drag area live in underlay -->
|
||||
<Panel Name="PART_TitleBar"
|
||||
VerticalAlignment="Top"
|
||||
Height="{TemplateBinding TitleBarHeight}"
|
||||
Background="{DynamicResource TitleBarBackground}"
|
||||
IsVisible="{TemplateBinding HasTitleBar}"
|
||||
WindowDecorationProperties.ElementRole="TitleBar" />
|
||||
</Panel>
|
||||
</WindowDrawnDecorationsContent.Underlay>
|
||||
|
||||
<WindowDrawnDecorationsContent.Overlay>
|
||||
<!-- Positioned over the titlebar area -->
|
||||
<Panel Name="PART_OverlayWrapper">
|
||||
<!-- Title text lives in overlay so it renders above client content -->
|
||||
<Panel
|
||||
Name="PART_TitleTextPanel"
|
||||
Height="{TemplateBinding TitleBarHeight}"
|
||||
VerticalAlignment="Top"
|
||||
IsHitTestVisible="False"
|
||||
IsVisible="{TemplateBinding HasTitleBar}">
|
||||
<TextBlock
|
||||
Margin="12,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{TemplateBinding Title}" />
|
||||
</Panel>
|
||||
<StackPanel
|
||||
Name="PART_OverlayPanel"
|
||||
Height="{TemplateBinding TitleBarHeight}"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
IsVisible="{TemplateBinding HasTitleBar}"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Name="PART_FullScreenButton"
|
||||
Theme="{StaticResource CaptionButton}"
|
||||
Content="{StaticResource WindowExpandGlyph}"
|
||||
WindowDecorationProperties.ElementRole="FullScreenButton" />
|
||||
<Button
|
||||
Name="PART_MinimizeButton"
|
||||
Theme="{StaticResource CaptionButton}"
|
||||
Content="{StaticResource WindowMinimizeGlyph}"
|
||||
WindowDecorationProperties.ElementRole="MinimizeButton" />
|
||||
<Button
|
||||
Name="PART_MaximizeButton"
|
||||
Theme="{StaticResource CaptionButton}"
|
||||
Content="{StaticResource WindowMaximizeGlyph}"
|
||||
WindowDecorationProperties.ElementRole="MaximizeButton" />
|
||||
<Button
|
||||
Name="PART_CloseButton"
|
||||
Theme="{StaticResource CaptionButton}"
|
||||
Content="{StaticResource WindowCloseIconGlyph}"
|
||||
WindowDecorationProperties.ElementRole="CloseButton" />
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</WindowDrawnDecorationsContent.Overlay>
|
||||
|
||||
<WindowDrawnDecorationsContent.FullscreenPopover>
|
||||
<!-- Shown on hover at top edge in fullscreen -->
|
||||
<DockPanel
|
||||
Height="{TemplateBinding DefaultTitleBarHeight}"
|
||||
Background="{DynamicResource TitleBarBackground}"
|
||||
VerticalAlignment="Top"
|
||||
WindowDecorationProperties.ElementRole="TitleBar">
|
||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
|
||||
<Button
|
||||
Name="PART_PopoverFullScreenButton"
|
||||
Theme="{StaticResource CaptionButton}"
|
||||
Content="{StaticResource WindowCollapseGlyph}"
|
||||
WindowDecorationProperties.ElementRole="FullScreenButton" />
|
||||
<Button
|
||||
Name="PART_PopoverCloseButton"
|
||||
Theme="{StaticResource CaptionButton}"
|
||||
Content="{StaticResource WindowCloseIconGlyph}"
|
||||
WindowDecorationProperties.ElementRole="CloseButton" />
|
||||
</StackPanel>
|
||||
<TextBlock
|
||||
Margin="12,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{TemplateBinding Title}" />
|
||||
</DockPanel>
|
||||
</WindowDrawnDecorationsContent.FullscreenPopover>
|
||||
</WindowDrawnDecorationsContent>
|
||||
</WindowDrawnDecorationsTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^ /template/ Button#PART_CloseButton,^ /template/ Button#PART_PopoverCloseButton">
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonCloseForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonClosePointeroverBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonCloseForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonClosePressedBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Shadow: inset border and add drop shadow -->
|
||||
<Style Selector="^:has-shadow">
|
||||
<Style Selector="^ /template/ Panel#PART_UnderlayWrapper">
|
||||
<Setter Property="Margin" Value="{TemplateBinding ShadowThickness}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Border#PART_WindowBorder">
|
||||
<Setter Property="BoxShadow" Value="{DynamicResource WindowBorderShadow}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Panel#PART_OverlayWrapper">
|
||||
<Setter Property="Margin" Value="{TemplateBinding ShadowThickness}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Maximized: restore button path changes -->
|
||||
<Style Selector="^:maximized /template/ Button#PART_MaximizeButton">
|
||||
<Setter Property="Content" Value="{StaticResource WindowRestoreGlyph}" />
|
||||
</Style>
|
||||
|
||||
<!-- Border: inset titlebar and buttons inside frame -->
|
||||
<Style Selector="^:has-border">
|
||||
<Style Selector="^ /template/ Panel#PART_TitleTextPanel">
|
||||
<Setter Property="Margin" Value="1,1,1,0" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Panel#PART_TitleBar">
|
||||
<Setter Property="Margin" Value="1,1,1,0" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ StackPanel#PART_OverlayPanel">
|
||||
<Setter Property="Margin" Value="0,1,1,0" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Hide caption buttons when the platform does not support the action -->
|
||||
<Style Selector="^:not(:has-minimize) /template/ Button#PART_MinimizeButton">
|
||||
<Setter Property="IsVisible" Value="False"/>
|
||||
</Style>
|
||||
<Style Selector="^:not(:has-maximize) /template/ Button#PART_MaximizeButton">
|
||||
<Setter Property="IsVisible" Value="False"/>
|
||||
</Style>
|
||||
<Style Selector="^:not(:has-fullscreen) /template/ Button#PART_FullScreenButton">
|
||||
<Setter Property="IsVisible" Value="False"/>
|
||||
</Style>
|
||||
<Style Selector="^:not(:has-fullscreen) /template/ Button#PART_PopoverFullScreenButton">
|
||||
<Setter Property="IsVisible" Value="False"/>
|
||||
</Style>
|
||||
|
||||
<!-- Fullscreen: hide overlay and titlebar (popover takes over) -->
|
||||
<Style Selector="^:fullscreen">
|
||||
<Style Selector="^ /template/ Panel#PART_TitleTextPanel">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ StackPanel#PART_OverlayPanel">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Panel#PART_TitleBar">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -6,22 +6,26 @@
|
||||
<ResourceInclude Source="AutoCompleteBox.axaml" />
|
||||
<ResourceInclude Source="Border.axaml" />
|
||||
<ResourceInclude Source="Button.axaml" />
|
||||
<ResourceInclude Source="ContentPage.axaml" />
|
||||
<ResourceInclude Source="ButtonSpinner.axaml" />
|
||||
<ResourceInclude Source="Calendar.axaml" />
|
||||
<ResourceInclude Source="CalendarDatePicker.axaml" />
|
||||
<ResourceInclude Source="CaptionButtons.axaml" />
|
||||
<ResourceInclude Source="Carousel.axaml" />
|
||||
<ResourceInclude Source="CarouselPage.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" />
|
||||
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
||||
<ResourceInclude Source="DropDownButton.axaml" />
|
||||
<ResourceInclude Source="DrawerPage.axaml" />
|
||||
<ResourceInclude Source="EmbeddableControlRoot.axaml" />
|
||||
<ResourceInclude Source="Expander.axaml" />
|
||||
<ResourceInclude Source="FlyoutPresenter.axaml" />
|
||||
<ResourceInclude Source="GridSplitter.axaml" />
|
||||
<ResourceInclude Source="GroupBox.axaml" />
|
||||
<ResourceInclude Source="HeaderedContentControl.axaml" />
|
||||
<ResourceInclude Source="HyperlinkButton.axaml" />
|
||||
<ResourceInclude Source="ItemsControl.axaml" />
|
||||
@@ -32,7 +36,9 @@
|
||||
<ResourceInclude Source="MenuFlyoutPresenter.axaml" />
|
||||
<ResourceInclude Source="NotificationCard.axaml" />
|
||||
<ResourceInclude Source="NumericUpDown.axaml" />
|
||||
<ResourceInclude Source="NavigationPage.axaml" />
|
||||
<ResourceInclude Source="PathIcon.axaml" />
|
||||
<ResourceInclude Source="PipsPager.axaml" />
|
||||
<ResourceInclude Source="Popup.axaml" />
|
||||
<ResourceInclude Source="ProgressBar.axaml" />
|
||||
<ResourceInclude Source="RadioButton.axaml" />
|
||||
@@ -46,17 +52,18 @@
|
||||
<ResourceInclude Source="TabControl.axaml" />
|
||||
<ResourceInclude Source="TabItem.axaml" />
|
||||
<ResourceInclude Source="TabStrip.axaml" />
|
||||
<ResourceInclude Source="TabbedPage.axaml" />
|
||||
<ResourceInclude Source="TextBlock.axaml" />
|
||||
<ResourceInclude Source="TextBox.axaml" />
|
||||
<ResourceInclude Source="ThemeVariantScope.axaml" />
|
||||
<ResourceInclude Source="TimePicker.axaml" />
|
||||
<ResourceInclude Source="TitleBar.axaml" />
|
||||
<ResourceInclude Source="ToggleButton.axaml" />
|
||||
<ResourceInclude Source="ToggleSwitch.axaml" />
|
||||
<ResourceInclude Source="Tooltip.axaml" />
|
||||
<ResourceInclude Source="TransitioningContentControl.axaml" />
|
||||
<ResourceInclude Source="TreeView.axaml" />
|
||||
<ResourceInclude Source="Window.axaml" />
|
||||
<ResourceInclude Source="WindowDrawnDecorations.axaml" />
|
||||
<ResourceInclude Source="WindowNotificationManager.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
@@ -1,26 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using Avalonia;
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Metadata;
|
||||
|
||||
namespace Semi.Avalonia.Converters;
|
||||
|
||||
public class KeyToPathConverter: IValueConverter
|
||||
{
|
||||
[Content]
|
||||
public IDictionary<string, object?> Resources { get; } = new Dictionary<string, object?>();
|
||||
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if(value is string s && Resources.TryGetValue(s, out var v))
|
||||
return v;
|
||||
return AvaloniaProperty.UnsetValue;
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -2,56 +2,36 @@ using System;
|
||||
using System.Globalization;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Data.Converters;
|
||||
using Irihi.Avalonia.Shared.Converters;
|
||||
|
||||
namespace Semi.Avalonia.Converters;
|
||||
|
||||
public class PlacementToRenderTransformOriginConverter: IValueConverter
|
||||
public class PlacementToRenderTransformOriginConverter : MarkupValueConverter
|
||||
{
|
||||
public static PlacementToRenderTransformOriginConverter Instance { get; } = new PlacementToRenderTransformOriginConverter();
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is not PlacementMode p)
|
||||
{
|
||||
return new RelativePoint(0.5, 0.5, RelativeUnit.Relative);
|
||||
}
|
||||
switch (p)
|
||||
{
|
||||
case PlacementMode.Bottom:
|
||||
return new RelativePoint(0.5, 0.0, RelativeUnit.Relative);
|
||||
case PlacementMode.Left:
|
||||
return new RelativePoint(1.0, 0.5, RelativeUnit.Relative);
|
||||
case PlacementMode.Right:
|
||||
return new RelativePoint(0.0, 0.5, RelativeUnit.Relative);
|
||||
case PlacementMode.Top:
|
||||
return new RelativePoint(0.5, 1.0, RelativeUnit.Relative);
|
||||
case PlacementMode.Pointer:
|
||||
return new RelativePoint(0.0, 0.0, RelativeUnit.Relative);
|
||||
case PlacementMode.Center:
|
||||
case PlacementMode.AnchorAndGravity:
|
||||
return new RelativePoint(0.5, 0.5, RelativeUnit.Relative);
|
||||
case PlacementMode.BottomEdgeAlignedLeft:
|
||||
return new RelativePoint(0.0, 0.0, RelativeUnit.Relative);
|
||||
case PlacementMode.BottomEdgeAlignedRight:
|
||||
return new RelativePoint(1.0, 0.0, RelativeUnit.Relative);
|
||||
case PlacementMode.LeftEdgeAlignedTop:
|
||||
return new RelativePoint(1.0, 1.0, RelativeUnit.Relative);
|
||||
case PlacementMode.LeftEdgeAlignedBottom:
|
||||
return new RelativePoint(1.0, 0.0, RelativeUnit.Relative);
|
||||
case PlacementMode.RightEdgeAlignedTop:
|
||||
return new RelativePoint(0.0, 1.0, RelativeUnit.Relative);
|
||||
case PlacementMode.RightEdgeAlignedBottom:
|
||||
return new RelativePoint(0.0, 0.0, RelativeUnit.Relative);
|
||||
case PlacementMode.TopEdgeAlignedLeft:
|
||||
return new RelativePoint(0.0, 1.0, RelativeUnit.Relative);
|
||||
case PlacementMode.TopEdgeAlignedRight:
|
||||
return new RelativePoint(1.0, 1.0, RelativeUnit.Relative);
|
||||
}
|
||||
return new RelativePoint(0.5, 0.5, RelativeUnit.Relative);
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return p switch
|
||||
{
|
||||
PlacementMode.Bottom => new RelativePoint(0.5, 0.0, RelativeUnit.Relative),
|
||||
PlacementMode.Left => new RelativePoint(1.0, 0.5, RelativeUnit.Relative),
|
||||
PlacementMode.Right => new RelativePoint(0.0, 0.5, RelativeUnit.Relative),
|
||||
PlacementMode.Top => new RelativePoint(0.5, 1.0, RelativeUnit.Relative),
|
||||
PlacementMode.Pointer => new RelativePoint(0.0, 0.0, RelativeUnit.Relative),
|
||||
PlacementMode.Center or PlacementMode.AnchorAndGravity => new RelativePoint(0.5, 0.5, RelativeUnit.Relative),
|
||||
PlacementMode.BottomEdgeAlignedLeft => new RelativePoint(0.0, 0.0, RelativeUnit.Relative),
|
||||
PlacementMode.BottomEdgeAlignedRight => new RelativePoint(1.0, 0.0, RelativeUnit.Relative),
|
||||
PlacementMode.LeftEdgeAlignedTop => new RelativePoint(1.0, 1.0, RelativeUnit.Relative),
|
||||
PlacementMode.LeftEdgeAlignedBottom => new RelativePoint(1.0, 0.0, RelativeUnit.Relative),
|
||||
PlacementMode.RightEdgeAlignedTop => new RelativePoint(0.0, 1.0, RelativeUnit.Relative),
|
||||
PlacementMode.RightEdgeAlignedBottom => new RelativePoint(0.0, 0.0, RelativeUnit.Relative),
|
||||
PlacementMode.TopEdgeAlignedLeft => new RelativePoint(0.0, 1.0, RelativeUnit.Relative),
|
||||
PlacementMode.TopEdgeAlignedRight => new RelativePoint(1.0, 1.0, RelativeUnit.Relative),
|
||||
_ => new RelativePoint(0.5, 0.5, RelativeUnit.Relative)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,18 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Avalonia.Data.Converters;
|
||||
using Irihi.Avalonia.Shared.Converters;
|
||||
|
||||
namespace Semi.Avalonia.Converters;
|
||||
|
||||
public class PositionToAngleConverter: IValueConverter
|
||||
public class PositionToAngleConverter : MarkupValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is double d)
|
||||
{
|
||||
return d * 3.6;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return value is double d ? d * 3.6 : 0;
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
public override object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is double d)
|
||||
{
|
||||
return d / 3.6;
|
||||
}
|
||||
return 0;
|
||||
return value is double d ? d / 3.6 : 0;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using Avalonia;
|
||||
using Avalonia.Data.Converters;
|
||||
|
||||
namespace Semi.Avalonia.Converters;
|
||||
|
||||
public class TreeViewItemIndentConverter : IMultiValueConverter
|
||||
{
|
||||
public static readonly TreeViewItemIndentConverter Instance = new();
|
||||
|
||||
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (values.Count > 1 && values[0] is int level && values[1] is double indent)
|
||||
{
|
||||
return new Thickness(indent * level, 0, 0, 0);
|
||||
}
|
||||
|
||||
return new Thickness(0);
|
||||
}
|
||||
}
|
||||
@@ -4,17 +4,18 @@
|
||||
<Styles.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceInclude x:Key="Default" Source="/Schemes/LightScheme.axaml" />
|
||||
<ResourceInclude x:Key="Dark" Source="/Schemes/DarkScheme.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Aquatic}" Source="/Schemes/AquaticScheme.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Desert}" Source="/Schemes/DesertScheme.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Dusk}" Source="/Schemes/DuskScheme.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.NightSky}" Source="/Schemes/NightSkyScheme.axaml" />
|
||||
<ResourceInclude x:Key="Default" Source="/Themes/Light/_index.axaml" />
|
||||
<ResourceInclude x:Key="Light" Source="/Themes/Light/_index.axaml" />
|
||||
<ResourceInclude x:Key="Dark" Source="/Themes/Dark/_index.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Aquatic}" Source="/Themes/HighContrast/_index.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Desert}" Source="/Themes/HighContrast/_index.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Dusk}" Source="/Themes/HighContrast/_index.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.NightSky}" Source="/Themes/HighContrast/_index.axaml" />
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="/Controls/_index.axaml" />
|
||||
<ResourceInclude Source="/Themes/Shared/_index.axaml" />
|
||||
<ResourceInclude Source="/Tokens/Variables.axaml" />
|
||||
<ResourceInclude Source="/Tokens/_index.axaml" />
|
||||
<ResourceInclude Source="/Locale/zh-cn.axaml" />
|
||||
<semi:Icons />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Avalonia.Metadata;
|
||||
|
||||
[assembly:XmlnsPrefix("https://irihi.tech/semi", "semi")]
|
||||
[assembly:XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia")]
|
||||
[assembly: XmlnsPrefix("https://irihi.tech/semi", "semi")]
|
||||
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia")]
|
||||
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia.Converters")]
|
||||
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia.Tokens")]
|
||||
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia.Tokens.Palette")]
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="/Tokens/HighContrast/Aquatic.axaml" />
|
||||
<ResourceInclude Source="/Themes/HighContrast/_index.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
@@ -1,6 +0,0 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="/Tokens/Palette/Dark.axaml" />
|
||||
<ResourceInclude Source="/Themes/Dark/_index.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
@@ -1,6 +0,0 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="/Tokens/HighContrast/Desert.axaml" />
|
||||
<ResourceInclude Source="/Themes/HighContrast/_index.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
@@ -1,6 +0,0 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="/Tokens/HighContrast/Dusk.axaml" />
|
||||
<ResourceInclude Source="/Themes/HighContrast/_index.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
@@ -1,6 +0,0 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="/Tokens/Palette/Light.axaml" />
|
||||
<ResourceInclude Source="/Themes/Light/_index.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
@@ -1,6 +0,0 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="/Tokens/HighContrast/NightSky.axaml" />
|
||||
<ResourceInclude Source="/Themes/HighContrast/_index.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
@@ -1,14 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
|
||||
<Version>11.3.7.3</Version>
|
||||
<PackageReleaseNotes>Update to Semi.Avalonia 11.3.7.3</PackageReleaseNotes>
|
||||
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
||||
<Version>12.0.0-rc2</Version>
|
||||
<PackageReleaseNotes>Update to Semi.Avalonia 12.0.0-rc2</PackageReleaseNotes>
|
||||
<Title>Semi.Avalonia</Title>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia"/>
|
||||
<PackageReference Include="Irihi.Avalonia.Shared"/>
|
||||
<None Include="README.md" Pack="true" PackagePath="\"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -5,19 +5,20 @@
|
||||
<Styles.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceInclude x:Key="Default" Source="/Schemes/LightScheme.axaml" />
|
||||
<ResourceInclude x:Key="Dark" Source="/Schemes/DarkScheme.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Aquatic}" Source="/Schemes/AquaticScheme.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Desert}" Source="/Schemes/DesertScheme.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Dusk}" Source="/Schemes/DuskScheme.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.NightSky}" Source="/Schemes/NightSkyScheme.axaml" />
|
||||
<ResourceInclude x:Key="Default" Source="/Themes/Light/_index.axaml" />
|
||||
<ResourceInclude x:Key="Light" Source="/Themes/Light/_index.axaml" />
|
||||
<ResourceInclude x:Key="Dark" Source="/Themes/Dark/_index.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Aquatic}" Source="/Themes/HighContrast/_index.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Desert}" Source="/Themes/HighContrast/_index.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Dusk}" Source="/Themes/HighContrast/_index.axaml" />
|
||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.NightSky}" Source="/Themes/HighContrast/_index.axaml" />
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="/Controls/_index.axaml" />
|
||||
<ResourceInclude Source="/Themes/Shared/_index.axaml" />
|
||||
<ResourceInclude Source="/Tokens/Variables.axaml" />
|
||||
<ResourceInclude Source="/Tokens/_index.axaml" />
|
||||
<ResourceInclude Source="/Locale/zh-cn.axaml" />
|
||||
<ResourceInclude Source="/Icons/_index.axaml" />
|
||||
<semi:Icons />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Styles.Resources>
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Globalization;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Styling;
|
||||
using Irihi.Avalonia.Shared.Helpers;
|
||||
using Semi.Avalonia.Locale;
|
||||
|
||||
namespace Semi.Avalonia;
|
||||
@@ -36,43 +37,27 @@ public class SemiTheme : Styles
|
||||
|
||||
private static readonly ResourceDictionary DefaultResource = new zh_cn();
|
||||
|
||||
private CultureInfo? _locale;
|
||||
|
||||
public CultureInfo? Locale
|
||||
{
|
||||
get => _locale;
|
||||
get;
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TryGetLocaleResource(value, out var resource) && resource is not null)
|
||||
{
|
||||
_locale = value;
|
||||
if (Resources is ResourceDictionary rd)
|
||||
{
|
||||
rd.SetItems(resource);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var kv in resource) Resources[kv.Key] = kv.Value;
|
||||
}
|
||||
field = value;
|
||||
Resources.BulkSetResources(resource);
|
||||
}
|
||||
else
|
||||
{
|
||||
_locale = new CultureInfo("zh-CN");
|
||||
if (Resources is ResourceDictionary rd)
|
||||
{
|
||||
rd.SetItems(DefaultResource);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var kv in DefaultResource) Resources[kv.Key] = kv.Value;
|
||||
}
|
||||
field = new CultureInfo("zh-CN");
|
||||
Resources.BulkSetResources(DefaultResource);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
_locale = CultureInfo.InvariantCulture;
|
||||
field = CultureInfo.InvariantCulture;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,28 +90,13 @@ public class SemiTheme : Styles
|
||||
{
|
||||
if (culture is null) return;
|
||||
if (!LocaleToResource.TryGetValue(culture, out var resources)) return;
|
||||
|
||||
if (application.Resources is ResourceDictionary rd)
|
||||
{
|
||||
rd.SetItems(resources);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var kv in resources) application.Resources[kv.Key] = kv.Value;
|
||||
}
|
||||
application.Resources.BulkSetResources(resources);
|
||||
}
|
||||
|
||||
public static void OverrideLocaleResources(StyledElement element, CultureInfo? culture)
|
||||
{
|
||||
if (culture is null) return;
|
||||
if (!LocaleToResource.TryGetValue(culture, out var resources)) return;
|
||||
if (element.Resources is ResourceDictionary rd)
|
||||
{
|
||||
rd.SetItems(resources);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var kv in resources) element.Resources[kv.Key] = kv.Value;
|
||||
}
|
||||
element.Resources.BulkSetResources(resources);
|
||||
}
|
||||
}
|
||||
24
src/Semi.Avalonia/Themes/Dark/CommandBar.axaml
Normal file
24
src/Semi.Avalonia/Themes/Dark/CommandBar.axaml
Normal file
@@ -0,0 +1,24 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- CommandBarButton / CommandBarToggleButton -->
|
||||
<SolidColorBrush x:Key="CommandBarButtonBackground" Color="Transparent" />
|
||||
<StaticResource x:Key="CommandBarButtonForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="CommandBarButtonPointeroverBackground" ResourceKey="SemiColorFill0" />
|
||||
<StaticResource x:Key="CommandBarButtonPressedBackground" ResourceKey="SemiColorFill1" />
|
||||
<StaticResource x:Key="CommandBarButtonDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||
<!-- CommandBarToggleButton checked state -->
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedForeground" ResourceKey="SemiColorPrimary" />
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedBackground" ResourceKey="SemiColorPrimaryLight" />
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedPointeroverBackground" ResourceKey="SemiColorPrimaryLightPointerover" />
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedPressedBackground" ResourceKey="SemiColorPrimaryLightActive" />
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedDisabledForeground" ResourceKey="SemiColorPrimaryDisabled" />
|
||||
<!-- CommandBarSeparator -->
|
||||
<StaticResource x:Key="CommandBarSeparatorBackground" 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>
|
||||
5
src/Semi.Avalonia/Themes/Dark/ContentPage.axaml
Normal file
5
src/Semi.Avalonia/Themes/Dark/ContentPage.axaml
Normal file
@@ -0,0 +1,5 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- ContentPage -->
|
||||
<StaticResource x:Key="ContentPageBackground" ResourceKey="SemiColorBackground0" />
|
||||
<StaticResource x:Key="ContentPageForeground" ResourceKey="SemiColorText0" />
|
||||
</ResourceDictionary>
|
||||
13
src/Semi.Avalonia/Themes/Dark/DrawerPage.axaml
Normal file
13
src/Semi.Avalonia/Themes/Dark/DrawerPage.axaml
Normal file
@@ -0,0 +1,13 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- DrawerPage background -->
|
||||
<StaticResource x:Key="DrawerPageBackground" ResourceKey="SemiColorBackground0" />
|
||||
<StaticResource x:Key="DrawerPageForeground" ResourceKey="SemiColorText0" />
|
||||
<!-- Top bar -->
|
||||
<StaticResource x:Key="DrawerPageTopBarBackground" ResourceKey="SemiColorBackground1" />
|
||||
<StaticResource x:Key="DrawerPageTopBarBorderBrush" ResourceKey="SemiColorBorder" />
|
||||
<!-- Drawer pane -->
|
||||
<StaticResource x:Key="DrawerPageDrawerBackground" ResourceKey="SemiColorNavBackground" />
|
||||
<!-- Pane button -->
|
||||
<SolidColorBrush x:Key="DrawerPagePaneButtonBackground" Color="Transparent" />
|
||||
<StaticResource x:Key="DrawerPagePaneButtonForeground" ResourceKey="SemiColorText0" />
|
||||
</ResourceDictionary>
|
||||
14
src/Semi.Avalonia/Themes/Dark/NavigationPage.axaml
Normal file
14
src/Semi.Avalonia/Themes/Dark/NavigationPage.axaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- NavigationPage -->
|
||||
<StaticResource x:Key="NavigationPageBackground" ResourceKey="SemiColorBackground0" />
|
||||
<StaticResource x:Key="NavigationPageForeground" ResourceKey="SemiColorText0" />
|
||||
<!-- Navigation bar -->
|
||||
<StaticResource x:Key="NavigationPageBarBackground" ResourceKey="SemiColorBackground1" />
|
||||
<StaticResource x:Key="NavigationPageBarForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="NavigationPageBarBorderBrush" ResourceKey="SemiColorBorder" />
|
||||
<!-- Back button -->
|
||||
<SolidColorBrush x:Key="NavigationPageBackButtonBackground" Color="Transparent" />
|
||||
<StaticResource x:Key="NavigationPageBackButtonForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="NavigationPageBackButtonPointeroverBackground" ResourceKey="SemiColorFill0" />
|
||||
<StaticResource x:Key="NavigationPageBackButtonPressedBackground" ResourceKey="SemiColorFill1" />
|
||||
</ResourceDictionary>
|
||||
9
src/Semi.Avalonia/Themes/Dark/PipsPager.axaml
Normal file
9
src/Semi.Avalonia/Themes/Dark/PipsPager.axaml
Normal file
@@ -0,0 +1,9 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<SolidColorBrush x:Key="PipsPagerButtonForeground" Opacity="0.5" Color="{StaticResource SemiWhiteColor}" />
|
||||
<SolidColorBrush x:Key="PipsPagerButtonPointeroverForeground" Color="{StaticResource SemiWhiteColor}" />
|
||||
<SolidColorBrush x:Key="PipsPagerIndicatorForeground" Opacity="0.5" Color="{StaticResource SemiWhiteColor}" />
|
||||
<SolidColorBrush x:Key="PipsPagerIndicatorPointeroverForeground" Opacity="0.7" Color="{StaticResource SemiWhiteColor}" />
|
||||
<SolidColorBrush x:Key="PipsPagerIndicatorPressedForeground" Color="{StaticResource SemiWhiteColor}" />
|
||||
<SolidColorBrush x:Key="PipsPagerIndicatorSelectedForeground" Color="{StaticResource SemiWhiteColor}" />
|
||||
</ResourceDictionary>
|
||||
@@ -2,7 +2,6 @@
|
||||
<StaticResource x:Key="ProgressBarIndicatorBrush" ResourceKey="SemiColorPrimary" />
|
||||
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SemiColorFill0" />
|
||||
<StaticResource x:Key="ProgressBarTextForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="ProgressBarOuterTextForeground" ResourceKey="SemiColorText0" />
|
||||
<SolidColorBrush x:Key="ProgressBarRootBorderBrush" Color="Transparent" />
|
||||
<StaticResource x:Key="ProgressBarPrimaryForeground" ResourceKey="SemiColorPrimary" />
|
||||
<StaticResource x:Key="ProgressBarSecondaryForeground" ResourceKey="SemiColorSecondary" />
|
||||
|
||||
@@ -19,4 +19,7 @@
|
||||
<StaticResource x:Key="TabItemButtonHeaderSelectedBackground" ResourceKey="SemiColorPrimaryLight" />
|
||||
<StaticResource x:Key="TabItemButtonHeaderPointeroverBackground" ResourceKey="SemiColorFill0" />
|
||||
<StaticResource x:Key="TabItemButtonHeaderPressedBackground" ResourceKey="SemiColorFill1" />
|
||||
|
||||
<StaticResource x:Key="TabItemIconSelectedForeground" ResourceKey="SemiColorPrimary" />
|
||||
<StaticResource x:Key="TabItemHeaderDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||
</ResourceDictionary>
|
||||
2
src/Semi.Avalonia/Themes/Dark/TabbedPage.axaml
Normal file
2
src/Semi.Avalonia/Themes/Dark/TabbedPage.axaml
Normal file
@@ -0,0 +1,2 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
</ResourceDictionary>
|
||||
@@ -7,6 +7,7 @@
|
||||
<StaticResource x:Key="TextBoxPressedBackground" ResourceKey="SemiColorFill2" />
|
||||
<StaticResource x:Key="TextBoxFocusBorderBrush" ResourceKey="SemiColorPrimary" />
|
||||
<StaticResource x:Key="TextBoxForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="TextBoxPlaceholderForeground" ResourceKey="SemiColorText2" />
|
||||
<StaticResource x:Key="TextBoxInnerForeground" ResourceKey="SemiColorText2" />
|
||||
<StaticResource x:Key="TextBoxDisabledBackground" ResourceKey="SemiColorDisabledFill" />
|
||||
<StaticResource x:Key="TextBoxDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<StaticResource x:Key="WindowBorderShadow" ResourceKey="SemiShadowElevated" />
|
||||
<StaticResource x:Key="TitleBarBackground" ResourceKey="SemiColorBackground0" />
|
||||
|
||||
<StaticResource x:Key="CaptionButtonPointeroverBackground" ResourceKey="SemiColorFill1" />
|
||||
<StaticResource x:Key="CaptionButtonPressedBackground" ResourceKey="SemiColorFill2" />
|
||||
<StaticResource x:Key="CaptionButtonCloseForeground" ResourceKey="SemiColorWhite" />
|
||||
<StaticResource x:Key="CaptionButtonClosePointeroverBackground" ResourceKey="SemiColorDangerPointerover" />
|
||||
<StaticResource x:Key="CaptionButtonClosePressedBackground" ResourceKey="SemiColorDangerActive" />
|
||||
<StaticResource x:Key="CaptionButtonForeground" ResourceKey="SemiColorText2" />
|
||||
<StaticResource x:Key="CaptionButtonForeground" ResourceKey="SemiColorText1" />
|
||||
<StaticResource x:Key="CaptionButtonDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||
</ResourceDictionary>
|
||||
@@ -4,17 +4,19 @@
|
||||
<ResourceInclude Source="AutoCompleteBox.axaml" />
|
||||
<ResourceInclude Source="Border.axaml" />
|
||||
<ResourceInclude Source="Button.axaml" />
|
||||
<ResourceInclude Source="ContentPage.axaml" />
|
||||
<ResourceInclude Source="ButtonSpinner.axaml" />
|
||||
<ResourceInclude Source="Calendar.axaml" />
|
||||
<ResourceInclude Source="CalendarDatePicker.axaml" />
|
||||
<ResourceInclude Source="CaptionButtons.axaml" />
|
||||
<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" />
|
||||
<ResourceInclude Source="DropDownButton.axaml" />
|
||||
<ResourceInclude Source="DrawerPage.axaml" />
|
||||
<ResourceInclude Source="Expander.axaml" />
|
||||
<ResourceInclude Source="Flyout.axaml" />
|
||||
<ResourceInclude Source="GridSplitter.axaml" />
|
||||
@@ -25,7 +27,9 @@
|
||||
<ResourceInclude Source="ManagedFileChooser.axaml" />
|
||||
<ResourceInclude Source="Menu.axaml" />
|
||||
<ResourceInclude Source="NotificationCard.axaml" />
|
||||
<ResourceInclude Source="NavigationPage.axaml" />
|
||||
<ResourceInclude Source="NumericUpDown.axaml" />
|
||||
<ResourceInclude Source="PipsPager.axaml" />
|
||||
<ResourceInclude Source="ProgressBar.axaml" />
|
||||
<ResourceInclude Source="RadioButton.axaml" />
|
||||
<ResourceInclude Source="RefreshContainer.axaml" />
|
||||
@@ -35,6 +39,7 @@
|
||||
<ResourceInclude Source="SplitView.axaml" />
|
||||
<ResourceInclude Source="TabControl.axaml" />
|
||||
<ResourceInclude Source="TabItem.axaml" />
|
||||
<ResourceInclude Source="TabbedPage.axaml" />
|
||||
<ResourceInclude Source="TextBlock.axaml" />
|
||||
<ResourceInclude Source="TextBox.axaml" />
|
||||
<ResourceInclude Source="TimePicker.axaml" />
|
||||
@@ -43,5 +48,6 @@
|
||||
<ResourceInclude Source="Tooltip.axaml" />
|
||||
<ResourceInclude Source="TreeView.axaml" />
|
||||
<ResourceInclude Source="Window.axaml" />
|
||||
<ResourceInclude Source="WindowDrawnDecorations.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
23
src/Semi.Avalonia/Themes/HighContrast/CommandBar.axaml
Normal file
23
src/Semi.Avalonia/Themes/HighContrast/CommandBar.axaml
Normal file
@@ -0,0 +1,23 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- CommandBarButton / CommandBarToggleButton -->
|
||||
<SolidColorBrush x:Key="CommandBarButtonBackground" Color="Transparent" />
|
||||
<StaticResource x:Key="CommandBarButtonForeground" ResourceKey="SemiColorWindowText" />
|
||||
<StaticResource x:Key="CommandBarButtonPointeroverBackground" ResourceKey="SemiColorHighlight" />
|
||||
<StaticResource x:Key="CommandBarButtonPressedBackground" ResourceKey="SemiColorHighlight" />
|
||||
<StaticResource x:Key="CommandBarButtonDisabledForeground" ResourceKey="SemiColorGrayText" />
|
||||
<!-- CommandBarToggleButton checked state -->
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedForeground" ResourceKey="SemiColorHighlightText" />
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedBackground" ResourceKey="SemiColorHighlight" />
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedPointeroverBackground" ResourceKey="SemiColorButtonText" />
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedPressedBackground" ResourceKey="SemiColorButtonFace" />
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedDisabledForeground" ResourceKey="SemiColorGrayText" />
|
||||
<!-- CommandBarSeparator -->
|
||||
<StaticResource x:Key="CommandBarSeparatorBackground" 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>
|
||||
5
src/Semi.Avalonia/Themes/HighContrast/ContentPage.axaml
Normal file
5
src/Semi.Avalonia/Themes/HighContrast/ContentPage.axaml
Normal file
@@ -0,0 +1,5 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- ContentPage -->
|
||||
<StaticResource x:Key="ContentPageBackground" ResourceKey="SemiColorWindow" />
|
||||
<StaticResource x:Key="ContentPageForeground" ResourceKey="SemiColorWindowText" />
|
||||
</ResourceDictionary>
|
||||
13
src/Semi.Avalonia/Themes/HighContrast/DrawerPage.axaml
Normal file
13
src/Semi.Avalonia/Themes/HighContrast/DrawerPage.axaml
Normal file
@@ -0,0 +1,13 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- DrawerPage background -->
|
||||
<StaticResource x:Key="DrawerPageBackground" ResourceKey="SemiColorWindow" />
|
||||
<StaticResource x:Key="DrawerPageForeground" ResourceKey="SemiColorWindowText" />
|
||||
<!-- Top bar -->
|
||||
<StaticResource x:Key="DrawerPageTopBarBackground" ResourceKey="SemiColorWindow" />
|
||||
<StaticResource x:Key="DrawerPageTopBarBorderBrush" ResourceKey="SemiColorWindowText" />
|
||||
<!-- Drawer pane -->
|
||||
<StaticResource x:Key="DrawerPageDrawerBackground" ResourceKey="SemiColorWindow" />
|
||||
<!-- Pane button -->
|
||||
<SolidColorBrush x:Key="DrawerPagePaneButtonBackground" Color="Transparent" />
|
||||
<StaticResource x:Key="DrawerPagePaneButtonForeground" ResourceKey="SemiColorWindowText" />
|
||||
</ResourceDictionary>
|
||||
14
src/Semi.Avalonia/Themes/HighContrast/NavigationPage.axaml
Normal file
14
src/Semi.Avalonia/Themes/HighContrast/NavigationPage.axaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- NavigationPage -->
|
||||
<StaticResource x:Key="NavigationPageBackground" ResourceKey="SemiColorWindow" />
|
||||
<StaticResource x:Key="NavigationPageForeground" ResourceKey="SemiColorWindowText" />
|
||||
<!-- Navigation bar -->
|
||||
<StaticResource x:Key="NavigationPageBarBackground" ResourceKey="SemiColorWindow" />
|
||||
<StaticResource x:Key="NavigationPageBarForeground" ResourceKey="SemiColorWindowText" />
|
||||
<StaticResource x:Key="NavigationPageBarBorderBrush" ResourceKey="SemiColorWindowText" />
|
||||
<!-- Back button -->
|
||||
<SolidColorBrush x:Key="NavigationPageBackButtonBackground" Color="Transparent" />
|
||||
<StaticResource x:Key="NavigationPageBackButtonForeground" ResourceKey="SemiColorWindowText" />
|
||||
<StaticResource x:Key="NavigationPageBackButtonPointeroverBackground" ResourceKey="SemiColorHighlight" />
|
||||
<StaticResource x:Key="NavigationPageBackButtonPressedBackground" ResourceKey="SemiColorHighlightText" />
|
||||
</ResourceDictionary>
|
||||
4
src/Semi.Avalonia/Themes/HighContrast/PipsPager.axaml
Normal file
4
src/Semi.Avalonia/Themes/HighContrast/PipsPager.axaml
Normal file
@@ -0,0 +1,4 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
</ResourceDictionary>
|
||||
@@ -2,7 +2,6 @@
|
||||
<StaticResource x:Key="ProgressBarIndicatorBrush" ResourceKey="SemiColorHighlight" />
|
||||
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SemiColorHighlightText" />
|
||||
<StaticResource x:Key="ProgressBarTextForeground" ResourceKey="SemiColorWindowText" />
|
||||
<StaticResource x:Key="ProgressBarOuterTextForeground" ResourceKey="SemiColorWindowText" />
|
||||
<StaticResource x:Key="ProgressBarRootBorderBrush" ResourceKey="SemiColorWindowText" />
|
||||
<StaticResource x:Key="ProgressBarPrimaryForeground" ResourceKey="SemiColorHighlight" />
|
||||
</ResourceDictionary>
|
||||
@@ -19,4 +19,7 @@
|
||||
<StaticResource x:Key="TabItemButtonHeaderSelectedBackground" ResourceKey="SemiColorHighlightText" />
|
||||
<StaticResource x:Key="TabItemButtonHeaderPointeroverBackground" ResourceKey="SemiColorHighlightText" />
|
||||
<StaticResource x:Key="TabItemButtonHeaderPressedBackground" ResourceKey="SemiColorHighlightText" />
|
||||
|
||||
<StaticResource x:Key="TabItemIconSelectedForeground" ResourceKey="SemiColorHighlight" />
|
||||
<StaticResource x:Key="TabItemHeaderDisabledForeground" ResourceKey="SemiColorGrayText" />
|
||||
</ResourceDictionary>
|
||||
2
src/Semi.Avalonia/Themes/HighContrast/TabbedPage.axaml
Normal file
2
src/Semi.Avalonia/Themes/HighContrast/TabbedPage.axaml
Normal file
@@ -0,0 +1,2 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
</ResourceDictionary>
|
||||
@@ -7,6 +7,7 @@
|
||||
<StaticResource x:Key="TextBoxPressedBackground" ResourceKey="SemiColorHighlightText" />
|
||||
<StaticResource x:Key="TextBoxFocusBorderBrush" ResourceKey="SemiColorHighlight" />
|
||||
<StaticResource x:Key="TextBoxForeground" ResourceKey="SemiColorWindowText" />
|
||||
<StaticResource x:Key="TextBoxPlaceholderForeground" ResourceKey="SemiColorWindowText" />
|
||||
<StaticResource x:Key="TextBoxInnerForeground" ResourceKey="SemiColorWindowText" />
|
||||
<StaticResource x:Key="TextBoxDisabledBackground" ResourceKey="SemiColorWindow" />
|
||||
<StaticResource x:Key="TextBoxDisabledForeground" ResourceKey="SemiColorGrayText" />
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<StaticResource x:Key="TitleBarBackground" ResourceKey="SemiColorWindow" />
|
||||
|
||||
<StaticResource x:Key="CaptionButtonPointeroverBackground" ResourceKey="SemiColorHotlight" />
|
||||
<StaticResource x:Key="CaptionButtonPressedBackground" ResourceKey="SemiColorHotlight" />
|
||||
<StaticResource x:Key="CaptionButtonCloseForeground" ResourceKey="SemiColorWhite" />
|
||||
<StaticResource x:Key="CaptionButtonClosePointeroverBackground" ResourceKey="SemiColorHotlight" />
|
||||
<StaticResource x:Key="CaptionButtonClosePressedBackground" ResourceKey="SemiColorHotlight" />
|
||||
<StaticResource x:Key="CaptionButtonForeground" ResourceKey="SemiColorWindowText" />
|
||||
<StaticResource x:Key="CaptionButtonDisabledForeground" ResourceKey="SemiColorGrayText" />
|
||||
</ResourceDictionary>
|
||||
@@ -7,13 +7,15 @@
|
||||
<ResourceInclude Source="ButtonSpinner.axaml" />
|
||||
<ResourceInclude Source="Calendar.axaml" />
|
||||
<ResourceInclude Source="CalendarDatePicker.axaml" />
|
||||
<ResourceInclude Source="CaptionButtons.axaml" />
|
||||
<ResourceInclude Source="Carousel.axaml" />
|
||||
<ResourceInclude Source="CheckBox.axaml" />
|
||||
<ResourceInclude Source="ComboBox.axaml" />
|
||||
<ResourceInclude Source="CommandBar.axaml" />
|
||||
<ResourceInclude Source="ContentPage.axaml" />
|
||||
<ResourceInclude Source="DataValidationErrors.axaml" />
|
||||
<ResourceInclude Source="DatePicker.axaml" />
|
||||
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
||||
<ResourceInclude Source="DrawerPage.axaml" />
|
||||
<ResourceInclude Source="DropDownButton.axaml" />
|
||||
<ResourceInclude Source="Expander.axaml" />
|
||||
<ResourceInclude Source="Flyout.axaml" />
|
||||
@@ -24,8 +26,10 @@
|
||||
<ResourceInclude Source="ListBox.axaml" />
|
||||
<ResourceInclude Source="ManagedFileChooser.axaml" />
|
||||
<ResourceInclude Source="Menu.axaml" />
|
||||
<ResourceInclude Source="NavigationPage.axaml" />
|
||||
<ResourceInclude Source="NotificationCard.axaml" />
|
||||
<ResourceInclude Source="NumericUpDown.axaml" />
|
||||
<ResourceInclude Source="PipsPager.axaml" />
|
||||
<ResourceInclude Source="ProgressBar.axaml" />
|
||||
<ResourceInclude Source="RadioButton.axaml" />
|
||||
<ResourceInclude Source="RefreshContainer.axaml" />
|
||||
@@ -35,6 +39,7 @@
|
||||
<ResourceInclude Source="SplitView.axaml" />
|
||||
<ResourceInclude Source="TabControl.axaml" />
|
||||
<ResourceInclude Source="TabItem.axaml" />
|
||||
<ResourceInclude Source="TabbedPage.axaml" />
|
||||
<ResourceInclude Source="TextBlock.axaml" />
|
||||
<ResourceInclude Source="TextBox.axaml" />
|
||||
<ResourceInclude Source="TimePicker.axaml" />
|
||||
@@ -43,5 +48,6 @@
|
||||
<ResourceInclude Source="Tooltip.axaml" />
|
||||
<ResourceInclude Source="TreeView.axaml" />
|
||||
<ResourceInclude Source="Window.axaml" />
|
||||
<ResourceInclude Source="WindowDrawnDecorations.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
24
src/Semi.Avalonia/Themes/Light/CommandBar.axaml
Normal file
24
src/Semi.Avalonia/Themes/Light/CommandBar.axaml
Normal file
@@ -0,0 +1,24 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- CommandBarButton / CommandBarToggleButton -->
|
||||
<SolidColorBrush x:Key="CommandBarButtonBackground" Color="Transparent" />
|
||||
<StaticResource x:Key="CommandBarButtonForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="CommandBarButtonPointeroverBackground" ResourceKey="SemiColorFill0" />
|
||||
<StaticResource x:Key="CommandBarButtonPressedBackground" ResourceKey="SemiColorFill1" />
|
||||
<StaticResource x:Key="CommandBarButtonDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||
<!-- CommandBarToggleButton checked state -->
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedForeground" ResourceKey="SemiColorPrimary" />
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedBackground" ResourceKey="SemiColorPrimaryLight" />
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedPointeroverBackground" ResourceKey="SemiColorPrimaryLightPointerover" />
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedPressedBackground" ResourceKey="SemiColorPrimaryLightActive" />
|
||||
<StaticResource x:Key="CommandBarToggleButtonCheckedDisabledForeground" ResourceKey="SemiColorPrimaryDisabled" />
|
||||
<!-- CommandBarSeparator -->
|
||||
<StaticResource x:Key="CommandBarSeparatorBackground" 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>
|
||||
5
src/Semi.Avalonia/Themes/Light/ContentPage.axaml
Normal file
5
src/Semi.Avalonia/Themes/Light/ContentPage.axaml
Normal file
@@ -0,0 +1,5 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- ContentPage -->
|
||||
<StaticResource x:Key="ContentPageBackground" ResourceKey="SemiColorBackground0" />
|
||||
<StaticResource x:Key="ContentPageForeground" ResourceKey="SemiColorText0" />
|
||||
</ResourceDictionary>
|
||||
13
src/Semi.Avalonia/Themes/Light/DrawerPage.axaml
Normal file
13
src/Semi.Avalonia/Themes/Light/DrawerPage.axaml
Normal file
@@ -0,0 +1,13 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- DrawerPage background -->
|
||||
<StaticResource x:Key="DrawerPageBackground" ResourceKey="SemiColorBackground0" />
|
||||
<StaticResource x:Key="DrawerPageForeground" ResourceKey="SemiColorText0" />
|
||||
<!-- Top bar -->
|
||||
<StaticResource x:Key="DrawerPageTopBarBackground" ResourceKey="SemiColorBackground1" />
|
||||
<StaticResource x:Key="DrawerPageTopBarBorderBrush" ResourceKey="SemiColorBorder" />
|
||||
<!-- Drawer pane -->
|
||||
<StaticResource x:Key="DrawerPageDrawerBackground" ResourceKey="SemiColorNavBackground" />
|
||||
<!-- Pane button -->
|
||||
<SolidColorBrush x:Key="DrawerPagePaneButtonBackground" Color="Transparent" />
|
||||
<StaticResource x:Key="DrawerPagePaneButtonForeground" ResourceKey="SemiColorText0" />
|
||||
</ResourceDictionary>
|
||||
14
src/Semi.Avalonia/Themes/Light/NavigationPage.axaml
Normal file
14
src/Semi.Avalonia/Themes/Light/NavigationPage.axaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- NavigationPage -->
|
||||
<StaticResource x:Key="NavigationPageBackground" ResourceKey="SemiColorBackground0" />
|
||||
<StaticResource x:Key="NavigationPageForeground" ResourceKey="SemiColorText0" />
|
||||
<!-- Navigation bar -->
|
||||
<StaticResource x:Key="NavigationPageBarBackground" ResourceKey="SemiColorBackground1" />
|
||||
<StaticResource x:Key="NavigationPageBarForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="NavigationPageBarBorderBrush" ResourceKey="SemiColorBorder" />
|
||||
<!-- Back button -->
|
||||
<SolidColorBrush x:Key="NavigationPageBackButtonBackground" Color="Transparent" />
|
||||
<StaticResource x:Key="NavigationPageBackButtonForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="NavigationPageBackButtonPointeroverBackground" ResourceKey="SemiColorFill0" />
|
||||
<StaticResource x:Key="NavigationPageBackButtonPressedBackground" ResourceKey="SemiColorFill1" />
|
||||
</ResourceDictionary>
|
||||
9
src/Semi.Avalonia/Themes/Light/PipsPager.axaml
Normal file
9
src/Semi.Avalonia/Themes/Light/PipsPager.axaml
Normal file
@@ -0,0 +1,9 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<SolidColorBrush x:Key="PipsPagerButtonForeground" Opacity="0.5" Color="{StaticResource SemiBlackColor}" />
|
||||
<SolidColorBrush x:Key="PipsPagerButtonPointeroverForeground" Color="{StaticResource SemiBlackColor}" />
|
||||
<SolidColorBrush x:Key="PipsPagerIndicatorForeground" Opacity="0.5" Color="{StaticResource SemiBlackColor}" />
|
||||
<SolidColorBrush x:Key="PipsPagerIndicatorPointeroverForeground" Opacity="0.7" Color="{StaticResource SemiBlackColor}" />
|
||||
<SolidColorBrush x:Key="PipsPagerIndicatorPressedForeground" Color="{StaticResource SemiBlackColor}" />
|
||||
<SolidColorBrush x:Key="PipsPagerIndicatorSelectedForeground" Color="{StaticResource SemiBlackColor}" />
|
||||
</ResourceDictionary>
|
||||
@@ -2,7 +2,6 @@
|
||||
<StaticResource x:Key="ProgressBarIndicatorBrush" ResourceKey="SemiColorPrimary" />
|
||||
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SemiColorFill0" />
|
||||
<StaticResource x:Key="ProgressBarTextForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="ProgressBarOuterTextForeground" ResourceKey="SemiColorText0" />
|
||||
<SolidColorBrush x:Key="ProgressBarRootBorderBrush" Color="Transparent" />
|
||||
<StaticResource x:Key="ProgressBarPrimaryForeground" ResourceKey="SemiColorPrimary" />
|
||||
<StaticResource x:Key="ProgressBarSecondaryForeground" ResourceKey="SemiColorSecondary" />
|
||||
|
||||
@@ -19,4 +19,7 @@
|
||||
<StaticResource x:Key="TabItemButtonHeaderSelectedBackground" ResourceKey="SemiColorPrimaryLight" />
|
||||
<StaticResource x:Key="TabItemButtonHeaderPointeroverBackground" ResourceKey="SemiColorFill0" />
|
||||
<StaticResource x:Key="TabItemButtonHeaderPressedBackground" ResourceKey="SemiColorFill1" />
|
||||
|
||||
<StaticResource x:Key="TabItemIconSelectedForeground" ResourceKey="SemiColorPrimary" />
|
||||
<StaticResource x:Key="TabItemHeaderDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||
</ResourceDictionary>
|
||||
2
src/Semi.Avalonia/Themes/Light/TabbedPage.axaml
Normal file
2
src/Semi.Avalonia/Themes/Light/TabbedPage.axaml
Normal file
@@ -0,0 +1,2 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
</ResourceDictionary>
|
||||
@@ -7,6 +7,7 @@
|
||||
<StaticResource x:Key="TextBoxPressedBackground" ResourceKey="SemiColorFill2" />
|
||||
<StaticResource x:Key="TextBoxFocusBorderBrush" ResourceKey="SemiColorPrimary" />
|
||||
<StaticResource x:Key="TextBoxForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="TextBoxPlaceholderForeground" ResourceKey="SemiColorText2" />
|
||||
<StaticResource x:Key="TextBoxInnerForeground" ResourceKey="SemiColorText2" />
|
||||
<StaticResource x:Key="TextBoxDisabledBackground" ResourceKey="SemiColorDisabledFill" />
|
||||
<StaticResource x:Key="TextBoxDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<StaticResource x:Key="WindowBorderShadow" ResourceKey="SemiShadowElevated" />
|
||||
<StaticResource x:Key="TitleBarBackground" ResourceKey="SemiColorBackground0" />
|
||||
|
||||
<StaticResource x:Key="CaptionButtonPointeroverBackground" ResourceKey="SemiColorFill1" />
|
||||
<StaticResource x:Key="CaptionButtonPressedBackground" ResourceKey="SemiColorFill2" />
|
||||
<StaticResource x:Key="CaptionButtonCloseForeground" ResourceKey="SemiColorWhite" />
|
||||
<StaticResource x:Key="CaptionButtonClosePointeroverBackground" ResourceKey="SemiColorDangerPointerover" />
|
||||
<StaticResource x:Key="CaptionButtonClosePressedBackground" ResourceKey="SemiColorDangerActive" />
|
||||
<StaticResource x:Key="CaptionButtonForeground" ResourceKey="SemiColorText2" />
|
||||
<StaticResource x:Key="CaptionButtonForeground" ResourceKey="SemiColorText1" />
|
||||
<StaticResource x:Key="CaptionButtonDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||
</ResourceDictionary>
|
||||
@@ -4,17 +4,19 @@
|
||||
<ResourceInclude Source="AutoCompleteBox.axaml" />
|
||||
<ResourceInclude Source="Border.axaml" />
|
||||
<ResourceInclude Source="Button.axaml" />
|
||||
<ResourceInclude Source="ContentPage.axaml" />
|
||||
<ResourceInclude Source="ButtonSpinner.axaml" />
|
||||
<ResourceInclude Source="Calendar.axaml" />
|
||||
<ResourceInclude Source="CalendarDatePicker.axaml" />
|
||||
<ResourceInclude Source="CaptionButtons.axaml" />
|
||||
<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" />
|
||||
<ResourceInclude Source="DropDownButton.axaml" />
|
||||
<ResourceInclude Source="DrawerPage.axaml" />
|
||||
<ResourceInclude Source="Expander.axaml" />
|
||||
<ResourceInclude Source="Flyout.axaml" />
|
||||
<ResourceInclude Source="GridSplitter.axaml" />
|
||||
@@ -25,7 +27,9 @@
|
||||
<ResourceInclude Source="ManagedFileChooser.axaml" />
|
||||
<ResourceInclude Source="Menu.axaml" />
|
||||
<ResourceInclude Source="NotificationCard.axaml" />
|
||||
<ResourceInclude Source="NavigationPage.axaml" />
|
||||
<ResourceInclude Source="NumericUpDown.axaml" />
|
||||
<ResourceInclude Source="PipsPager.axaml" />
|
||||
<ResourceInclude Source="ProgressBar.axaml" />
|
||||
<ResourceInclude Source="RadioButton.axaml" />
|
||||
<ResourceInclude Source="RefreshContainer.axaml" />
|
||||
@@ -35,6 +39,7 @@
|
||||
<ResourceInclude Source="SplitView.axaml" />
|
||||
<ResourceInclude Source="TabControl.axaml" />
|
||||
<ResourceInclude Source="TabItem.axaml" />
|
||||
<ResourceInclude Source="TabbedPage.axaml" />
|
||||
<ResourceInclude Source="TextBlock.axaml" />
|
||||
<ResourceInclude Source="TextBox.axaml" />
|
||||
<ResourceInclude Source="TimePicker.axaml" />
|
||||
@@ -43,5 +48,6 @@
|
||||
<ResourceInclude Source="Tooltip.axaml" />
|
||||
<ResourceInclude Source="TreeView.axaml" />
|
||||
<ResourceInclude Source="Window.axaml" />
|
||||
<ResourceInclude Source="WindowDrawnDecorations.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
@@ -3,4 +3,10 @@
|
||||
<StaticResource x:Key="ButtonSpinnerDecreaseButtonGlyph" ResourceKey="SemiIconChevronDown" />
|
||||
<StaticResource x:Key="ButtonSpinnerButtonGroupCornerRadius" ResourceKey="SemiBorderRadiusSmall" />
|
||||
<StaticResource x:Key="ButtonSpinnerButtonGroupBorderThickness" ResourceKey="SemiBorderThicknessControl" />
|
||||
|
||||
<StaticResource x:Key="SplitButtonSpinnerIncreaseButtonGlyph" ResourceKey="SemiIconPlus" />
|
||||
<StaticResource x:Key="SplitButtonSpinnerDecreaseButtonGlyph" ResourceKey="SemiIconMinus" />
|
||||
<CornerRadius x:Key="SplitButtonSpinnerLeftButtonCornerRadius">3 0 0 3</CornerRadius>
|
||||
<CornerRadius x:Key="SplitButtonSpinnerRightButtonCornerRadius">0 3 3 0</CornerRadius>
|
||||
<Thickness x:Key="SplitButtonSpinnerButtonPadding">8 0</Thickness>
|
||||
</ResourceDictionary>
|
||||
@@ -1,13 +0,0 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<StreamGeometry x:Key="WindowCloseIconGlyph">M13.46,12L19,17.54V19H17.54L12,13.46L6.46,19H5V17.54L10.54,12L5,6.46V5H6.46L12,10.54L17.54,5H19V6.46L13.46,12Z</StreamGeometry>
|
||||
<StreamGeometry x:Key="WindowMaximizeGlyph">M4,4H20V20H4V4M6,8V18H18V8H6Z</StreamGeometry>
|
||||
<StreamGeometry x:Key="WindowMinimizeGlyph">M20,14H4V10H20</StreamGeometry>
|
||||
<StreamGeometry x:Key="WindowRestoreGlyph">M4,8H8V4H20V16H16V20H4V8M16,8V14H18V6H10V8H16M6,12V18H14V12H6Z</StreamGeometry>
|
||||
<StreamGeometry x:Key="WindowExpandGlyph">M10,21V19H6.41L10.91,14.5L9.5,13.09L5,17.59V14H3V21H10M14.5,10.91L19,6.41V10H21V3H14V5H17.59L13.09,9.5L14.5,10.91Z</StreamGeometry>
|
||||
<StreamGeometry x:Key="WindowCollapseGlyph">M19.5,3.09L15,7.59V4H13V11H20V9H16.41L20.91,4.5L19.5,3.09M4,13V15H7.59L3.09,19.5L4.5,20.91L9,16.41V20H11V13H4Z</StreamGeometry>
|
||||
|
||||
<StaticResource x:Key="CaptionButtonCornerRadius" ResourceKey="SemiBorderRadiusSmall" />
|
||||
<StaticResource x:Key="CaptionButtonWidth" ResourceKey="SemiSpacingExtraLoose" />
|
||||
<StaticResource x:Key="CaptionButtonHeight" ResourceKey="SemiSpacingExtraLoose" />
|
||||
<StaticResource x:Key="CaptionButtonPadding" ResourceKey="SemiThicknessTight" />
|
||||
</ResourceDictionary>
|
||||
32
src/Semi.Avalonia/Themes/Shared/CommandBar.axaml
Normal file
32
src/Semi.Avalonia/Themes/Shared/CommandBar.axaml
Normal file
@@ -0,0 +1,32 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- CommandBarButton / CommandBarToggleButton -->
|
||||
<x:Double x:Key="CommandBarButtonWidth">64</x:Double>
|
||||
<x:Double x:Key="CommandBarButtonCompactWidth">40</x:Double>
|
||||
<x:Double x:Key="CommandBarButtonMinHeight">40</x:Double>
|
||||
<Thickness x:Key="CommandBarButtonPadding">8 4</Thickness>
|
||||
<x:Double x:Key="CommandBarButtonPanelSpacing">4</x:Double>
|
||||
<StaticResource x:Key="CommandBarButtonCornerRadius" ResourceKey="SemiBorderRadiusSmall" />
|
||||
<StaticResource x:Key="CommandBarButtonLabelFontSize" ResourceKey="SemiFontSizeSmall" />
|
||||
<x:Double x:Key="CommandBarButtonOverflowMinHeight">36</x:Double>
|
||||
<Thickness x:Key="CommandBarButtonOverflowPadding">12 6</Thickness>
|
||||
<!-- CommandBarSeparator -->
|
||||
<x:Double x:Key="CommandBarSeparatorWidth">1</x:Double>
|
||||
<x:Double x:Key="CommandBarSeparatorMinHeight">24</x:Double>
|
||||
<Thickness x:Key="CommandBarSeparatorMargin">8 4</Thickness>
|
||||
<x:Double x:Key="CommandBarSeparatorOverflowHeight">1</x:Double>
|
||||
<Thickness x:Key="CommandBarSeparatorOverflowMargin">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" />
|
||||
<x:Double x:Key="CommandBarOverflowMinHeight">16</x:Double>
|
||||
<x:Double x:Key="CommandBarOverflowMaxHeight">400</x:Double>
|
||||
<x:Double x:Key="CommandBarOverflowMaxWidth">600</x:Double>
|
||||
<Thickness x:Key="CommandBarOverflowPadding">0 4</Thickness>
|
||||
<Thickness x:Key="CommandBarOverflowMargin">8</Thickness>
|
||||
<!-- Overflow button glyph -->
|
||||
<StaticResource x:Key="CommandBarOverflowButtonGlyph" ResourceKey="SemiIconMore" />
|
||||
</ResourceDictionary>
|
||||
4
src/Semi.Avalonia/Themes/Shared/ContentPage.axaml
Normal file
4
src/Semi.Avalonia/Themes/Shared/ContentPage.axaml
Normal file
@@ -0,0 +1,4 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- ContentPage -->
|
||||
<x:Double x:Key="ContentPageBarMinHeight">48</x:Double>
|
||||
</ResourceDictionary>
|
||||
15
src/Semi.Avalonia/Themes/Shared/DrawerPage.axaml
Normal file
15
src/Semi.Avalonia/Themes/Shared/DrawerPage.axaml
Normal file
@@ -0,0 +1,15 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- DrawerPage top bar -->
|
||||
<x:Double x:Key="DrawerPageTopBarMinHeight">48</x:Double>
|
||||
<Thickness x:Key="DrawerPageTopBarPadding">4 0</Thickness>
|
||||
<Thickness x:Key="DrawerPageTopBarBorderThickness">0 0 0 1</Thickness>
|
||||
|
||||
<!-- DrawerPage pane/drawer -->
|
||||
<x:Double x:Key="DrawerPageDrawerLength">280</x:Double>
|
||||
<x:Double x:Key="DrawerPageCompactDrawerLength">56</x:Double>
|
||||
|
||||
<!-- DrawerPage pane button -->
|
||||
<x:Double x:Key="DrawerPagePaneButtonSize">32</x:Double>
|
||||
<Thickness x:Key="DrawerPagePaneButtonMargin">8 0</Thickness>
|
||||
<StaticResource x:Key="DrawerPageMenuGlyph" ResourceKey="SemiIconMenu" />
|
||||
</ResourceDictionary>
|
||||
@@ -7,4 +7,5 @@
|
||||
<x:Double x:Key="FlyoutMaxWidth">600</x:Double>
|
||||
<StaticResource x:Key="FlyoutCornerRadius" ResourceKey="SemiBorderRadiusMedium" />
|
||||
<StaticResource x:Key="FlyoutPadding" ResourceKey="SemiThicknessTight" />
|
||||
<StaticResource x:Key="HorizontalMenuFlyoutThemeMinWidth" ResourceKey="SemiSpacingExtraLoose" />
|
||||
</ResourceDictionary>
|
||||
7
src/Semi.Avalonia/Themes/Shared/NavigationPage.axaml
Normal file
7
src/Semi.Avalonia/Themes/Shared/NavigationPage.axaml
Normal file
@@ -0,0 +1,7 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- NavigationPage -->
|
||||
<x:Double x:Key="NavigationPageBarMinHeight">48</x:Double>
|
||||
<Thickness x:Key="NavigationPageBarPadding">4 0</Thickness>
|
||||
<Thickness x:Key="NavigationPageBarBorderThickness">0 0 0 1</Thickness>
|
||||
<StaticResource x:Key="NavigationPageBackButtonGlyph" ResourceKey="SemiIconChevronLeft" />
|
||||
</ResourceDictionary>
|
||||
@@ -1,4 +1,5 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<StaticResource x:Key="TabItemIconHeaderSpacing" ResourceKey="SemiSpacingTight" />
|
||||
<StaticResource x:Key="TabItemSelectedFontWeight" ResourceKey="SemiFontWeightBold" />
|
||||
<StaticResource x:Key="TabItemCardDefaultHeight" ResourceKey="SemiHeightControlDefault" />
|
||||
</ResourceDictionary>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user