Merge branch 'main' into Coolkeke/main

This commit is contained in:
Dong Bin
2024-02-26 01:31:01 +08:00
committed by GitHub
241 changed files with 14789 additions and 1427 deletions

View File

@@ -9,22 +9,23 @@
<ControlTheme x:Key="{x:Type u:Badge}" TargetType="{x:Type u:Badge}">
<!-- Set a very large corner radius to achieve pill look. -->
<Setter Property="u:Badge.CornerRadius" Value="100" />
<Setter Property="u:Badge.FontSize" Value="14" />
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgePrimaryBadgeBackground}" />
<Setter Property="u:Badge.ClipToBounds" Value="False" />
<Setter Property="u:Badge.HorizontalAlignment" Value="Center" />
<Setter Property="u:Badge.VerticalAlignment" Value="Center" />
<Setter Property="u:Badge.BorderThickness" Value="{DynamicResource BadgeBorderThickness}" />
<Setter Property="u:Badge.UseLayoutRounding" Value="False" />
<Setter Property="u:Badge.BorderBrush" Value="{DynamicResource BadgeBorderBrush}" />
<Setter Property="u:Badge.Template">
<Setter Property="CornerRadius" Value="{DynamicResource BadgeCornerRadius}" />
<Setter Property="BadgeFontSize" Value="{DynamicResource BadgeFontSize}" />
<Setter Property="Foreground" Value="{DynamicResource BadgeForeground}" />
<Setter Property="Background" Value="{DynamicResource BadgePrimaryBadgeBackground}" />
<Setter Property="ClipToBounds" Value="False" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="{DynamicResource BadgeBorderThickness}" />
<Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="BorderBrush" Value="{DynamicResource BadgeBorderBrush}" />
<Setter Property="CornerPosition" Value="{DynamicResource BadgeCornerPosition}" />
<Setter Property="Template">
<ControlTemplate TargetType="{x:Type u:Badge}">
<Grid
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
ClipToBounds="False">
<ContentPresenter
Name="{x:Static u:Badge.PART_ContentPresenter}"
Margin="{TemplateBinding Padding}"
@@ -34,8 +35,8 @@
ContentTemplate="{TemplateBinding ContentTemplate}" />
<Border
Name="{x:Static u:Badge.PART_BadgeContainer}"
MinWidth="{DynamicResource BadgeHeight}"
MinHeight="{DynamicResource BadgeHeight}"
MinWidth="{DynamicResource BadgeMinWidth}"
MinHeight="{DynamicResource BadgeMinHeight}"
Padding="{DynamicResource BadgePadding}"
HorizontalAlignment="Right"
VerticalAlignment="Top"
@@ -43,21 +44,21 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
IsVisible="{Binding !!BadgeContent, RelativeSource={RelativeSource TemplatedParent}}"
IsVisible="{Binding !!Header, RelativeSource={RelativeSource TemplatedParent}}"
RenderTransformOrigin=".5,.5"
Theme="{TemplateBinding BadgeTheme}"
UseLayoutRounding="False">
<ContentPresenter
Name="{x:Static u:Badge.PART_BadgeContentPresenter}"
Name="{x:Static u:Badge.PART_HeaderPresenter}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Focusable="False"
IsTabStop="False"
TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.Foreground="{DynamicResource BadgeForeground}">
TextElement.FontSize="{TemplateBinding BadgeFontSize}"
TextElement.Foreground="{TemplateBinding Foreground}">
<ContentPresenter.Content>
<MultiBinding Converter="{StaticResource BadgeContentConverter}">
<Binding Path="BadgeContent" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Header" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="OverflowCount" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</ContentPresenter.Content>
@@ -83,7 +84,7 @@
ContentTemplate="{TemplateBinding ContentTemplate}" />
<Border
Name="{x:Static u:Badge.PART_BadgeContainer}"
Width="{DynamicResource BadgeDotHeight}"
Width="{DynamicResource BadgeDotWidth}"
Height="{DynamicResource BadgeDotHeight}"
HorizontalAlignment="Right"
VerticalAlignment="Top"
@@ -91,7 +92,7 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
IsVisible="{Binding !!BadgeContent, RelativeSource={RelativeSource TemplatedParent}}"
IsVisible="{Binding !!Header, RelativeSource={RelativeSource TemplatedParent}}"
RenderTransformOrigin=".5,.5" />
</Grid>
</ControlTemplate>
@@ -130,5 +131,56 @@
<Style Selector="^.Danger">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeDangerBadgeBackground}" />
</Style>
<Style Selector="^.Success">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeSuccessBadgeBackground}" />
</Style>
<Style Selector="^.Light">
<Style Selector="^.Primary">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeLightPrimaryBadgeForeground}" />
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeLightPrimaryBadgeBackground}" />
</Style>
<Style Selector="^.Secondary">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeLightSecondaryBadgeForeground}" />
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeLightSecondaryBadgeBackground}" />
</Style>
<Style Selector="^.Tertiary">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeLightTertiaryBadgeForeground}" />
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeLightTertiaryBadgeBackground}" />
</Style>
<Style Selector="^.Warning">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeLightWarningBadgeForeground}" />
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeLightWarningBadgeBackground}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeLightDangerBadgeForeground}" />
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeLightDangerBadgeBackground}" />
</Style>
<Style Selector="^.Success">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeLightSuccessBadgeForeground}" />
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeLightSuccessBadgeBackground}" />
</Style>
</Style>
<Style Selector="^.Inverted">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeInvertedBadgeBackground}" />
<Style Selector="^.Primary">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeInvertedPrimaryBadgeForeground}" />
</Style>
<Style Selector="^.Secondary">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeInvertedSecondaryBadgeForeground}" />
</Style>
<Style Selector="^.Tertiary">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeInvertedTertiaryBadgeForeground}" />
</Style>
<Style Selector="^.Warning">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeInvertedWarningBadgeForeground}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeInvertedDangerBadgeForeground}" />
</Style>
<Style Selector="^.Success">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeInvertedSuccessBadgeForeground}" />
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>
</ResourceDictionary>

View File

@@ -80,6 +80,19 @@
<Setter Property="PathIcon.Foreground" Value="{DynamicResource BannerInformationBorderBrush}" />
</Style>
</Style>
<Style Selector="^[Type=Success]">
<Style Selector="^.Bordered /template/ Border#PART_Container">
<Setter Property="Border.CornerRadius" Value="{DynamicResource BannerCornerRadius}" />
<Setter Property="BorderBrush" Value="{DynamicResource BannerSuccessBorderBrush}" />
</Style>
<Style Selector="^ /template/ Border#PART_Container">
<Setter Property="Background" Value="{DynamicResource BannerSuccessBackground}" />
</Style>
<Style Selector="^ /template/ PathIcon#PART_BuildInIcon">
<Setter Property="PathIcon.Data" Value="{DynamicResource BannerSuccessIconGeometry}" />
<Setter Property="PathIcon.Foreground" Value="{DynamicResource BannerSuccessBorderBrush}" />
</Style>
</Style>
<Style Selector="^[Type=Warning]">
<Style Selector="^.Bordered /template/ Border#PART_Container">
<Setter Property="Border.CornerRadius" Value="{DynamicResource BannerCornerRadius}" />
@@ -106,18 +119,5 @@
<Setter Property="PathIcon.Foreground" Value="{DynamicResource BannerErrorBorderBrush}" />
</Style>
</Style>
<Style Selector="^[Type=Success]">
<Style Selector="^.Bordered /template/ Border#PART_Container">
<Setter Property="Border.CornerRadius" Value="{DynamicResource BannerCornerRadius}" />
<Setter Property="BorderBrush" Value="{DynamicResource BannerSuccessBorderBrush}" />
</Style>
<Style Selector="^ /template/ Border#PART_Container">
<Setter Property="Background" Value="{DynamicResource BannerSuccessBackground}" />
</Style>
<Style Selector="^ /template/ PathIcon#PART_BuildInIcon">
<Setter Property="PathIcon.Data" Value="{DynamicResource BannerSuccessIconGeometry}" />
<Setter Property="PathIcon.Foreground" Value="{DynamicResource BannerSuccessBorderBrush}" />
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -63,6 +63,7 @@
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
FontWeight="{TemplateBinding FontWeight}"
Foreground="{TemplateBinding Foreground}" />
</Border>

View File

@@ -0,0 +1,27 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:ControlClassesInput}" TargetType="u:ControlClassesInput">
<Setter Property="Width" Value="200" />
<Setter Property="Template">
<ControlTemplate TargetType="u:ControlClassesInput">
<u:TagInput
HorizontalAlignment="Stretch"
AllowDuplicates="False"
Separator="{TemplateBinding Separator}"
Tags="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TargetClasses, Mode=TwoWay}" />
</ControlTemplate>
</Setter>
<!--
<Setter Property="ContextFlyout">
<MenuFlyout>
<MenuItem Header="Undo" Command="{Binding $parent[u:ControlClassesInput].UnDo}" />
<MenuItem Header="Redo" Command="{Binding $parent[u:ControlClassesInput].Redo}" />
<MenuItem Header="Clear" Command="{Binding $parent[u:ControlClassesInput].Clear}" />
</MenuFlyout>
</Setter>
-->
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,716 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:theme="clr-namespace:Ursa.Themes.Semi"
xmlns:u="https://irihi.tech/ursa">
<ControlTheme x:Key="{x:Type u:OverlayDialogHost}" TargetType="u:OverlayDialogHost">
<Setter Property="OverlayMaskBrush" Value="{DynamicResource OverlayDialogMaskBrush}" />
</ControlTheme>
<ControlTheme x:Key="{x:Type u:CustomDialogControl}" TargetType="u:CustomDialogControl">
<Setter Property="CornerRadius" Value="12" />
<Setter Property="Transitions">
<Transitions>
<TransformOperationsTransition Duration="0.2" Property="RenderTransform"/>
</Transitions>
</Setter>
<Setter Property="RenderTransform" Value="scale(1.0)"></Setter>
<Setter Property="Template">
<ControlTemplate TargetType="u:CustomDialogControl">
<Border
Margin="8"
Padding="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Classes="Shadow"
ClipToBounds="False"
CornerRadius="{TemplateBinding CornerRadius}"
IsHitTestVisible="True"
Theme="{DynamicResource CardBorder}">
<Border ClipToBounds="True" CornerRadius="{TemplateBinding CornerRadius}">
<Grid RowDefinitions="Auto, *">
<ContentPresenter
Name="PART_ContentPresenter"
Grid.Row="0"
Grid.RowSpan="2"
Content="{TemplateBinding Content}" />
<Grid Grid.Row="0" ColumnDefinitions="*, Auto">
<Panel
Name="{x:Static u:DialogControlBase.PART_TitleArea}"
Grid.Column="0"
Grid.ColumnSpan="2"
Background="Transparent" />
<Button
Name="{x:Static u:MessageBoxWindow.PART_CloseButton}"
Grid.Column="1"
Margin="0,24,24,0"
DockPanel.Dock="Right"
Theme="{DynamicResource CloseButton}" />
</Grid>
</Grid>
</Border>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^[IsClosed=True]">
<Setter Property="RenderTransform" Value="scale(0.95)"/>
</Style>
<Style Selector="^ /template/ Panel#PART_TitleArea">
<Setter Property="ContextFlyout">
<MenuFlyout>
<MenuItem
Command="{Binding $parent[u:DialogControlBase].Close}"
Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
<MenuItem.Icon>
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource WindowCloseIconGlyph}" />
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</Setter>
</Style>
<Style Selector="^:not(:modal) /template/ Panel#PART_TitleArea">
<Setter Property="ContextFlyout">
<MenuFlyout>
<MenuItem
Command="{Binding $parent[u:DialogControlBase].UpdateLayer}"
CommandParameter="{x:Static u:DialogLayerChangeType.BringForward}"
Header="{DynamicResource STRING_MENU_BRING_FORWARD}">
<MenuItem.Icon>
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource DialogArrangeBringForwardGlyph}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
Command="{Binding $parent[u:DialogControlBase].UpdateLayer}"
CommandParameter="{x:Static u:DialogLayerChangeType.BringToFront}"
Header="{DynamicResource STRING_MENU_BRING_TO_FRONT}">
<MenuItem.Icon>
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource DialogArrangeBringToFrontGlyph}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
Command="{Binding $parent[u:DialogControlBase].UpdateLayer}"
CommandParameter="{x:Static u:DialogLayerChangeType.SendBackward}"
Header="{DynamicResource STRING_MENU_SEND_BACKWARD}">
<MenuItem.Icon>
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource DialogArrangeSendBackwardGlyph}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
Command="{Binding $parent[u:DialogControlBase].UpdateLayer}"
CommandParameter="{x:Static u:DialogLayerChangeType.SendToBack}"
Header="{DynamicResource STRING_MENU_SEND_TO_BACK}">
<MenuItem.Icon>
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource DialogArrangeSendToBackGlyph}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
Command="{Binding $parent[u:DialogControlBase].Close}"
Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
<MenuItem.Icon>
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource WindowCloseIconGlyph}" />
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</Setter>
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:DefaultDialogControl}" TargetType="u:DefaultDialogControl">
<Setter Property="CornerRadius" Value="12" />
<Setter Property="Transitions">
<Transitions>
<TransformOperationsTransition Duration="0.2" Property="RenderTransform"/>
</Transitions>
</Setter>
<Setter Property="Template">
<ControlTemplate TargetType="u:DefaultDialogControl">
<Border
Margin="10"
Padding="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
BoxShadow="0 0 8 0 #1A000000"
Classes="Shadow"
ClipToBounds="False"
CornerRadius="{TemplateBinding CornerRadius}"
IsHitTestVisible="True"
Theme="{DynamicResource CardBorder}">
<Border ClipToBounds="True" CornerRadius="{TemplateBinding CornerRadius}">
<Grid RowDefinitions="Auto, *, Auto">
<ScrollViewer Grid.Row="1">
<ContentPresenter
Name="PART_ContentPresenter"
Grid.Row="1"
Margin="24,8"
Content="{TemplateBinding Content}" />
</ScrollViewer>
<Grid Grid.Row="0" ColumnDefinitions="Auto, *, Auto">
<Panel
Name="{x:Static u:DialogControlBase.PART_TitleArea}"
Grid.Column="0"
Grid.ColumnSpan="3"
Background="Transparent" />
<PathIcon
Name="PART_Icon"
Grid.Column="0"
Width="16"
Height="16"
Margin="24,24,8,0"
VerticalAlignment="Center" />
<TextBlock
Name="PART_Title"
Grid.Column="1"
Margin="0,24,0,0"
VerticalAlignment="Center"
FontSize="16"
FontWeight="Bold"
IsHitTestVisible="False"
IsVisible="{TemplateBinding Title,
Converter={x:Static ObjectConverters.IsNotNull}}"
Text="{TemplateBinding Title}"
TextWrapping="Wrap" />
<Button
Name="{x:Static u:MessageBoxWindow.PART_CloseButton}"
Grid.Column="2"
Margin="0,24,24,0"
DockPanel.Dock="Right"
Theme="{DynamicResource CloseButton}" />
</Grid>
<StackPanel
Grid.Row="2"
Margin="24,0,24,24"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button
Name="{x:Static u:DefaultDialogControl.PART_CancelButton}"
Margin="8,0,0,0"
Classes="Tertiary"
Content="{DynamicResource STRING_MENU_DIALOG_CANCEL}" />
<Button
Name="{x:Static u:DefaultDialogControl.PART_NoButton}"
Margin="8,0,0,0"
Classes="Danger"
Content="{DynamicResource STRING_MENU_DIALOG_NO}"
Theme="{DynamicResource SolidButton}" />
<Button
Name="{x:Static u:DefaultDialogControl.PART_YesButton}"
Margin="8,0,0,0"
Classes="Primary"
Content="{DynamicResource STRING_MENU_DIALOG_YES}"
Theme="{DynamicResource SolidButton}" />
<Button
Name="{x:Static u:DefaultDialogControl.PART_OKButton}"
Margin="8,0,0,0"
Classes="Primary"
Content="{DynamicResource STRING_MENU_DIALOG_OK}"
Theme="{DynamicResource SolidButton}" />
</StackPanel>
</Grid>
</Border>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^[IsClosed=True]">
<Setter Property="RenderTransform" Value="scale(0.95)"/>
</Style>
<Style Selector="^[Mode=None]">
<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ TextBlock#PART_Title">
<Setter Property="Margin" Value="24 24 0 0" />
</Style>
<Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="theme:ClassHelper.Classes" Value="Primary" />
</Style>
<Style Selector="^ /template/ Button#PART_YesButton">
<Setter Property="theme:ClassHelper.Classes" Value="Primary" />
</Style>
<Style Selector="^ /template/ Button#PART_NoButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
</Style>
<Style Selector="^ /template/ Button#PART_CancelButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
</Style>
<Style Selector="^[Mode=Info]">
<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Data" Value="{DynamicResource DialogInformationIconGlyph}" />
<Setter Property="Foreground" Value="{DynamicResource SemiBlue6}" />
</Style>
<Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="theme:ClassHelper.Classes" Value="Primary" />
</Style>
<Style Selector="^ /template/ Button#PART_YesButton">
<Setter Property="theme:ClassHelper.Classes" Value="Primary" />
</Style>
<Style Selector="^ /template/ Button#PART_NoButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
</Style>
<Style Selector="^ /template/ Button#PART_CancelButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
</Style>
<Style Selector="^[Mode=Warning]">
<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Data" Value="{DynamicResource DialogWarningIconGlyph}" />
<Setter Property="Foreground" Value="{DynamicResource SemiOrange6}" />
</Style>
<Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="theme:ClassHelper.Classes" Value="Warning" />
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
</Style>
<Style Selector="^ /template/ Button#PART_YesButton">
<Setter Property="theme:ClassHelper.Classes" Value="Warning" />
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
</Style>
<Style Selector="^ /template/ Button#PART_NoButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
</Style>
<Style Selector="^ /template/ Button#PART_CancelButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
</Style>
<Style Selector="^[Mode=Error]">
<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Data" Value="{DynamicResource DialogErrorIconGlyph}" />
<Setter Property="Foreground" Value="{DynamicResource SemiRed6}" />
</Style>
<Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
</Style>
<Style Selector="^ /template/ Button#PART_YesButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
</Style>
<Style Selector="^ /template/ Button#PART_NoButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
<Style Selector="^ /template/ Button#PART_CancelButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
</Style>
<Style Selector="^[Mode=Question]">
<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Data" Value="{DynamicResource DialogQuestionIconGlyph}" />
<Setter Property="Foreground" Value="{DynamicResource SemiBlue6}" />
</Style>
<Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="theme:ClassHelper.Classes" Value="Primary" />
</Style>
<Style Selector="^ /template/ Button#PART_YesButton">
<Setter Property="theme:ClassHelper.Classes" Value="Primary" />
</Style>
<Style Selector="^ /template/ Button#PART_NoButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
</Style>
<Style Selector="^ /template/ Button#PART_CancelButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
</Style>
<Style Selector="^[Mode=Success]">
<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Data" Value="{DynamicResource DialogSuccessIconGlyph}" />
<Setter Property="Foreground" Value="{DynamicResource SemiGreen6}" />
</Style>
<Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="theme:ClassHelper.Classes" Value="Success" />
</Style>
<Style Selector="^ /template/ Button#PART_YesButton">
<Setter Property="theme:ClassHelper.Classes" Value="Success" />
</Style>
<Style Selector="^ /template/ Button#PART_NoButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
</Style>
<Style Selector="^ /template/ Button#PART_CancelButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
</Style>
<Style Selector="^ /template/ Panel#PART_TitleArea">
<Setter Property="ContextFlyout">
<MenuFlyout>
<MenuItem
Command="{Binding $parent[u:DialogControlBase].Close}"
Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
<MenuItem.Icon>
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource WindowCloseIconGlyph}" />
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</Setter>
</Style>
<Style Selector="^:not(:modal) /template/ Panel#PART_TitleArea">
<Setter Property="ContextFlyout">
<MenuFlyout>
<MenuItem
Command="{Binding $parent[u:DialogControlBase].UpdateLayer}"
CommandParameter="{x:Static u:DialogLayerChangeType.BringForward}"
Header="{DynamicResource STRING_MENU_BRING_FORWARD}">
<MenuItem.Icon>
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource DialogArrangeBringForwardGlyph}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
Command="{Binding $parent[u:DialogControlBase].UpdateLayer}"
CommandParameter="{x:Static u:DialogLayerChangeType.BringToFront}"
Header="{DynamicResource STRING_MENU_BRING_TO_FRONT}">
<MenuItem.Icon>
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource DialogArrangeBringToFrontGlyph}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
Command="{Binding $parent[u:DialogControlBase].UpdateLayer}"
CommandParameter="{x:Static u:DialogLayerChangeType.SendBackward}"
Header="{DynamicResource STRING_MENU_SEND_BACKWARD}">
<MenuItem.Icon>
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource DialogArrangeSendBackwardGlyph}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
Command="{Binding $parent[u:DialogControlBase].UpdateLayer}"
CommandParameter="{x:Static u:DialogLayerChangeType.SendToBack}"
Header="{DynamicResource STRING_MENU_SEND_TO_BACK}">
<MenuItem.Icon>
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource DialogArrangeSendToBackGlyph}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
Command="{Binding $parent[u:DialogControlBase].Close}"
CommandParameter="{x:Static u:DialogLayerChangeType.BringForward}"
Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
<MenuItem.Icon>
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource WindowCloseIconGlyph}" />
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</Setter>
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:DialogWindow}" TargetType="u:DialogWindow">
<Setter Property="Title" Value="{x:Null}" />
<Setter Property="Background" Value="{DynamicResource BorderCardBackground}" />
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource WindowDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource WindowDefaultForeground}" />
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" />
<Setter Property="Padding" Value="48 24" />
<Setter Property="SizeToContent" Value="WidthAndHeight" />
<Setter Property="WindowStartupLocation" Value="CenterOwner" />
<Setter Property="ExtendClientAreaTitleBarHeightHint" Value="1" />
<Setter Property="ExtendClientAreaToDecorationsHint" Value="True" />
<Setter Property="ExtendClientAreaChromeHints" Value="SystemChrome" />
<Setter Property="SystemDecorations">
<OnPlatform>
<OnPlatform.Windows>
<SystemDecorations>Full</SystemDecorations>
</OnPlatform.Windows>
<OnPlatform.Default>
<SystemDecorations>BorderOnly</SystemDecorations>
</OnPlatform.Default>
</OnPlatform>
</Setter>
<Setter Property="CanResize" Value="False" />
<Setter Property="Template">
<ControlTemplate TargetType="u:DialogWindow">
<Panel>
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
<Panel Margin="{TemplateBinding WindowDecorationMargin}" Background="Transparent" />
<VisualLayerManager>
<Grid RowDefinitions="Auto, *">
<ContentPresenter
Grid.Row="0"
Grid.RowSpan="2"
Content="{TemplateBinding Content}" />
<Grid Grid.Row="0" ColumnDefinitions="*, Auto">
<Panel
Name="{x:Static u:DialogWindow.PART_TitleArea}"
Grid.Column="0"
Grid.ColumnSpan="2"
Background="Transparent" />
<TextBlock
Grid.Column="0"
Margin="24,24,0,0"
FontSize="14"
FontWeight="Bold"
Text="{TemplateBinding Title}"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap" />
<Button
Name="{x:Static u:MessageBoxWindow.PART_CloseButton}"
Grid.Column="1"
Margin="0,24,24,0"
Theme="{DynamicResource CloseButton}" />
</Grid>
</Grid>
</VisualLayerManager>
</Panel>
</ControlTemplate>
</Setter>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:DefaultDialogWindow}" TargetType="u:DefaultDialogWindow">
<Setter Property="Title" Value="{x:Null}" />
<Setter Property="Background" Value="{DynamicResource BorderCardBackground}" />
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource WindowDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource WindowDefaultForeground}" />
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" />
<Setter Property="Padding" Value="48 24" />
<Setter Property="SizeToContent" Value="WidthAndHeight" />
<Setter Property="WindowStartupLocation" Value="CenterOwner" />
<Setter Property="ExtendClientAreaTitleBarHeightHint" Value="1" />
<Setter Property="ExtendClientAreaToDecorationsHint" Value="True" />
<Setter Property="ExtendClientAreaChromeHints" Value="SystemChrome" />
<Setter Property="SystemDecorations">
<OnPlatform>
<OnPlatform.Windows>
<SystemDecorations>Full</SystemDecorations>
</OnPlatform.Windows>
<OnPlatform.Default>
<SystemDecorations>BorderOnly</SystemDecorations>
</OnPlatform.Default>
</OnPlatform>
</Setter>
<Setter Property="CanResize" Value="False" />
<Setter Property="Template">
<ControlTemplate TargetType="u:DefaultDialogWindow">
<Panel>
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
<Panel Margin="{TemplateBinding WindowDecorationMargin}" Background="Transparent" />
<VisualLayerManager>
<Grid RowDefinitions="Auto, *, Auto">
<ContentPresenter
Name="PART_ContentPresenter"
Grid.Row="1"
Margin="24,8"
Content="{TemplateBinding Content}" />
<Grid Grid.Row="0" ColumnDefinitions="Auto, *, Auto">
<Panel
Name="{x:Static u:DialogWindow.PART_TitleArea}"
Grid.Column="0"
Grid.ColumnSpan="3"
Background="Transparent" />
<PathIcon
Name="PART_Icon"
Grid.Column="0"
Width="16"
Height="16"
Margin="24,24,8,0"
VerticalAlignment="Center" />
<TextBlock
Name="PART_Title"
Grid.Column="1"
Margin="0,24,0,0"
VerticalAlignment="Center"
FontSize="16"
FontWeight="Bold"
IsHitTestVisible="False"
IsVisible="{TemplateBinding Title,
Converter={x:Static ObjectConverters.IsNotNull}}"
Text="{TemplateBinding Title}"
TextWrapping="Wrap" />
<Button
Name="{x:Static u:MessageBoxWindow.PART_CloseButton}"
Grid.Column="2"
Margin="0,24,24,0"
DockPanel.Dock="Right"
Theme="{DynamicResource CloseButton}" />
</Grid>
<StackPanel
Grid.Row="2"
Margin="24,0,24,24"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button
Name="{x:Static u:DefaultDialogControl.PART_CancelButton}"
Margin="8,0,0,0"
Classes="Tertiary"
Content="{DynamicResource STRING_MENU_DIALOG_CANCEL}" />
<Button
Name="{x:Static u:DefaultDialogControl.PART_NoButton}"
Margin="8,0,0,0"
Classes="Danger"
Content="{DynamicResource STRING_MENU_DIALOG_NO}"
Theme="{DynamicResource SolidButton}" />
<Button
Name="{x:Static u:DefaultDialogControl.PART_YesButton}"
Margin="8,0,0,0"
Classes="Primary"
Content="{DynamicResource STRING_MENU_DIALOG_YES}"
Theme="{DynamicResource SolidButton}" />
<Button
Name="{x:Static u:DefaultDialogControl.PART_OKButton}"
Margin="8,0,0,0"
Classes="Primary"
Content="{DynamicResource STRING_MENU_DIALOG_OK}"
Theme="{DynamicResource SolidButton}" />
</StackPanel>
</Grid>
</VisualLayerManager>
</Panel>
</ControlTemplate>
</Setter>
<Style Selector="^[Mode=None]">
<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ TextBlock#PART_Title">
<Setter Property="Margin" Value="24 24 0 0" />
</Style>
<Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="theme:ClassHelper.Classes" Value="Primary" />
</Style>
<Style Selector="^ /template/ Button#PART_YesButton">
<Setter Property="theme:ClassHelper.Classes" Value="Primary" />
</Style>
<Style Selector="^ /template/ Button#PART_NoButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
</Style>
<Style Selector="^ /template/ Button#PART_CancelButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
</Style>
<Style Selector="^[Mode=Info]">
<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Data" Value="{DynamicResource DialogInformationIconGlyph}" />
<Setter Property="Foreground" Value="{DynamicResource SemiBlue6}" />
</Style>
<Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="theme:ClassHelper.Classes" Value="Primary" />
</Style>
<Style Selector="^ /template/ Button#PART_YesButton">
<Setter Property="theme:ClassHelper.Classes" Value="Primary" />
</Style>
<Style Selector="^ /template/ Button#PART_NoButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
</Style>
<Style Selector="^ /template/ Button#PART_CancelButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
</Style>
<Style Selector="^[Mode=Warning]">
<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Data" Value="{DynamicResource DialogWarningIconGlyph}" />
<Setter Property="Foreground" Value="{DynamicResource SemiOrange6}" />
</Style>
<Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="theme:ClassHelper.Classes" Value="Warning" />
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
</Style>
<Style Selector="^ /template/ Button#PART_YesButton">
<Setter Property="theme:ClassHelper.Classes" Value="Warning" />
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
</Style>
<Style Selector="^ /template/ Button#PART_NoButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
</Style>
<Style Selector="^ /template/ Button#PART_CancelButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
</Style>
<Style Selector="^[Mode=Error]">
<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Data" Value="{DynamicResource DialogErrorIconGlyph}" />
<Setter Property="Foreground" Value="{DynamicResource SemiRed6}" />
</Style>
<Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
</Style>
<Style Selector="^ /template/ Button#PART_YesButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
</Style>
<Style Selector="^ /template/ Button#PART_NoButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
<Style Selector="^ /template/ Button#PART_CancelButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
</Style>
<Style Selector="^[Mode=Question]">
<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Data" Value="{DynamicResource DialogQuestionIconGlyph}" />
<Setter Property="Foreground" Value="{DynamicResource SemiBlue6}" />
</Style>
<Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="theme:ClassHelper.Classes" Value="Primary" />
</Style>
<Style Selector="^ /template/ Button#PART_YesButton">
<Setter Property="theme:ClassHelper.Classes" Value="Primary" />
</Style>
<Style Selector="^ /template/ Button#PART_NoButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
</Style>
<Style Selector="^ /template/ Button#PART_CancelButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
</Style>
<Style Selector="^[Mode=Success]">
<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Data" Value="{DynamicResource DialogSuccessIconGlyph}" />
<Setter Property="Foreground" Value="{DynamicResource SemiGreen6}" />
</Style>
<Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="theme:ClassHelper.Classes" Value="Success" />
</Style>
<Style Selector="^ /template/ Button#PART_YesButton">
<Setter Property="theme:ClassHelper.Classes" Value="Success" />
</Style>
<Style Selector="^ /template/ Button#PART_NoButton">
<Setter Property="theme:ClassHelper.Classes" Value="Danger" />
</Style>
<Style Selector="^ /template/ Button#PART_CancelButton">
<Setter Property="theme:ClassHelper.Classes" Value="Tertiary" />
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,42 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Add Resources Here -->
<ControlTheme x:Key="CloseButton" TargetType="Button">
<Setter Property="CornerRadius" Value="6" />
<Setter Property="Margin" Value="0, 4" />
<Setter Property="Padding" Value="4" />
<Setter Property="Height" Value="28" />
<Setter Property="Width" Value="28" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="Template">
<ControlTemplate TargetType="Button">
<Border
Name="PART_Border"
Padding="{TemplateBinding Padding}"
Background="Transparent"
CornerRadius="{TemplateBinding CornerRadius}">
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource WindowCloseIconGlyph}"/>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover /template/ Border">
<Setter Property="Background" Value="{DynamicResource CaptionButtonClosePointeroverBackground}" />
</Style>
<Style Selector="^:pointerover /template/ PathIcon">
<Setter Property="Foreground" Value="White" />
</Style>
<Style Selector="^:pressed /template/ Border">
<Setter Property="Background" Value="{DynamicResource CaptionButtonClosePressedBackground}" />
</Style>
<Style Selector="^:pressed /template/ PathIcon">
<Setter Property="Foreground" Value="White" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,16 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa"
xmlns:shapes="clr-namespace:Ursa.Controls.Shapes;assembly=Ursa">
<!-- Add Resources Here -->
<ControlTheme TargetType="u:DisableContainer" x:Key="{x:Type u:DisableContainer}">
<Setter Property="Template">
<ControlTemplate TargetType="u:DisableContainer">
<Panel>
<ContentPresenter Content="{TemplateBinding Content}"></ContentPresenter>
<shapes:PureRectangle Background="Transparent" IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.IsEnabled, Converter={x:Static BoolConverters.Not}}" Cursor="No" ToolTip.Tip="{TemplateBinding DisabledTip}"/>
</Panel>
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,167 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<ControlTheme TargetType="u:CustomDrawerControl" x:Key="{x:Type u:CustomDrawerControl}">
<Setter Property="VerticalAlignment" Value="Stretch"></Setter>
<Setter Property="HorizontalAlignment" Value="Stretch"></Setter>
<Setter Property="Template">
<ControlTemplate TargetType="u:CustomDrawerControl">
<Border Name="PART_Root"
Margin="8 -1 -1 -1"
Padding="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Classes="Shadow"
ClipToBounds="False"
CornerRadius="12 0 0 12"
BorderThickness="1 0 0 0"
IsHitTestVisible="True"
Theme="{DynamicResource CardBorder}">
<Border ClipToBounds="True" CornerRadius="{Binding #PART_Root.CornerRadius}">
<Grid RowDefinitions="Auto, *">
<ContentPresenter
Name="PART_ContentPresenter"
Grid.Row="0"
Grid.RowSpan="2"
Content="{TemplateBinding Content}" />
<Grid Grid.Row="0" ColumnDefinitions="*, Auto">
<Panel
Name="{x:Static u:DialogControlBase.PART_TitleArea}"
Grid.Column="0"
Grid.ColumnSpan="2"
Background="Transparent" />
<Button
Name="{x:Static u:MessageBoxWindow.PART_CloseButton}"
Grid.Column="1"
Margin="0,24,24,0"
DockPanel.Dock="Right"
Theme="{DynamicResource CloseButton}" />
</Grid>
</Grid>
</Border>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^[Position=Right] /template/ Border#PART_Root">
<Setter Property="Margin" Value="8 0 0 0" />
<Setter Property="CornerRadius" Value="12 0 0 12" />
<Setter Property="BorderThickness" Value="1 0 0 0" />
</Style>
<Style Selector="^[Position=Left] /template/ Border#PART_Root">
<Setter Property="Margin" Value="0 0 8 0" />
<Setter Property="CornerRadius" Value="0 12 12 0" />
<Setter Property="BorderThickness" Value="0 0 1 0" />
</Style>
<Style Selector="^[Position=Top] /template/ Border#PART_Root">
<Setter Property="Margin" Value="0 0 0 8" />
<Setter Property="CornerRadius" Value="0 0 12 12" />
<Setter Property="BorderThickness" Value="0 0 0 1" />
</Style>
<Style Selector="^[Position=Bottom] /template/ Border#PART_Root">
<Setter Property="Margin" Value="0 8 0 0" />
<Setter Property="CornerRadius" Value="12 12 0 0" />
<Setter Property="BorderThickness" Value="0 1 0 0" />
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:DefaultDrawerControl}" TargetType="u:DefaultDrawerControl">
<Setter Property="VerticalAlignment" Value="Stretch"></Setter>
<Setter Property="HorizontalAlignment" Value="Stretch"></Setter>
<Setter Property="Template">
<ControlTemplate TargetType="u:DefaultDrawerControl">
<Border Name="PART_Root"
Margin="8 -1 -1 -1"
Padding="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Classes="Shadow"
ClipToBounds="False"
CornerRadius="12 0 0 12"
BorderThickness="1 0 0 0"
IsHitTestVisible="True"
Theme="{DynamicResource CardBorder}">
<Border ClipToBounds="True" CornerRadius="{Binding #PART_Root.CornerRadius}">
<Grid RowDefinitions="Auto, *, Auto">
<ScrollViewer Grid.Row="1">
<ContentPresenter
Name="PART_ContentPresenter"
Grid.Row="1"
Margin="24,8"
Content="{TemplateBinding Content}" />
</ScrollViewer>
<Grid Grid.Row="0" ColumnDefinitions=" *, Auto">
<TextBlock
Name="PART_Title"
Grid.Column="0"
Margin="24,24,0,0"
VerticalAlignment="Center"
FontSize="16"
FontWeight="Bold"
IsHitTestVisible="False"
IsVisible="{TemplateBinding Title,
Converter={x:Static ObjectConverters.IsNotNull}}"
Text="{TemplateBinding Title}"
TextWrapping="Wrap" />
<Button
Name="{x:Static u:DrawerControlBase.PART_CloseButton}"
Grid.Column="1"
Margin="0,24,24,0"
DockPanel.Dock="Right"
Theme="{DynamicResource CloseButton}" />
</Grid>
<StackPanel
Grid.Row="2"
Margin="24,0,24,24"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button
Name="{x:Static u:DefaultDialogControl.PART_CancelButton}"
Margin="8,0,0,0"
Classes="Tertiary"
Content="{DynamicResource STRING_MENU_DIALOG_CANCEL}" />
<Button
Name="{x:Static u:DefaultDialogControl.PART_NoButton}"
Margin="8,0,0,0"
Classes="Danger"
Content="{DynamicResource STRING_MENU_DIALOG_NO}"
Theme="{DynamicResource SolidButton}" />
<Button
Name="{x:Static u:DefaultDialogControl.PART_YesButton}"
Margin="8,0,0,0"
Classes="Primary"
Content="{DynamicResource STRING_MENU_DIALOG_YES}"
Theme="{DynamicResource SolidButton}" />
<Button
Name="{x:Static u:DefaultDialogControl.PART_OKButton}"
Margin="8,0,0,0"
Classes="Primary"
Content="{DynamicResource STRING_MENU_DIALOG_OK}"
Theme="{DynamicResource SolidButton}" />
</StackPanel>
</Grid>
</Border>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^[Position=Right] /template/ Border#PART_Root">
<Setter Property="Margin" Value="8 0 0 0" />
<Setter Property="CornerRadius" Value="12 0 0 12" />
<Setter Property="BorderThickness" Value="1 0 0 0" />
</Style>
<Style Selector="^[Position=Left] /template/ Border#PART_Root">
<Setter Property="Margin" Value="0 0 8 0" />
<Setter Property="CornerRadius" Value="0 12 12 0" />
<Setter Property="BorderThickness" Value="0 0 1 0" />
</Style>
<Style Selector="^[Position=Top] /template/ Border#PART_Root">
<Setter Property="Margin" Value="0 0 0 8" />
<Setter Property="CornerRadius" Value="0 0 12 12" />
<Setter Property="BorderThickness" Value="0 0 0 1" />
</Style>
<Style Selector="^[Position=Bottom] /template/ Border#PART_Root">
<Setter Property="Margin" Value="0 8 0 0" />
<Setter Property="CornerRadius" Value="12 12 0 0" />
<Setter Property="BorderThickness" Value="0 1 0 0" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,33 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:EnumSelector}" TargetType="u:EnumSelector">
<Setter Property="Width" Value="100" />
<Setter Property="HorizontalAlignment" Value="Left"></Setter>
<Setter Property="Template">
<ControlTemplate TargetType="u:EnumSelector">
<ComboBox
Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Bounds.Width}"
Name="PART_ComboBox"
ItemsSource="{TemplateBinding Values}"
SelectedItem="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedValue, Mode=TwoWay}" />
</ControlTemplate>
</Setter>
<Style Selector="^[DisplayDescription=True] /template/ ComboBox">
<Setter Property="ItemTemplate">
<DataTemplate x:DataType="u:EnumItemTuple">
<TextBlock Text="{Binding DisplayName}"></TextBlock>
</DataTemplate>
</Setter>
</Style>
<Style Selector="^[DisplayDescription=False] /template/ ComboBox">
<Setter Property="ItemTemplate">
<DataTemplate x:DataType="u:EnumItemTuple">
<TextBlock Text="{Binding Value}"></TextBlock>
</DataTemplate>
</Setter>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,97 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:Form}" TargetType="u:Form">
<Setter Property="Grid.IsSharedSizeScope" Value="False" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Template">
<ControlTemplate TargetType="u:Form">
<DataValidationErrors>
<ItemsPresenter ItemsPanel="{TemplateBinding ItemsPanel}" />
</DataValidationErrors>
</ControlTemplate>
</Setter>
<Style Selector="^:fixed-width">
<Setter Property="Grid.IsSharedSizeScope" Value="True" />
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:FormGroup}" TargetType="u:FormGroup">
<Setter Property="Template">
<ControlTemplate TargetType="u:FormGroup">
<StackPanel Margin="0 28 0 0">
<ContentPresenter Content="{TemplateBinding Header}" FontWeight="Bold" FontSize="18" />
<Rectangle
Height="1"
Margin="0,8"
HorizontalAlignment="Stretch"
Fill="{DynamicResource SemiColorBorder}" />
<ItemsPresenter ItemsPanel="{TemplateBinding ItemsPanel}" />
</StackPanel>
</ControlTemplate>
</Setter>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:FormItem}" TargetType="u:FormItem">
<Setter Property="Margin" Value="0 8" />
<Setter Property="Template">
<ControlTemplate TargetType="u:FormItem">
<StackPanel>
<StackPanel
Name="PART_LabelPanel"
Margin="0,0,0,4"
HorizontalAlignment="{TemplateBinding LabelAlignment}"
Orientation="Horizontal">
<ContentPresenter Content="{TemplateBinding Label}" FontWeight="Bold" />
<TextBlock
Foreground="{DynamicResource SemiRed6}"
IsVisible="{TemplateBinding IsRequired}"
Text="*" />
</StackPanel>
<ContentPresenter Content="{TemplateBinding Content}" />
</StackPanel>
</ControlTemplate>
</Setter>
<Style Selector="^:not(:no-label):horizontal">
<Setter Property="Template">
<ControlTemplate TargetType="u:FormItem">
<Grid RowDefinitions="*, *">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Label" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border
Grid.Row="0"
Grid.Column="0"
Width="{TemplateBinding LabelWidth}">
<StackPanel
Name="PART_LabelPanel"
Margin="8,8,8,0"
HorizontalAlignment="{TemplateBinding LabelAlignment}"
Orientation="Horizontal">
<ContentPresenter Content="{TemplateBinding Label}" FontWeight="Bold" />
<TextBlock
Foreground="{DynamicResource SemiRed6}"
IsVisible="{TemplateBinding IsRequired}"
Text="*" />
</StackPanel>
</Border>
<ContentPresenter
Grid.Row="0"
Grid.Column="1"
Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="^:no-label">
<Setter Property="Template">
<ControlTemplate TargetType="u:FormItem">
<ContentPresenter Content="{TemplateBinding Content}" />
</ControlTemplate>
</Setter>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,287 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<converters:BooleansToOpacityConverter x:Key="OpacityConverter" />
<ControlTheme x:Key="{x:Type u:IconButton}" TargetType="u:IconButton">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="RenderTransform" Value="none" />
<Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="MinHeight" Value="12" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<ControlTemplate TargetType="u:IconButton">
<Border
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.FontWeight="{TemplateBinding FontWeight}"
UseLayoutRounding="False">
<Grid
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
ColumnDefinitions="Auto, Auto"
RowDefinitions="Auto, Auto">
<Panel
Name="PART_IconRoot"
Grid.Column="0">
<Panel.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.Or}">
<Binding Path="IsLoading" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding
Converter="{x:Static ObjectConverters.IsNotNull}"
Path="Icon"
RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</Panel.IsVisible>
<ContentPresenter
Content="{TemplateBinding Icon}"
ContentTemplate="{TemplateBinding IconTemplate}"
Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=!IsLoading, Converter={StaticResource OpacityConverter}}" />
<u:LoadingIcon
Classes="Small"
Foreground="{TemplateBinding Foreground}"
IsVisible="{TemplateBinding IsLoading}" />
</Panel>
<ContentPresenter
Name="PART_ContentPresenter"
Grid.Column="1"
Margin="8 0 0 0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="{TemplateBinding Content}" />
</Grid>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:pressed">
<Setter Property="RenderTransform" Value="scale(0.98)" />
</Style>
<Style Selector="^.Primary">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
</Style>
<Style Selector="^.Secondary">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSecondaryForeground}" />
</Style>
<Style Selector="^.Tertiary">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
</Style>
<Style Selector="^.Success">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSuccessForeground}" />
</Style>
<Style Selector="^.Warning">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultWarningForeground}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" />
</Style>
<Style Selector="^:pointerover">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
</Style>
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
<Style Selector="^:empty[IsLoading=False] /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Margin" Value="0"></Setter>
</Style>
<Style Selector="^:right">
<Style Selector="^ /template/ Panel#PART_IconRoot">
<Setter Property="Grid.Column" Value="1" />
<Setter Property="Grid.Row" Value="0" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Grid.Column" Value="0" />
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Margin" Value="0 0 8 0" />
</Style>
</Style>
<Style Selector="^:left">
<Style Selector="^ /template/ Panel#PART_IconRoot">
<Setter Property="Grid.Column" Value="0" />
<Setter Property="Grid.Row" Value="0" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Grid.Column" Value="1" />
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Margin" Value="8 0 0 0" />
</Style>
</Style>
<Style Selector="^:top">
<Style Selector="^ /template/ Panel#PART_IconRoot">
<Setter Property="Grid.Column" Value="0" />
<Setter Property="Grid.Row" Value="0" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Grid.Column" Value="0" />
<Setter Property="Grid.Row" Value="1" />
<Setter Property="Margin" Value="0 4 0 0" />
</Style>
</Style>
<Style Selector="^:bottom">
<Style Selector="^ /template/ Panel#PART_IconRoot">
<Setter Property="Grid.Column" Value="0" />
<Setter Property="Grid.Row" Value="1" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Grid.Column" Value="0" />
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Margin" Value="0 0 0 4" />
</Style>
</Style>
<Style Selector="^.Large">
<Setter Property="Padding" Value="{DynamicResource ButtonLargePadding}" />
</Style>
<Style Selector="^.Small">
<Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" />
</Style>
</ControlTheme>
<ControlTheme
x:Key="SolidIconButton"
BasedOn="{StaticResource {x:Type u:IconButton}}"
TargetType="u:IconButton">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style>
<Style Selector="^.Primary">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Secondary">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Tertiary">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Success">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessBorderBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Warning">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Danger">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme>
<ControlTheme
x:Key="BorderlessIconButton"
BasedOn="{StaticResource {x:Type u:IconButton}}"
TargetType="u:IconButton">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,32 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:ImageViewer}" TargetType="u:ImageViewer">
<Setter Property="Background" Value="LightGray" />
<Setter Property="Template">
<ControlTemplate TargetType="{x:Type u:ImageViewer}">
<VisualLayerManager Name="{x:Static u:ImageViewer.PART_Layer}">
<Border Background="{TemplateBinding Background}" ClipToBounds="True">
<Image
Name="{x:Static u:ImageViewer.PART_Image}"
Source="{TemplateBinding Source}"
Stretch="Uniform">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="{Binding Scale, RelativeSource={RelativeSource TemplatedParent}}" ScaleY="{Binding Scale, RelativeSource={RelativeSource TemplatedParent}}" />
<TranslateTransform X="{Binding TranslateX, RelativeSource={RelativeSource TemplatedParent}}" Y="{Binding TranslateY, RelativeSource={RelativeSource TemplatedParent}}" />
<RotateTransform Angle="0" />
</TransformGroup>
</Image.RenderTransform>
</Image>
</Border>
</VisualLayerManager>
</ControlTemplate>
</Setter>
<Style Selector="^:moving">
<Setter Property="Cursor" Value="Hand" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -2,17 +2,19 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="using:Avalonia.Controls.Converters"
xmlns:ursaConverters="using:Ursa.Converters"
xmlns:u="https://irihi.tech/ursa">
<converters:PlatformKeyGestureConverter x:Key="KeyGestureConverter" />
<ControlTheme x:Key="{x:Type u:KeyGestureInput}" TargetType="u:KeyGestureInput">
<Setter Property="Width" Value="{DynamicResource KeyGestureInputWidth}" />
<Setter Property="Height" Value="{DynamicResource KeyGestureInputHeight}" />
<Setter Property="MinWidth" Value="{DynamicResource KeyGestureInputWidth}" />
<Setter Property="MinHeight" Value="{DynamicResource KeyGestureInputHeight}" />
<Setter Property="Background" Value="{DynamicResource KeyGestureInputBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource KeyGestureInputBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource KeyGestureInputBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource KeyGestureInputCornerRadius}" />
<Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
<Setter Property="Padding" Value="8 0" />
<Setter Property="Template">
<ControlTemplate TargetType="u:KeyGestureInput">
<Border
@@ -23,11 +25,43 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<SelectableTextBlock
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Text="{TemplateBinding Gesture,
Converter={StaticResource KeyGestureConverter}}" />
<Panel VerticalAlignment="Stretch" Margin="{TemplateBinding Padding}">
<Grid ColumnDefinitions="Auto, *, Auto" >
<ContentPresenter Grid.Column="0"
Content="{TemplateBinding InnerLeftContent}"
Padding="{TemplateBinding Padding, Converter={x:Static ursaConverters:ThicknessIncludeConverter.Right}}"
DockPanel.Dock="Left"
VerticalAlignment="Stretch"
VerticalContentAlignment="Center"
Foreground="{DynamicResource TextBoxInnerForeground}"
IsVisible="{Binding Path=InnerLeftContent, RelativeSource={RelativeSource TemplatedParent},
Converter={x:Static ObjectConverters.IsNotNull}}" />
<ContentPresenter
Grid.Column="2"
Content="{TemplateBinding InnerRightContent}"
DockPanel.Dock="Right"
Padding="{TemplateBinding Padding, Converter={x:Static ursaConverters:ThicknessIncludeConverter.Left}}"
VerticalAlignment="Stretch"
VerticalContentAlignment="Center"
Foreground="{DynamicResource TextBoxInnerForeground}"
IsVisible="{Binding Path=InnerRightContent, RelativeSource={RelativeSource TemplatedParent},
Converter={x:Static ObjectConverters.IsNotNull}}" />
<SelectableTextBlock
Grid.Column="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Text="{TemplateBinding Gesture,
Converter={StaticResource KeyGestureConverter}}" />
<Button Grid.Column="0" Grid.ColumnSpan="3"
Name="PART_ClearButton"
Margin="0,0,8,0"
HorizontalAlignment="Right"
Command="{Binding $parent[u:KeyGestureInput].Clear}"
Focusable="False"
IsVisible="False"
Theme="{DynamicResource InputClearButton}" />
</Grid>
</Panel>
</Border>
</ControlTemplate>
</Setter>
@@ -45,5 +79,13 @@
<Setter Property="Background" Value="{DynamicResource KeyGestureInputPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource KeyGestureInputFocusBorderBrush}" />
</Style>
<Style Selector="^:not(:empty).clearButton, ^:not(:empty).ClearButton">
<Style Selector="^:focus /template/ Button#PART_ClearButton">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^:pointerover /template/ Button#PART_ClearButton">
<Setter Property="IsVisible" Value="True" />
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -2,7 +2,8 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters"
xmlns:u="clr-namespace:Ursa.Controls;assembly=Ursa">
xmlns:u="clr-namespace:Ursa.Controls;assembly=Ursa"
xmlns:shapes="clr-namespace:Ursa.Controls.Shapes;assembly=Ursa">
<!-- Add Resources Here -->
<converters:BrushToColorConverter x:Key="BrushToColorConverter" />
<ControlTheme x:Key="{x:Type u:LoadingIcon}" TargetType="u:LoadingIcon">
@@ -12,6 +13,7 @@
<Arc
Name="PART_Arc"
Width="20"
IsVisible="{TemplateBinding IsVisible}"
Height="20"
StartAngle="0"
StrokeJoin="Round"
@@ -28,7 +30,7 @@
</ConicGradientBrush>
</Arc.Stroke>
<Arc.Styles>
<Style Selector="Arc">
<Style Selector="Arc[IsVisible=True]">
<Style.Animations>
<Animation IterationCount="Infinite" Duration="0:0:0.5">
<KeyFrame Cue="0%">
@@ -66,7 +68,7 @@
<Setter Property="Template">
<ControlTemplate TargetType="u:Loading">
<Panel IsVisible="{TemplateBinding IsLoading}">
<Border
<shapes:PureRectangle
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{TemplateBinding Background}" />

View File

@@ -0,0 +1,298 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:MessageBoxWindow}" TargetType="u:MessageBoxWindow">
<Setter Property="Title" Value="{x:Null}" />
<Setter Property="Background" Value="{DynamicResource BorderCardBackground}" />
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource WindowDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource WindowDefaultForeground}" />
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" />
<Setter Property="Padding" Value="48 24" />
<Setter Property="SizeToContent" Value="WidthAndHeight" />
<Setter Property="WindowStartupLocation" Value="CenterOwner" />
<Setter Property="ExtendClientAreaTitleBarHeightHint" Value="1" />
<Setter Property="ExtendClientAreaToDecorationsHint" Value="True" />
<Setter Property="ExtendClientAreaChromeHints" Value="SystemChrome" />
<Setter Property="SystemDecorations">
<OnPlatform>
<OnPlatform.Windows>
<SystemDecorations>Full</SystemDecorations>
</OnPlatform.Windows>
<OnPlatform.Default>
<SystemDecorations>BorderOnly</SystemDecorations>
</OnPlatform.Default>
</OnPlatform>
</Setter>
<Setter Property="CanResize" Value="False" />
<Setter Property="Template">
<ControlTemplate TargetType="u:MessageBoxWindow">
<Panel>
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
<Panel Margin="{TemplateBinding WindowDecorationMargin}" Background="Transparent" />
<ChromeOverlayLayer />
<Grid RowDefinitions="Auto, *, Auto">
<Grid
Grid.Row="0"
Margin="24,24,24,0"
ColumnDefinitions="Auto, *, Auto">
<PathIcon
Name="PART_Icon"
Grid.Column="0"
Width="24"
Height="24"
Margin="0,0,8,0"
VerticalAlignment="Center"
IsHitTestVisible="False" />
<TextBlock
Grid.Column="1"
VerticalAlignment="Center"
FontSize="16"
FontWeight="Bold"
IsHitTestVisible="False"
Text="{TemplateBinding Title}"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap" />
<Button
Name="{x:Static u:MessageBoxWindow.PART_CloseButton}"
Grid.Column="2"
Theme="{DynamicResource CloseButton}" />
</Grid>
<Grid
Grid.Row="1"
MaxWidth="{DynamicResource MessageBoxWindowContentMaxWidth}"
Margin="{TemplateBinding Padding}"
ColumnDefinitions="Auto, *">
<ScrollViewer
Grid.Column="1"
MaxHeight="300"
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto">
<TextBlock
Name="PART_ContentPresenter"
VerticalAlignment="Center"
Text="{TemplateBinding Content}"
TextAlignment="Left"
TextWrapping="Wrap" />
</ScrollViewer>
</Grid>
<StackPanel
Grid.Row="2"
Margin="24,0,24,24"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button
Name="{x:Static u:MessageBoxWindow.PART_CancelButton}"
Margin="8,0,0,0"
Classes="Tertiary"
Content="{DynamicResource STRING_MENU_DIALOG_CANCEL}" />
<Button
Name="{x:Static u:MessageBoxWindow.PART_NoButton}"
Margin="8,0,0,0"
Classes="Danger"
Content="{DynamicResource STRING_MENU_DIALOG_NO}"
Theme="{DynamicResource SolidButton}" />
<Button
Name="{x:Static u:MessageBoxWindow.PART_YesButton}"
Margin="8,0,0,0"
Classes="Primary"
Content="{DynamicResource STRING_MENU_DIALOG_YES}"
Theme="{DynamicResource SolidButton}" />
<Button
Name="{x:Static u:MessageBoxWindow.PART_OKButton}"
Margin="8,0,0,0"
Classes="Primary"
Content="{DynamicResource STRING_MENU_DIALOG_OK}"
Theme="{DynamicResource SolidButton}" />
</StackPanel>
</Grid>
</Panel>
</ControlTemplate>
</Setter>
<Style Selector="^[MessageIcon=None] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^[MessageIcon=Asterisk] /template/ PathIcon#PART_Icon, ^[MessageIcon=Information] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource SemiBlue6}" />
<Setter Property="Data" Value="{DynamicResource DialogInformationIconGlyph}" />
</Style>
<Style Selector="^[MessageIcon=Error] /template/ PathIcon#PART_Icon, ^[MessageIcon=Hand] /template/ PathIcon#PART_Icon, ^[MessageIcon=Stop] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource SemiRed6}" />
<Setter Property="Data" Value="{DynamicResource DialogErrorIconGlyph}" />
</Style>
<Style Selector="^[MessageIcon=Exclamation] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource SemiYellow6}" />
<Setter Property="Data" Value="{DynamicResource DialogWarningIconGlyph}" />
</Style>
<Style Selector="^[MessageIcon=Question] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource SemiBlue6}" />
<Setter Property="Data" Value="{DynamicResource DialogQuestionIconGlyph}" />
</Style>
<Style Selector="^[MessageIcon=Warning] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource SemiOrange6}" />
<Setter Property="Data" Value="{DynamicResource DialogWarningIconGlyph}" />
</Style>
<Style Selector="^[MessageIcon=Success] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource SemiGreen6}" />
<Setter Property="Data" Value="{DynamicResource DialogSuccessIconGlyph}" />
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:MessageBoxControl}" TargetType="u:MessageBoxControl">
<Setter Property="CornerRadius" Value="12" />
<Setter Property="Padding" Value="48 24" />
<Setter Property="Template">
<ControlTemplate TargetType="u:MessageBoxControl">
<Border
Padding="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Classes="Shadow"
ClipToBounds="False"
CornerRadius="{TemplateBinding CornerRadius}"
IsHitTestVisible="True"
Theme="{DynamicResource CardBorder}">
<Border ClipToBounds="True" CornerRadius="{TemplateBinding CornerRadius}">
<Grid RowDefinitions="Auto, *, Auto">
<Grid Grid.Row="0" ColumnDefinitions="Auto, *, Auto">
<Panel
Name="{x:Static u:DialogControlBase.PART_TitleArea}"
Grid.Column="0"
Grid.ColumnSpan="3"
Background="Transparent" />
<PathIcon
Name="PART_Icon"
Grid.Column="0"
Width="24"
Height="24"
Margin="24,24,8,0"
VerticalAlignment="Center"
IsHitTestVisible="False" />
<TextBlock
Name="PART_Title"
Grid.Column="1"
Margin="0,24,0,0"
VerticalAlignment="Center"
FontSize="16"
FontWeight="Bold"
IsHitTestVisible="False"
Text="{TemplateBinding Title}"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap" />
<Button
Name="{x:Static u:MessageBoxWindow.PART_CloseButton}"
Grid.Column="2"
Margin="0,24,24,0"
Theme="{DynamicResource CloseButton}" />
</Grid>
<Grid
Grid.Row="1"
MaxWidth="{DynamicResource MessageBoxWindowContentMaxWidth}"
Margin="{TemplateBinding Padding}">
<ScrollViewer
MaxHeight="300"
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto">
<TextBlock
Name="PART_ContentPresenter"
VerticalAlignment="Center"
Text="{TemplateBinding Content}"
TextAlignment="Left"
TextWrapping="Wrap" />
</ScrollViewer>
</Grid>
<StackPanel
Grid.Row="2"
Margin="24,0,24,24"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button
Name="{x:Static u:MessageBoxControl.PART_CancelButton}"
Margin="8,0,0,0"
Classes="Tertiary"
Content="{DynamicResource STRING_MENU_DIALOG_CANCEL}" />
<Button
Name="{x:Static u:MessageBoxControl.PART_NoButton}"
Margin="8,0,0,0"
Classes="Danger"
Content="{DynamicResource STRING_MENU_DIALOG_NO}"
Theme="{DynamicResource SolidButton}" />
<Button
Name="{x:Static u:MessageBoxControl.PART_YesButton}"
Margin="8,0,0,0"
Classes="Primary"
Content="{DynamicResource STRING_MENU_DIALOG_YES}"
Theme="{DynamicResource SolidButton}" />
<Button
Name="{x:Static u:MessageBoxControl.PART_OKButton}"
Margin="8,0,0,0"
Classes="Primary"
Content="{DynamicResource STRING_MENU_DIALOG_OK}"
Theme="{DynamicResource SolidButton}" />
</StackPanel>
</Grid>
</Border>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^ /template/ Panel#PART_TitleArea">
<Setter Property="ContextFlyout">
<MenuFlyout>
<MenuItem Command="{Binding $parent[u:CustomDialogControl].CloseDialog}" Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
<MenuItem.Icon>
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource WindowCloseIconGlyph}" />
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</Setter>
</Style>
<Style Selector="^[MessageIcon=None] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^[MessageIcon=None] /template/ TextBlock#PART_Title">
<Setter Property="Margin" Value="24 24 0 0" />
</Style>
<Style Selector="^[MessageIcon=Asterisk] /template/ PathIcon#PART_Icon, ^[MessageIcon=Information] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource SemiBlue6}" />
<Setter Property="Data" Value="{DynamicResource DialogInformationIconGlyph}" />
</Style>
<Style Selector="^[MessageIcon=Error] /template/ PathIcon#PART_Icon, ^[MessageIcon=Hand] /template/ PathIcon#PART_Icon, ^[MessageIcon=Stop] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource SemiRed6}" />
<Setter Property="Data" Value="{DynamicResource DialogErrorIconGlyph}" />
</Style>
<Style Selector="^[MessageIcon=Exclamation] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource SemiYellow6}" />
<Setter Property="Data" Value="{DynamicResource DialogWarningIconGlyph}" />
</Style>
<Style Selector="^[MessageIcon=Question] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource SemiBlue6}" />
<Setter Property="Data" Value="{DynamicResource DialogQuestionIconGlyph}" />
</Style>
<Style Selector="^[MessageIcon=Warning] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource SemiOrange6}" />
<Setter Property="Data" Value="{DynamicResource DialogWarningIconGlyph}" />
</Style>
<Style Selector="^[MessageIcon=Success] /template/ PathIcon#PART_Icon">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource SemiGreen6}" />
<Setter Property="Data" Value="{DynamicResource DialogSuccessIconGlyph}" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,248 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<converters:NavMenuMarginConverter x:Key="NavMarginConverter" />
<ControlTheme x:Key="{x:Type u:NavMenu}" TargetType="u:NavMenu">
<Setter Property="Grid.IsSharedSizeScope" Value="True" />
<Setter Property="SubMenuIndent" Value="24" />
<Setter Property="Template">
<ControlTemplate TargetType="u:NavMenu">
<DockPanel LastChildFill="True">
<ContentPresenter Content="{TemplateBinding Header}" DockPanel.Dock="Top" />
<ContentPresenter Content="{TemplateBinding Footer}" DockPanel.Dock="Bottom" />
<ScrollViewer
HorizontalAlignment="Center"
HorizontalScrollBarVisibility="Disabled"
AllowAutoHide="True"
Theme="{DynamicResource StaticScrollViewer}"
VerticalScrollBarVisibility="Auto">
<ScrollViewer.Styles>
<Style Selector="ScrollViewer /template/ ScrollBar">
<Setter Property="Opacity" Value="0"></Setter>
</Style>
<Style Selector="ScrollViewer:pointerover">
<Style Selector="^ /template/ ScrollBar#PART_HorizontalScrollBar">
<Setter Property="Opacity" Value="1" />
</Style>
<Style Selector="^ /template/ ScrollBar#PART_VerticalScrollBar">
<Setter Property="Opacity" Value="1" />
</Style>
</Style>
</ScrollViewer.Styles>
<ItemsPresenter ItemsPanel="{TemplateBinding ItemsPanel}" />
</ScrollViewer>
</DockPanel>
</ControlTemplate>
</Setter>
<Style Selector="^:horizontal-collapsed">
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
</ControlTheme>
<ControlTemplate x:Key="DefaultNavMenuItemTemplate" TargetType="u:NavMenuItem">
<Grid RowDefinitions="Auto, *">
<Border
Name="PART_Border"
Grid.Row="0"
MinHeight="32"
Background="{TemplateBinding u:NavMenuItem.Background}"
CornerRadius="4"
Cursor="Hand">
<Grid
Name="PART_RootGrid"
HorizontalAlignment="Stretch"
VerticalAlignment="Center">
<Grid.Margin>
<MultiBinding Converter="{StaticResource NavMarginConverter}">
<Binding Path="SubMenuIndent" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Level" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="IsHorizontalCollapsed" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</Grid.Margin>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Icon" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" SharedSizeGroup="Expander" />
</Grid.ColumnDefinitions>
<ContentPresenter
Name="PART_IconPresenter"
Padding="8"
HorizontalAlignment="Left"
Background="Transparent"
Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding IconTemplate, RelativeSource={RelativeSource TemplatedParent}}" />
<ContentPresenter
Name="PART_HeaderPresenter"
Grid.Column="1"
Padding="0,8"
Background="Transparent"
Content="{Binding Header, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding HeaderTemplate, RelativeSource={RelativeSource TemplatedParent}}" />
<PathIcon
Name="PART_ExpanderIcon"
Grid.Column="2"
Width="8"
Height="8"
Margin="12,0"
Data="{DynamicResource NavigationMenuItemExpandIconGlyph}"
Foreground="{DynamicResource NavigationMenuItemExpandIconForeground}">
<PathIcon.Transitions>
<Transitions>
<TransformOperationsTransition Property="RenderTransform" Duration="0.1" />
</Transitions>
</PathIcon.Transitions>
</PathIcon>
<Popup
Name="PART_Popup"
Grid.Column="0"
IsLightDismissEnabled="True"
Placement="RightEdgeAlignedTop"
PlacementTarget="{Binding #PART_Border}">
<Border
Margin="{DynamicResource NavigationMenuItemFlyoutMargin}"
Padding="{DynamicResource MenuFlyoutPadding}"
HorizontalAlignment="Stretch"
Background="{DynamicResource MenuFlyoutBackground}"
BorderBrush="{DynamicResource MenuFlyoutBorderBrush}"
BorderThickness="{DynamicResource MenuFlyoutBorderThickness}"
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
<StackPanel Name="PART_OverflowPanel" />
</Border>
</Popup>
</Grid>
</Border>
<ItemsPresenter
Name="PART_ItemsPresenter"
Grid.Row="1"
Margin="0,4,0,0"
VerticalAlignment="Top"
Grid.IsSharedSizeScope="True"
ItemsPanel="{Binding ItemsPanel, RelativeSource={RelativeSource TemplatedParent}}"
RenderTransformOrigin="0.5,0">
<ItemsPresenter.Transitions>
<Transitions>
<DoubleTransition Property="Height" Duration="0.1" />
<TransformOperationsTransition Property="RenderTransform" Duration="0.1" />
</Transitions>
</ItemsPresenter.Transitions>
</ItemsPresenter>
</Grid>
</ControlTemplate>
<ControlTheme x:Key="{x:Type u:NavMenuItem}" TargetType="u:NavMenuItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="ItemsPanel">
<ItemsPanelTemplate>
<u:OverflowStackPanel />
</ItemsPanelTemplate>
</Setter>
<Setter Property="Template" Value="{StaticResource DefaultNavMenuItemTemplate}" />
<Style Selector="^:selected">
<Setter Property="Background" Value="{DynamicResource NavigationMenuItemSelectedBackground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource NavigationMenuItemSelectedBackground}" />
</Style>
</Style>
<Style Selector="^:vertical-collapsed /template/ ItemsPresenter#PART_ItemsPresenter">
<Setter Property="Height" Value="0" />
<Setter Property="RenderTransform" Value="scale(1,0)" />
</Style>
<Style Selector="^:vertical-collapsed /template/ PathIcon#PART_ExpanderIcon">
<Setter Property="RenderTransform" Value="rotate(180deg)" />
</Style>
<Style Selector="^:empty /template/ PathIcon#PART_ExpanderIcon">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ Border#PART_Border:pointerover">
<Setter Property="Background" Value="{DynamicResource NavigationMenuItemPointeroverBackground}" />
</Style>
<Style Selector="^:horizontal-collapsed:first-level">
<Setter Property="HorizontalAlignment" Value="Left" />
<Style Selector="^ /template/ Border#PART_Border">
<Setter Property="ToolTip.Tip" >
<Template>
<ContentPresenter Content="{TemplateBinding u:NavMenuItem.Header}" ContentTemplate="{TemplateBinding u:NavMenuItem.HeaderTemplate}"></ContentPresenter>
</Template>
</Setter>
<Setter Property="ToolTip.ShowDelay" Value="0" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
<Style Selector="^ /template/ Border#PART_Border:pointerover">
<Setter Property="Background" Value="{DynamicResource NavigationMenuItemPointeroverBackground}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
<Setter Property="Grid.ColumnSpan" Value="3" />
<Setter Property="Margin" Value="0 8" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ PathIcon#PART_ExpanderIcon">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ ItemsPresenter#PART_ItemsPresenter">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ Grid#PART_RootGrid">
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
</Style>
<Style Selector="^:horizontal-collapsed:not(:first-level)">
<Style Selector="^ /template/ PathIcon#PART_ExpanderIcon">
<Setter Property="RenderTransform" Value="rotate(-90deg)" />
</Style>
</Style>
<Style Selector="^[IsSeparator=True]">
<Setter Property="Template">
<ControlTemplate>
<StackPanel
Name="PART_RootPanel"
Margin="{DynamicResource NavigationMenuSeparatorMargin}"
Cursor="No">
<ContentPresenter
Name="PART_HeaderPresenter"
Margin="{DynamicResource NavigationMenuSeparatorHeaderMargin}"
HorizontalAlignment="Left"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
Foreground="{DynamicResource TextBlockQuaternaryForeground}"
IsVisible="{TemplateBinding Header,
Converter={x:Static ObjectConverters.IsNotNull}}">
<ContentPresenter.Styles>
<Style Selector="TextBlock">
<Setter Property="FontSize" Value="{DynamicResource NavigationMenuSeparatorHeaderFontSize}" />
</Style>
</ContentPresenter.Styles>
</ContentPresenter>
<Rectangle
Name="PART_SeparatorBorder"
Height="{DynamicResource NavigationMenuSeparatorBorderHeight}"
Margin="{DynamicResource NavigationMenuSeparatorBorderMargin}"
HorizontalAlignment="Stretch"
Fill="{DynamicResource SemiColorBorder}" />
</StackPanel>
</ControlTemplate>
</Setter>
<Style Selector="^:horizontal-collapsed:first-level">
<Setter Property="HorizontalAlignment" Value="Center" />
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ Rectangle#PART_SeparatorBorder">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Width" Value="12" />
</Style>
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -1,338 +0,0 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<converters:NavigationMenuItemLevelToMarginConverter x:Key="MarginConverter" Indent="8" />
<ControlTheme x:Key="{x:Type u:NavigationMenu}" TargetType="u:NavigationMenu">
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="Template">
<ControlTemplate TargetType="u:NavigationMenu">
<Border
Name="PART_RootBorder"
Width="{DynamicResource NavigationMenuExpandWidth}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Border.Transitions>
<Transitions>
<DoubleTransition Property="Width" Duration="0:0:0.1" />
</Transitions>
</Border.Transitions>
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<Grid
Name="PART_RootGrid"
HorizontalAlignment="Stretch"
Background="{TemplateBinding Background}"
RowDefinitions="Auto, *, Auto, Auto">
<StackPanel
Margin="{DynamicResource NavigationMenuHeaderMargin}"
HorizontalAlignment="Center"
Orientation="Horizontal">
<ContentPresenter
Name="PART_IconPresenter"
Margin="{DynamicResource NavigationMenuIconMargin}"
VerticalAlignment="Center"
Content="{TemplateBinding Icon}" />
<ContentPresenter
Name="PART_HeaderPresenter"
VerticalAlignment="Center"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}" />
</StackPanel>
<ItemsPresenter Grid.Row="1" ItemsPanel="{TemplateBinding ItemsPanel}" />
<ContentPresenter
Name="PART_FooterPresenter"
Grid.Row="2"
Content="{TemplateBinding Footer}"
ContentTemplate="{TemplateBinding FooterTemplate}" />
<ToggleSwitch
Name="{x:Static u:NavigationMenu.PART_CloseButton}"
Grid.Row="3"
Content="Open"
IsChecked="{TemplateBinding IsClosed,
Mode=TwoWay}"
IsVisible="{TemplateBinding ShowCollapseButton}"
Theme="{DynamicResource ButtonToggleSwitch}">
<ToggleSwitch.OnContent>
<PathIcon
Width="{DynamicResource NavigationMenuExpandIconWidth}"
Height="{DynamicResource NavigationMenuExpandIconHeight}"
Data="{DynamicResource NavigationMenuExpandIconGlyph}"
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
</ToggleSwitch.OnContent>
<ToggleSwitch.OffContent>
<PathIcon
Width="{DynamicResource NavigationMenuExpandIconWidth}"
Height="{DynamicResource NavigationMenuExpandIconHeight}"
Data="{DynamicResource NavigationMenuExpandIconGlyph}"
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
</ToggleSwitch.OffContent>
</ToggleSwitch>
</Grid>
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:closed">
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="ContentPresenter.IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ Border#PART_RootBorder">
<Setter Property="Border.Width" Value="{DynamicResource NavigationMenuClosedWidth}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
<Setter Property="Grid.HorizontalAlignment" Value="Center" />
</Style>
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:NavigationMenuItem}" TargetType="u:NavigationMenuItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<ControlTemplate TargetType="u:NavigationMenuItem">
<Border>
<StackPanel>
<Border
Name="PART_HeaderBorder"
Margin="{DynamicResource NavigationMenuItemDefaultMargin}"
Padding="{DynamicResource NavigationMenuItemDefaultPadding}"
Background="{DynamicResource NavigationMenuItemDefaultBackground}"
CornerRadius="{DynamicResource NavigationMenuItemDefaultCornerRadius}">
<Grid
Name="PART_RootStackPanel"
HorizontalAlignment="Stretch"
ColumnDefinitions="Auto, Auto, *, Auto">
<ContentPresenter
Name="PART_IconPresenter"
Grid.Column="1"
MinWidth="{DynamicResource NavigationMenuItemIconMinWidth}"
Content="{TemplateBinding Icon}"
ContentTemplate="{TemplateBinding IconTemplate}">
<ContentPresenter.Margin>
<MultiBinding Converter="{StaticResource MarginConverter}">
<Binding Path="Level" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="IsClosed" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</ContentPresenter.Margin>
</ContentPresenter>
<ContentPresenter
Name="PART_HeaderPresenter"
Grid.Column="2"
Margin="{DynamicResource NavigationMenuItemHeaderMargin}"
VerticalAlignment="Center"
Background="{TemplateBinding Background}"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}">
<ContentPresenter.Transitions>
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.15" />
</Transitions>
</ContentPresenter.Transitions>
</ContentPresenter>
<PathIcon
Name="PART_ExpandIcon"
Grid.Column="3"
Width="{DynamicResource NavigationMenuItemExpandIconWidth}"
Height="{DynamicResource NavigationMenuItemExpandIconHeight}"
Data="{DynamicResource NavigationMenuItemExpandIconGlyph}"
Foreground="{DynamicResource NavigationMenuItemExpandIconForeground}">
<PathIcon.Transitions>
<Transitions>
<TransformOperationsTransition Property="RenderTransform" Duration="0.1" />
</Transitions>
</PathIcon.Transitions>
</PathIcon>
</Grid>
</Border>
<ItemsPresenter Name="PART_ItemsPresenter" ItemsPanel="{TemplateBinding ItemsPanel}">
<ItemsPresenter.Transitions>
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.15" />
</Transitions>
</ItemsPresenter.Transitions>
</ItemsPresenter>
</StackPanel>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^ /template/ Border#PART_HeaderBorder:pointerover">
<Setter Property="Border.Background" Value="{DynamicResource NavigationMenuItemPointeroverBackground}" />
</Style>
<Style Selector="^ /template/ Border#PART_HeaderBorder:pressed">
<Setter Property="Border.Background" Value="{DynamicResource NavigationMenuItemPressedBackground}" />
</Style>
<Style Selector="^:highlighted /template/ ContentPresenter#PART_IconPresenter">
<Setter Property="u:NavigationMenuItem.Foreground" Value="{DynamicResource NavigationMenuItemHighlightForeground}" />
</Style>
<Style Selector="^:selected /template/ Border#PART_HeaderBorder">
<Setter Property="u:NavigationMenuItem.Background" Value="{DynamicResource NavigationMenuItemSelectedBackground}" />
</Style>
<Style Selector="^:empty:closed:top-level">
<Setter Property="Template">
<ControlTemplate TargetType="u:NavigationMenuItem">
<Border
Name="PART_HeaderBorder"
Margin="{DynamicResource NavigationMenuItemDefaultMargin}"
Padding="{DynamicResource NavigationMenuItemDefaultPadding}"
HorizontalAlignment="Center"
Background="{DynamicResource NavigationMenuItemDefaultBackground}"
CornerRadius="{DynamicResource NavigationMenuItemDefaultCornerRadius}"
ToolTip.ShowDelay="0"
ToolTip.Tip="{TemplateBinding Header}">
<ContentPresenter
Name="PART_IconPresenter"
Grid.Column="1"
MinWidth="{DynamicResource NavigationMenuItemIconMinWidth}"
Margin="{DynamicResource NavigationMenuItemIconMargin}"
Content="{TemplateBinding Icon}"
ContentTemplate="{TemplateBinding IconTemplate}" />
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^ /template/ Border#PART_HeaderBorder:pointerover">
<Setter Property="Border.Background" Value="{DynamicResource NavigationMenuItemPointeroverBackground}" />
</Style>
<Style Selector="^ /template/ Border#PART_HeaderBorder:pressed">
<Setter Property="Border.Background" Value="{DynamicResource NavigationMenuItemPressedBackground}" />
</Style>
</Style>
<Style Selector="^:not(:empty):closed">
<Setter Property="Template">
<ControlTemplate TargetType="u:NavigationMenuItem">
<Panel>
<Border
Name="PART_HeaderBorder"
Margin="{DynamicResource NavigationMenuItemDefaultMargin}"
Padding="{DynamicResource NavigationMenuItemDefaultPadding}"
HorizontalAlignment="Center"
Background="{DynamicResource NavigationMenuItemDefaultBackground}"
CornerRadius="{DynamicResource NavigationMenuItemDefaultCornerRadius}">
<Grid HorizontalAlignment="Stretch" ColumnDefinitions="Auto, *, Auto">
<ContentPresenter
Name="PART_IconPresenter"
Grid.Column="0"
MinWidth="{DynamicResource NavigationMenuItemIconMinWidth}"
Content="{TemplateBinding Icon}"
ContentTemplate="{TemplateBinding IconTemplate}" />
<ContentPresenter
Name="PART_HeaderPresenter"
Grid.Column="1"
Margin="{DynamicResource NavigationMenuItemHeaderMargin}"
VerticalAlignment="Center"
Background="{TemplateBinding Background}"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
IsVisible="{TemplateBinding IsTopLevelMenuItem,
Converter={x:Static BoolConverters.Not}}" />
<PathIcon
Grid.Column="2"
Width="{DynamicResource NavigationMenuItemExpandIconWidth}"
Height="{DynamicResource NavigationMenuItemExpandIconHeight}"
Margin="{DynamicResource NavigationMenuItemExpandIconMargin}"
Data="{DynamicResource NavigationMenuItemExpandIconGlyph}"
Foreground="{DynamicResource NavigationMenuItemExpandIconForeground}"
IsVisible="{TemplateBinding IsTopLevelMenuItem,
Converter={x:Static BoolConverters.Not}}"
RenderTransform="rotate(-90deg)" />
</Grid>
</Border>
<Popup
Name="{x:Static u:NavigationMenuItem.PART_Popup}"
IsLightDismissEnabled="True"
IsOpen="{TemplateBinding IsPopupOpen,
Mode=TwoWay}"
Placement="RightEdgeAlignedTop"
PlacementTarget="PART_HeaderBorder"
WindowManagerAddShadowHint="False">
<Border
MinWidth="{DynamicResource MenuFlyoutMinWidth}"
MinHeight="{DynamicResource MenuFlyoutMinHeight}"
MaxWidth="{DynamicResource MenuFlyoutMaxWidth}"
MaxHeight="{DynamicResource MenuFlyoutMaxHeight}"
Margin="{DynamicResource NavigationMenuItemFlyoutMargin}"
Padding="{DynamicResource MenuFlyoutPadding}"
HorizontalAlignment="Stretch"
Background="{DynamicResource MenuFlyoutBackground}"
BorderBrush="{DynamicResource MenuFlyoutBorderBrush}"
BorderThickness="{DynamicResource MenuFlyoutBorderThickness}"
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
<ScrollViewer Theme="{DynamicResource MenuScrollViewer}">
<ItemsPresenter
Name="PART_ItemsPresenter"
Grid.IsSharedSizeScope="True"
ItemsPanel="{TemplateBinding ItemsPanel}" />
</ScrollViewer>
</Border>
</Popup>
</Panel>
</ControlTemplate>
</Setter>
<Style Selector="^ /template/ Border#PART_HeaderBorder:pointerover">
<Setter Property="Border.Background" Value="{DynamicResource NavigationMenuItemPointeroverBackground}" />
</Style>
<Style Selector="^ /template/ Border#PART_HeaderBorder:pressed">
<Setter Property="Border.Background" Value="{DynamicResource NavigationMenuItemPressedBackground}" />
</Style>
</Style>
<Style Selector="^:not(:closed):collapsed /template/ ItemsPresenter#PART_ItemsPresenter">
<Setter Property="ItemsPresenter.Height" Value="{DynamicResource NavigationMenuItemCollapsedHeight}" />
<Setter Property="ItemsPresenter.Opacity" Value="{DynamicResource NavigationMenuItemCollapsedOpacity}" />
</Style>
<Style Selector="^:not(:empty):not(:collapsed) /template/ PathIcon#PART_ExpandIcon">
<Setter Property="PathIcon.RenderTransform" Value="rotate(-180deg)" />
</Style>
<Style Selector="^:empty /template/ PathIcon#PART_ExpandIcon">
<Setter Property="PathIcon.IsVisible" Value="False" />
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:NavigationMenuSeparator}" TargetType="u:NavigationMenuSeparator">
<Setter Property="Template">
<ControlTemplate TargetType="u:NavigationMenuSeparator">
<StackPanel Name="PART_RootPanel" Margin="{DynamicResource NavigationMenuSeparatorMargin}">
<ContentPresenter
Name="PART_HeaderPresenter"
Margin="{DynamicResource NavigationMenuSeparatorHeaderMargin}"
HorizontalAlignment="Left"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
Foreground="{DynamicResource TextBlockQuaternaryForeground}"
IsVisible="{TemplateBinding Header,
Converter={x:Static ObjectConverters.IsNotNull}}">
<ContentPresenter.Styles>
<Style Selector="TextBlock">
<Setter Property="FontSize" Value="{DynamicResource NavigationMenuSeparatorHeaderFontSize}" />
</Style>
</ContentPresenter.Styles>
</ContentPresenter>
<Rectangle
Height="{DynamicResource NavigationMenuSeparatorBorderHeight}"
Margin="{DynamicResource NavigationMenuSeparatorBorderMargin}"
HorizontalAlignment="Stretch"
Fill="{DynamicResource SemiColorBorder}" />
</StackPanel>
</ControlTemplate>
</Setter>
<Style Selector="^:closed /template/ StackPanel#PART_RootPanel">
<Setter Property="StackPanel.HorizontalAlignment" Value="Center" />
<Setter Property="StackPanel.Width" Value="{DynamicResource NavigationMenuSeparatorClosedWidth}" />
</Style>
<Style Selector="^:closed /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="ContentPresenter.IsVisible" Value="False" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,38 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Ursa.Converters;assembly=Ursa"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:NumberDisplayerBase}" TargetType="u:NumberDisplayerBase">
<Setter Property="Duration" Value="0:0:0.2" />
<Setter Property="Template">
<ControlTemplate TargetType="u:NumberDisplayerBase">
<TextBlock
FontSize="{TemplateBinding FontSize}"
Foreground="{TemplateBinding Foreground}"
FontFamily="{TemplateBinding FontFamily}"
Background="{TemplateBinding Background}"
FontWeight="{TemplateBinding FontWeight}"
FontStyle="{TemplateBinding FontStyle}"
FontStretch="{TemplateBinding FontStretch}"
Text="{TemplateBinding InternalText, Mode=OneWay}" />
</ControlTemplate>
</Setter>
<Style Selector="^[IsSelectable=True]">
<Setter Property="Template">
<ControlTemplate TargetType="u:NumberDisplayerBase">
<SelectableTextBlock
FontSize="{TemplateBinding FontSize}"
Foreground="{TemplateBinding Foreground}"
FontFamily="{TemplateBinding FontFamily}"
Background="{TemplateBinding Background}"
FontWeight="{TemplateBinding FontWeight}"
FontStyle="{TemplateBinding FontStyle}"
FontStretch="{TemplateBinding FontStretch}"
Text="{TemplateBinding InternalText, Mode=OneWay}" />
</ControlTemplate>
</Setter>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,87 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="InputClearButton" TargetType="Button">
<Setter Property="Button.Foreground" Value="{DynamicResource TextBoxButtonDefaultForeground}" />
<Setter Property="Button.Cursor" Value="Hand" />
<Setter Property="Button.Template">
<ControlTemplate TargetType="Button">
<!-- Background must be transparent or hit test will fail -->
<ContentControl Background="Transparent">
<PathIcon
Width="16"
Height="16"
Data="{DynamicResource TextBoxClearButtonData}"
Foreground="{TemplateBinding Foreground}" />
</ContentControl>
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover">
<Setter Property="Foreground" Value="{DynamicResource TextBoxButtonPointeroverForeground}" />
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:NumericUpDown}" TargetType="{x:Type u:NumericUpDown}">
<Setter Property="NumericUpDown.VerticalContentAlignment" Value="Center" />
<Setter Property="NumericUpDown.CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
<Setter Property="Template">
<ControlTemplate TargetType="u:NumericUpDown">
<DataValidationErrors>
<ButtonSpinner
Name="PART_Spinner"
MinWidth="0"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
AllowSpin="{TemplateBinding AllowSpin}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Panel>
<TextBox
Name="PART_TextBox"
Height="{TemplateBinding Height}"
MinHeight="{DynamicResource NumericUpDownWrapperDefaultHeight}"
AcceptsReturn="False"
CornerRadius="{TemplateBinding CornerRadius}"
DataValidationErrors.Errors="{ReflectionBinding $parent[NumericUpDown].(DataValidationErrors.Errors)}"
FontSize="{TemplateBinding FontSize}"
Foreground="{TemplateBinding Foreground}"
IsReadOnly="{TemplateBinding IsReadOnly}"
TextWrapping="NoWrap"
InnerLeftContent="{TemplateBinding InnerLeftContent}"
Theme="{DynamicResource NonErrorTextBox}"
Watermark="{TemplateBinding Watermark}" />
<Panel
Name="PART_DragPanel"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="Transparent"
Cursor="SizeAll"
IsVisible="{TemplateBinding AllowDrag}" />
<Button
Name="PART_ClearButton"
Command="{Binding $parent[u:NumericUpDown].Clear}"
HorizontalAlignment="Right"
Margin="0 0 8 0"
IsVisible="False"
Focusable="False"
Theme="{StaticResource InputClearButton}" />
</Panel>
</ButtonSpinner>
</DataValidationErrors>
</ControlTemplate>
</Setter>
<Style Selector="^.clearButton, ^.ClearButton">
<Style Selector="^[IsReadOnly=False]:focus /template/ Button#PART_ClearButton">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^[IsReadOnly=False]:pointerover /template/ Button#PART_ClearButton">
<Setter Property="IsVisible" Value="True" />
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,228 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:RangeSlider}" TargetType="u:RangeSlider">
<Setter Property="Background" Value="{DynamicResource SliderTrackBackground}" />
<Setter Property="Foreground" Value="{DynamicResource SliderTrackForeground}" />
<Setter Property="TrackWidth" Value="4" />
<Style Selector="^:horizontal">
<Setter Property="Template">
<ControlTemplate TargetType="u:RangeSlider">
<DataValidationErrors>
<Grid
x:Name="SliderContainer"
Margin="{TemplateBinding Padding}"
Background="Transparent"
RowDefinitions="Auto,Auto,Auto">
<Grid.Styles>
<Style Selector="TickBar">
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.LowerThumb.Bounds}" />
</Style>
</Grid.Styles>
<TickBar
Name="TopTickBar"
Grid.Row="0"
Height="{DynamicResource SliderTickHorizontalHeight}"
Margin="0,0,0,4"
VerticalAlignment="Bottom"
Fill="{DynamicResource SliderTickForeground}"
IsVisible="False"
Maximum="{TemplateBinding u:RangeSlider.Maximum}"
Minimum="{TemplateBinding u:RangeSlider.Minimum}"
Orientation="{TemplateBinding u:RangeSlider.Orientation}"
Placement="Top"
TickFrequency="{TemplateBinding u:RangeSlider.TickFrequency}"
Ticks="{TemplateBinding Ticks}" />
<TickBar
Name="BottomTickBar"
Grid.Row="2"
Height="{DynamicResource SliderTickHorizontalHeight}"
Margin="0,4,0,0"
VerticalAlignment="Top"
Fill="{DynamicResource SliderTickForeground}"
IsVisible="False"
Maximum="{TemplateBinding u:RangeSlider.Maximum}"
Minimum="{TemplateBinding u:RangeSlider.Minimum}"
Orientation="{TemplateBinding u:RangeSlider.Orientation}"
Placement="Bottom"
TickFrequency="{TemplateBinding u:RangeSlider.TickFrequency}"
Ticks="{TemplateBinding Ticks}" />
<u:RangeTrack
Name="{x:Static u:RangeSlider.PART_Track}"
Grid.Row="1"
Cursor="Hand"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Orientation="{Binding Orientation, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
LowerValue="{Binding LowerValue, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
Maximum="{Binding Maximum, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
Minimum="{Binding Minimum, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
UpperValue="{Binding UpperValue, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}">
<u:RangeTrack.LowerSection>
<Border
Name="PART_LowerSection"
Height="{TemplateBinding TrackWidth}"
Background="{TemplateBinding Background}"
CornerRadius="100" />
</u:RangeTrack.LowerSection>
<u:RangeTrack.LowerThumb>
<Thumb
Width="16"
Height="16"
Theme="{DynamicResource SliderThumbTheme}" />
</u:RangeTrack.LowerThumb>
<u:RangeTrack.InnerSection>
<Border
Name="PART_InnerSection"
Height="{TemplateBinding TrackWidth}"
Background="{TemplateBinding Foreground}"
CornerRadius="100" />
</u:RangeTrack.InnerSection>
<u:RangeTrack.UpperThumb>
<Thumb
Width="16"
Height="16"
Theme="{DynamicResource SliderThumbTheme}" />
</u:RangeTrack.UpperThumb>
<u:RangeTrack.UpperSection>
<Border
Name="PART_UpperSection"
Height="{TemplateBinding TrackWidth}"
Background="{TemplateBinding Background}"
CornerRadius="100" />
</u:RangeTrack.UpperSection>
</u:RangeTrack>
</Grid>
</DataValidationErrors>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="^:vertical">
<Setter Property="Template">
<ControlTemplate TargetType="u:RangeSlider">
<DataValidationErrors>
<Grid
x:Name="SliderContainer"
Margin="{TemplateBinding Padding}"
Background="{DynamicResource SliderContainerBackground}"
ColumnDefinitions="Auto,Auto,Auto">
<Grid.Styles>
<Style Selector="TickBar">
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.LowerThumb.Bounds}" />
</Style>
</Grid.Styles>
<TickBar
Name="LeftTickBar"
Grid.Column="0"
Width="{DynamicResource SliderTickVerticalWidth}"
Margin="0,0,4,0"
HorizontalAlignment="Right"
Fill="{DynamicResource SliderTickForeground}"
IsVisible="False"
Maximum="{TemplateBinding u:RangeSlider.Maximum}"
Minimum="{TemplateBinding u:RangeSlider.Minimum}"
Orientation="{TemplateBinding u:RangeSlider.Orientation}"
Placement="Left"
TickFrequency="{TemplateBinding u:RangeSlider.TickFrequency}"
Ticks="{TemplateBinding Ticks}" />
<TickBar
Name="RightTickBar"
Grid.Column="2"
Width="{DynamicResource SliderTickVerticalWidth}"
Margin="4,0,0,0"
HorizontalAlignment="Left"
Fill="{DynamicResource SliderTickForeground}"
IsVisible="False"
Maximum="{TemplateBinding u:RangeSlider.Maximum}"
Minimum="{TemplateBinding u:RangeSlider.Minimum}"
Orientation="{TemplateBinding u:RangeSlider.Orientation}"
Placement="Right"
TickFrequency="{TemplateBinding u:RangeSlider.TickFrequency}"
Ticks="{TemplateBinding Ticks}" />
<u:RangeTrack
Name="{x:Static u:RangeSlider.PART_Track}"
Cursor="Hand"
Grid.Column="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Orientation="{Binding Orientation, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
LowerValue="{Binding LowerValue, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
Maximum="{Binding Maximum, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
Minimum="{Binding Minimum, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
UpperValue="{Binding UpperValue, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}">
<u:RangeTrack.LowerSection>
<Border
Name="PART_LowerSection"
Width="{TemplateBinding TrackWidth}"
Background="{TemplateBinding Background}"
CornerRadius="100" />
</u:RangeTrack.LowerSection>
<u:RangeTrack.LowerThumb>
<Thumb
Width="16"
Height="16"
Theme="{DynamicResource SliderThumbTheme}" />
</u:RangeTrack.LowerThumb>
<u:RangeTrack.InnerSection>
<Border
Name="PART_InnerSection"
Width="{TemplateBinding TrackWidth}"
Background="{TemplateBinding Foreground}"
CornerRadius="100" />
</u:RangeTrack.InnerSection>
<u:RangeTrack.UpperThumb>
<Thumb
Width="16"
Height="16"
Theme="{DynamicResource SliderThumbTheme}" />
</u:RangeTrack.UpperThumb>
<u:RangeTrack.UpperSection>
<Border
Name="PART_UpperSection"
Width="{TemplateBinding TrackWidth}"
Background="{TemplateBinding Background}"
CornerRadius="100" />
</u:RangeTrack.UpperSection>
</u:RangeTrack>
</Grid>
</DataValidationErrors>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="^[TickPlacement=TopLeft] /template/ TickBar#LeftTickBar, ^[TickPlacement=Outside] /template/ TickBar#LeftTickBar">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^[TickPlacement=TopLeft] /template/ TickBar#TopTickBar, ^[TickPlacement=Outside] /template/ TickBar#TopTickBar">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^[TickPlacement=BottomRight] /template/ TickBar#BottomTickBar, ^[TickPlacement=Outside] /template/ TickBar#BottomTickBar">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^[TickPlacement=BottomRight] /template/ TickBar#RightTickBar, ^[TickPlacement=Outside] /template/ TickBar#RightTickBar">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^:error /template/ Thumb#thumb">
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style>
<Style Selector="^:disabled">
<Style Selector="^ /template/ Border#PART_InnerSection">
<Setter Property="Background" Value="{DynamicResource SliderTrackDisabledForeground}" />
</Style>
<Style Selector="^ /template/ Border#PART_UpperSection, ^ /template/ Border#PART_LowerSection">
<Setter Property="Background" Value="{DynamicResource SliderTrackDisabledBackground}" />
</Style>
<Style Selector="^ /template/ Thumb">
<Setter Property="BorderBrush" Value="{DynamicResource SliderThumbDisabledBorderBrush}" />
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,61 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<ControlTheme x:Key="{x:Type u:SelectionList}" TargetType="u:SelectionList">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Indicator">
<Template>
<Border
Margin="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{DynamicResource SemiBlue1}"
Theme="{DynamicResource CardBorder}" />
</Template>
</Setter>
<Setter Property="ListBox.Template">
<ControlTemplate TargetType="u:SelectionList">
<Border
Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
ClipToBounds="{TemplateBinding ClipToBounds}"
CornerRadius="{TemplateBinding CornerRadius}">
<Panel>
<ContentPresenter Name="{x:Static u:SelectionList.PART_Indicator}" Content="{TemplateBinding Indicator}" />
<ItemsPresenter
Name="PART_ItemsPresenter"
Margin="{TemplateBinding Padding}"
ItemsPanel="{TemplateBinding ItemsPanel}" />
</Panel>
</Border>
</ControlTemplate>
</Setter>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:SelectionListItem}" TargetType="u:SelectionListItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="8" />
<Setter Property="Template">
<ControlTemplate TargetType="u:SelectionListItem">
<ContentPresenter
Name="PART_ContentPresenter"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
Content="{TemplateBinding Content}"
FontWeight="{TemplateBinding FontWeight}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Foreground="{TemplateBinding Foreground}" />
</ControlTemplate>
</Setter>
<Style Selector="^:selected">
<Setter Property="FontWeight" Value="Bold" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,30 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme TargetType="u:ThemeToggleButton" x:Key="{x:Type u:ThemeToggleButton}">
<Setter Property="Template">
<ControlTemplate TargetType="u:ThemeToggleButton">
<ToggleSwitch
Padding="4"
Name="{x:Static u:ThemeToggleButton.PART_ThemeToggleButton}"
Theme="{DynamicResource ButtonToggleSwitch}">
<ToggleSwitch.OnContent>
<PathIcon
Width="16"
Height="16"
Data="{DynamicResource ThemeSelectorButtonLightGlyph}"
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
</ToggleSwitch.OnContent>
<ToggleSwitch.OffContent>
<PathIcon
Width="16"
Height="16"
Data="{DynamicResource ThemeSelectorButtonDarkGlyph}"
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
</ToggleSwitch.OffContent>
</ToggleSwitch>
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>

View File

@@ -6,9 +6,9 @@
<Design.PreviewWith>
<StackPanel Width="100" Spacing="20">
<u:Timeline>
<u:TimelineItem Content="Hello" Time="2022-01-01" />
<u:TimelineItem Content="World" Time="2022-02-01" />
<u:TimelineItem Content="!" Time="2022-03-01" />
<u:TimelineItem Content="Hello" />
<u:TimelineItem Content="World" />
<u:TimelineItem Content="!" />
<u:TimelineItem />
</u:Timeline>
</StackPanel>
@@ -32,98 +32,166 @@
WarningBrush="{DynamicResource WarningTimelineIconForeground}" />
<ControlTheme x:Key="{x:Type u:TimelineItem}" TargetType="u:TimelineItem">
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="u:TimelineItem.Template">
<ControlTemplate TargetType="u:TimelineItem">
<Grid ColumnDefinitions="Auto, *" RowDefinitions="*, Auto, *">
<Grid
Name="PART_RootGrid"
ColumnDefinitions="Auto, Auto, Auto"
RowDefinitions="Auto, Auto, Auto">
<!-- Icon and Axis -->
<Grid
Name="PART_IconAxisRoot"
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="0"
RowDefinitions="Auto, Auto, *">
<Rectangle
Grid.Row="0"
Grid.Column="0"
Width="1"
Height="8"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Classes="start"
Fill="{DynamicResource TimelineLineBrush}" />
<Panel Grid.Row="1">
<Ellipse
Name="PART_Indicator"
Width="8"
Height="8"
Margin="2"
Grid.RowSpan="3"
Grid.Column="1"
RowDefinitions="Auto, *">
<Panel Grid.Row="0" Name="{x:Static u:TimelineItem.PART_Icon}">
<ContentPresenter
Margin="8"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Fill="{DynamicResource DefaultTimelineIconForeground}" />
VerticalAlignment="Center"
Content="{TemplateBinding Icon}"
ContentTemplate="{TemplateBinding IconTemplate}" />
<Ellipse
Name="PART_DefaultIcon"
Width="12"
Height="12"
Margin="8"
IsVisible="False"
Fill="Gray" />
</Panel>
<Rectangle
Grid.Row="2"
Grid.Column="0"
Width="1"
Grid.Row="1"
Width="2"
HorizontalAlignment="Center"
VerticalAlignment="Stretch"
Classes="end"
Fill="{DynamicResource TimelineLineBrush}" />
</Grid>
<Rectangle
Grid.Row="2"
Grid.Column="0"
Width="1"
HorizontalAlignment="Center"
VerticalAlignment="Stretch"
Classes="end"
Fill="{DynamicResource TimelineLineBrush}" />
<ContentPresenter
Name="{x:Static u:TimelineItem.PART_Header}"
Grid.Row="0"
Grid.Column="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Foreground="Gray">
<ContentPresenter.Content>
Grid.Column="2"
Margin="8,4"
VerticalAlignment="Top"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
FontSize="14"
Foreground="{DynamicResource SemiGrey9}" />
<ContentPresenter
Name="{x:Static u:TimelineItem.PART_Content}"
Grid.Row="1"
Grid.Column="2"
Margin="8,2"
VerticalAlignment="Top"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
TextElement.FontSize="12"
TextElement.Foreground="Gray" />
<TextBlock
Name="{x:Static u:TimelineItem.PART_Time}"
Grid.Row="0"
Grid.Column="0"
Margin="8,2"
VerticalAlignment="Top"
FontSize="12"
Foreground="Gray"
TextWrapping="Wrap">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource FormatConverter}">
<Binding Path="Time" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="TimeFormat" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</ContentPresenter.Content>
</ContentPresenter>
<ContentPresenter
Name="content"
Grid.Row="1"
Grid.Column="1"
Margin="0,0,0,16"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
</TextBlock.Text>
</TextBlock>
</Grid>
</ControlTemplate>
</Setter>
<Style Selector="^:first /template/ Rectangle.start">
<Setter Property="Rectangle.Fill" Value="Transparent" />
</Style>
<Style Selector="^:last /template/ Rectangle.end">
<Setter Property="Rectangle.Fill" Value="Transparent" />
</Style>
<Style Selector="^:none /template/ Ellipse#PART_Indicator">
<Setter Property="Ellipse.Fill" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=u:TimelineItem}, Path=IconForeground}" />
<Style Selector="^:empty-icon /template/ Ellipse#PART_DefaultIcon">
<Setter Property="IsVisible" Value="True"/>
</Style>
<Style Selector="^:not(:none):default /template/ Ellipse#PART_Indicator">
<Setter Property="Ellipse.Fill" Value="{DynamicResource DefaultTimelineIconForeground}" />
<Style Selector="^:empty-icon[Type=Default] /template/ Ellipse#PART_DefaultIcon">
<Setter Property="Fill" Value="{DynamicResource SemiGrey6}"/>
</Style>
<Style Selector="^:not(:none):ongoing /template/ Ellipse#PART_Indicator">
<Setter Property="Ellipse.Fill" Value="{DynamicResource OngoingTimelineIconForeground}" />
<Style Selector="^:empty-icon[Type=Error] /template/ Ellipse#PART_DefaultIcon">
<Setter Property="Fill" Value="{DynamicResource SemiRed6}"/>
</Style>
<Style Selector="^:not(:none):success /template/ Ellipse#PART_Indicator">
<Setter Property="Ellipse.Fill" Value="{DynamicResource SuccessTimelineIconForeground}" />
<Style Selector="^:empty-icon[Type=Ongoing] /template/ Ellipse#PART_DefaultIcon">
<Setter Property="Fill" Value="{DynamicResource SemiBlue6}"/>
</Style>
<Style Selector="^:not(:none):warning /template/ Ellipse#PART_Indicator">
<Setter Property="Ellipse.Fill" Value="{DynamicResource WarningTimelineIconForeground}" />
<Style Selector="^:empty-icon[Type=Success] /template/ Ellipse#PART_DefaultIcon">
<Setter Property="Fill" Value="{DynamicResource SemiGreen6}"/>
</Style>
<Style Selector="^:not(:none):error /template/ Ellipse#PART_Indicator">
<Setter Property="Ellipse.Fill" Value="{DynamicResource ErrorTimelineIconForeground}" />
<Style Selector="^:empty-icon[Type=Warning] /template/ Ellipse#PART_DefaultIcon">
<Setter Property="Fill" Value="{DynamicResource SemiOrange6}"/>
</Style>
<Style Selector="^:all-left">
<Style Selector="^ /template/ ContentPresenter#PART_Header">
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Grid.Column" Value="2" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_Content">
<Setter Property="Grid.Row" Value="1" />
<Setter Property="Grid.Column" Value="2" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
<Style Selector="^ /template/ TextBlock#PART_Time">
<Setter Property="Grid.Row" Value="2" />
<Setter Property="Grid.Column" Value="2" />
<Setter Property="TextAlignment" Value="Left" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Margin" Value="8 2 8 12"></Setter>
</Style>
</Style>
<Style Selector="^:all-right">
<Style Selector="^ /template/ ContentPresenter#PART_Header">
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Grid.Column" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_Content">
<Setter Property="Grid.Row" Value="1" />
<Setter Property="Grid.Column" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
<Style Selector="^ /template/ TextBlock#PART_Time">
<Setter Property="Grid.Row" Value="2" />
<Setter Property="Grid.Column" Value="0" />
<Setter Property="TextAlignment" Value="Right" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="Margin" Value="8 2 8 12"></Setter>
</Style>
</Style>
<Style Selector="^:separate">
<Style Selector="^ /template/ ContentPresenter#PART_Header">
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Grid.Column" Value="2" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_Content">
<Setter Property="Grid.Row" Value="1" />
<Setter Property="Grid.Column" Value="2" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Margin" Value="8 2 8 12"></Setter>
</Style>
<Style Selector="^ /template/ TextBlock#PART_Time">
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Grid.Column" Value="0" />
<Setter Property="TextAlignment" Value="Right" />
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,137 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="ToolBarExpandToggleButton" TargetType="ToggleButton">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<ControlTemplate>
<ContentPresenter
x:Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}"
RecognizesAccessKey="True"
TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.FontWeight="{TemplateBinding FontWeight}"
UseLayoutRounding="False" />
</ControlTemplate>
</Setter>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:ToolBar}" TargetType="u:ToolBar">
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="ItemsPanel">
<ItemsPanelTemplate>
<u:ToolBarPanel />
</ItemsPanelTemplate>
</Setter>
<Setter Property="Template">
<ControlTemplate TargetType="u:ToolBar">
<Border
Padding="2"
Margin="0"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
CornerRadius="4"
Theme="{DynamicResource CardBorder}">
<DockPanel LastChildFill="True">
<ContentPresenter
Name="PART_Header"
Margin="8,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
DockPanel.Dock="Left"
Foreground="{DynamicResource SemiColorText2}"
IsVisible="{TemplateBinding Header,
Converter={x:Static ObjectConverters.IsNotNull}}" />
<Panel Name="PART_PopupButtonPanel" DockPanel.Dock="Right">
<ToggleButton
Name="button"
Padding="8,0"
VerticalAlignment="Stretch"
IsVisible="False"
Theme="{DynamicResource ToolBarExpandToggleButton}">
<PathIcon
Name="PART_Icon"
Height="12"
Foreground="{DynamicResource SemiColorText2}"
Data="{DynamicResource ToolBarHorizontalMoreGlyph}" />
</ToggleButton>
<Popup
IsLightDismissEnabled="True"
IsOpen="{Binding #button.IsChecked, Mode=TwoWay}"
Placement="{TemplateBinding PopupPlacement}"
PlacementTarget="{Binding #button}">
<Border Padding="2" Theme="{DynamicResource CardBorder}">
<StackPanel Name="{x:Static u:ToolBar.PART_OverflowPanel}" />
</Border>
</Popup>
</Panel>
<ItemsPresenter
HorizontalAlignment="Left"
VerticalAlignment="Center"
ItemsPanel="{TemplateBinding ItemsPanel}" />
</DockPanel>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^[Orientation=Horizontal]">
<Setter Property="PopupPlacement" Value="BottomEdgeAlignedLeft" />
</Style>
<Style Selector="^[Orientation=Vertical]">
<Setter Property="PopupPlacement" Value="RightEdgeAlignedTop" />
<Style Selector="^ /template/ ContentPresenter#PART_Header">
<Setter Property="DockPanel.Dock" Value="Top" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Margin" Value="0 8" />
</Style>
<Style Selector="^ /template/ Panel#PART_PopupButtonPanel">
<Setter Property="DockPanel.Dock" Value="Bottom" />
</Style>
<Style Selector="^ /template/ ToggleButton#button">
<Setter Property="Padding" Value="0 8" />
</Style>
<Style Selector="^ /template/ PathIcon#PART_Icon">
<Setter Property="Data" Value="{DynamicResource ToolBarVerticalMoreGlyph}" />
<Setter Property="Width" Value="12" />
<Setter Property="Height" Value="{x:Static x:Double.NaN}" />
</Style>
</Style>
<Style Selector="^:overflow /template/ ToggleButton#button">
<Setter Property="IsVisible" Value="True" />
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:ToolBarSeparator}" TargetType="u:ToolBarSeparator">
<Setter Property="Template">
<ControlTemplate>
<Rectangle
Name="PART_Rect"
Margin="4"
Fill="{DynamicResource SemiColorBorder}" />
</ControlTemplate>
</Setter>
<Style Selector="^ /template/ Rectangle#PART_Rect">
<Setter Property="Width" Value="1" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
<Style Selector="^:vertical /template/ Rectangle#PART_Rect">
<Setter Property="Height" Value="1" />
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,38 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:TwoTonePathIcon}" TargetType="u:TwoTonePathIcon">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Height" Value="{DynamicResource IconElementThemeHeight}" />
<Setter Property="Width" Value="{DynamicResource IconElementThemeWidth}" />
<Setter Property="StrokeThickness" Value="0.4" />
<Setter Property="Foreground" Value="{DynamicResource SemiBlue2}" />
<Setter Property="StrokeBrush" Value="{DynamicResource SemiBlue6}" />
<Setter Property="ActiveForeground" Value="{DynamicResource SemiBlue6}" />
<Setter Property="ActiveStrokeBrush" Value="{DynamicResource SemiBlue6}" />
<Setter Property="Template">
<ControlTemplate TargetType="u:TwoTonePathIcon">
<Border Background="{TemplateBinding Background}">
<Panel>
<Viewbox Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
<Path
Name="PART_Fill"
Data="{TemplateBinding Data}"
StrokeThickness="{TemplateBinding StrokeThickness}"
StrokeJoin="Round"
Fill="{TemplateBinding Foreground}"
Stroke="{TemplateBinding StrokeBrush}"
Stretch="Uniform" />
</Viewbox>
</Panel>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:active /template/ Path#PART_Fill">
<Setter Property="Fill" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ActiveForeground}" />
<Setter Property="Stroke" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ActiveStrokeBrush}" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -4,15 +4,32 @@
<ResourceInclude Source="Badge.axaml" />
<ResourceInclude Source="Banner.axaml" />
<ResourceInclude Source="ButtonGroup.axaml" />
<ResourceInclude Source="ControlClassesInput.axaml" />
<ResourceInclude Source="Dialog.axaml" />
<ResourceInclude Source="DialogShared.axaml" />
<ResourceInclude Source="DisableContainer.axaml" />
<ResourceInclude Source="Divider.axaml" />
<ResourceInclude Source="Drawer.axaml" />
<ResourceInclude Source="DualBadge.axaml" />
<ResourceInclude Source="EnumSelector.axaml" />
<ResourceInclude Source="Form.axaml" />
<ResourceInclude Source="IconButton.axaml" />
<ResourceInclude Source="ImageViewer.axaml" />
<ResourceInclude Source="IPv4Box.axaml" />
<ResourceInclude Source="KeyGestureInput.axaml" />
<ResourceInclude Source="Loading.axaml" />
<ResourceInclude Source="Navigation.axaml" />
<ResourceInclude Source="MessageBox.axaml" />
<ResourceInclude Source="NavMenu.axaml" />
<ResourceInclude Source="NumericUpDown.axaml" />
<ResourceInclude Source="NumberDisplayer.axaml" />
<ResourceInclude Source="Pagination.axaml" />
<ResourceInclude Source="RangeSlider.axaml" />
<ResourceInclude Source="SelectionList.axaml" />
<ResourceInclude Source="TagInput.axaml" />
<ResourceInclude Source="ThemeSelector.axaml" />
<ResourceInclude Source="Timeline.axaml" />
<ResourceInclude Source="Skeleton.axaml" />
<ResourceInclude Source="TwoTonePathIcon.axaml" />
<ResourceInclude Source="ToolBar.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>