Merge pull request #775 from irihitech/clean

clean up controls XAML files
This commit is contained in:
Dong Bin
2025-09-19 16:45:50 +08:00
committed by GitHub
73 changed files with 237 additions and 615 deletions

View File

@@ -5,16 +5,16 @@
xmlns:semi="https://irihi.tech/semi" xmlns:semi="https://irihi.tech/semi"
xmlns:u-semi="https://irihi.tech/ursa/themes/semi" xmlns:u-semi="https://irihi.tech/ursa/themes/semi"
xmlns:u="https://irihi.tech/ursa" xmlns:u="https://irihi.tech/ursa"
xmlns:helpers="clr-namespace:Irihi.Avalonia.Shared.Helpers;assembly=Irihi.Avalonia.Shared"> xmlns:iri="https://irihi.tech/shared">
<Application.Styles> <Application.Styles>
<semi:SemiTheme Locale="zh-CN" /> <semi:SemiTheme Locale="zh-CN" />
<semi:SemiPopupAnimations/> <semi:SemiPopupAnimations />
<u-semi:SemiTheme Locale="zh-CN" /> <u-semi:SemiTheme Locale="zh-CN" />
<!--This style is created to demonstrate Dialog StyleClass feature. This style is applied to Dialog Window--> <!--This style is created to demonstrate Dialog StyleClass feature. This style is applied to Dialog Window-->
<Style Selector="u|DefaultDialogWindow.Custom"> <Style Selector="u|DefaultDialogWindow.Custom">
<Style Selector="^ /template/ Button#PART_OKButton"> <Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="Content" Value="CUSTOM"/> <Setter Property="Content" Value="CUSTOM" />
<Setter Property="helpers:ClassHelper.Classes" Value="Warning"></Setter> <Setter Property="iri:ClassHelper.Classes" Value="Warning" />
</Style> </Style>
</Style> </Style>
</Application.Styles> </Application.Styles>

View File

@@ -3,11 +3,11 @@
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:helpers="clr-namespace:Irihi.Avalonia.Shared.Helpers;assembly=Irihi.Avalonia.Shared"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:u="https://irihi.tech/ursa" xmlns:u="https://irihi.tech/ursa"
xmlns:viewModels="clr-namespace:Ursa.Demo.ViewModels" xmlns:viewModels="clr-namespace:Ursa.Demo.ViewModels"
xmlns:views="clr-namespace:Ursa.Demo.Views" xmlns:views="clr-namespace:Ursa.Demo.Views"
xmlns:iri="https://irihi.tech/shared"
Title="Ursa Demo" Title="Ursa Demo"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
@@ -26,7 +26,7 @@
<Style Selector="u|DefaultDialogControl.Custom"> <Style Selector="u|DefaultDialogControl.Custom">
<Style Selector="^ /template/ Button#PART_OKButton"> <Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="Content" Value="CUSTOM" /> <Setter Property="Content" Value="CUSTOM" />
<Setter Property="helpers:ClassHelper.Classes" Value="Warning" /> <Setter Property="iri:ClassHelper.Classes" Value="Warning" />
</Style> </Style>
</Style> </Style>
</u:UrsaWindow.Styles> </u:UrsaWindow.Styles>

View File

@@ -1,10 +1,9 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters" xmlns:u="https://irihi.tech/ursa"
xmlns:iri="https://irihi.tech/shared" xmlns:iri="https://irihi.tech/shared"
xmlns:u="https://irihi.tech/ursa"> xmlns:converters="using:Ursa.Themes.Semi.Converters">
<converters:TreeLevelToPaddingConverter x:Key="LevelToPaddingConverter" />
<ControlTheme x:Key="{x:Type u:Anchor}" TargetType="{x:Type u:Anchor}"> <ControlTheme x:Key="{x:Type u:Anchor}" TargetType="{x:Type u:Anchor}">
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="VerticalAlignment" Value="Top" /> <Setter Property="VerticalAlignment" Value="Top" />
@@ -51,7 +50,7 @@
Content="{TemplateBinding Header}" Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"> ContentTemplate="{TemplateBinding HeaderTemplate}">
<ContentPresenter.Padding> <ContentPresenter.Padding>
<MultiBinding Converter="{StaticResource LevelToPaddingConverter}"> <MultiBinding Converter="{converters:TreeLevelToPaddingConverter}">
<Binding Path="Level" RelativeSource="{RelativeSource AncestorType={x:Type u:AnchorItem}}" /> <Binding Path="Level" RelativeSource="{RelativeSource AncestorType={x:Type u:AnchorItem}}" />
<DynamicResource ResourceKey="AnchorIndent" /> <DynamicResource ResourceKey="AnchorIndent" />
</MultiBinding> </MultiBinding>
@@ -88,4 +87,4 @@
</Style> </Style>
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,8 +1,7 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa" xmlns:u="https://irihi.tech/ursa">
xmlns:iri="https://irihi.tech/shared">
<ControlTheme x:Key="{x:Type u:AutoCompleteBox}" TargetType="u:AutoCompleteBox"> <ControlTheme x:Key="{x:Type u:AutoCompleteBox}" TargetType="u:AutoCompleteBox">
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxDefaultHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxDefaultHeight}" />
@@ -61,4 +60,4 @@
</Style> </Style>
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,8 +1,8 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Ursa.Converters;assembly=Ursa" xmlns:u="https://irihi.tech/ursa"
xmlns:u="https://irihi.tech/ursa"> xmlns:converters="using:Ursa.Converters">
<Design.PreviewWith> <Design.PreviewWith>
<StackPanel Orientation="Horizontal" Margin="20" Width="300" Spacing="10"> <StackPanel Orientation="Horizontal" Margin="20" Width="300" Spacing="10">
<u:Badge Header="5"> <u:Badge Header="5">
@@ -28,8 +28,6 @@
</StackPanel> </StackPanel>
</Design.PreviewWith> </Design.PreviewWith>
<converters:BadgeContentOverflowConverter x:Key="BadgeContentConverter" />
<ControlTheme x:Key="{x:Type u:Badge}" TargetType="{x:Type u:Badge}"> <ControlTheme x:Key="{x:Type u:Badge}" TargetType="{x:Type u:Badge}">
<!-- Set a very large corner radius to achieve pill look. --> <!-- Set a very large corner radius to achieve pill look. -->
<Setter Property="CornerRadius" Value="{DynamicResource BadgeCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource BadgeCornerRadius}" />
@@ -85,7 +83,7 @@
TextElement.Foreground="{TemplateBinding Foreground}" TextElement.Foreground="{TemplateBinding Foreground}"
ContentTemplate="{TemplateBinding HeaderTemplate}"> ContentTemplate="{TemplateBinding HeaderTemplate}">
<ContentPresenter.Content> <ContentPresenter.Content>
<MultiBinding Converter="{StaticResource BadgeContentConverter}"> <MultiBinding Converter="{converters:BadgeContentOverflowConverter}">
<Binding Path="Header" RelativeSource="{RelativeSource TemplatedParent}" /> <Binding Path="Header" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="OverflowCount" RelativeSource="{RelativeSource TemplatedParent}" /> <Binding Path="OverflowCount" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding> </MultiBinding>

View File

@@ -93,4 +93,4 @@
</Style> </Style>
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -204,14 +204,14 @@
Classes="Tertiary" Classes="Tertiary"
Grid.Column="0" Grid.Column="0"
Icon="{DynamicResource CalendarViewFastForwardGlyph}" Icon="{DynamicResource CalendarViewFastForwardGlyph}"
Theme="{DynamicResource BorderlessIconButton}"/> Theme="{DynamicResource BorderlessIconButton}" />
<u:IconButton <u:IconButton
Name="{x:Static u:CalendarView.PART_PreviousButton}" Name="{x:Static u:CalendarView.PART_PreviousButton}"
Grid.Column="1" Grid.Column="1"
Classes="Tertiary" Classes="Tertiary"
Icon="{DynamicResource CalendarItemPreviousIconGlyph}" Icon="{DynamicResource CalendarItemPreviousIconGlyph}"
Theme="{DynamicResource BorderlessIconButton}"/> Theme="{DynamicResource BorderlessIconButton}" />
<Grid Grid.Column="2" ColumnDefinitions="*, *"> <Grid Grid.Column="2" ColumnDefinitions="*, *">
<Button <Button
@@ -239,13 +239,13 @@
Grid.Column="3" Grid.Column="3"
Classes="Tertiary" Classes="Tertiary"
Icon="{DynamicResource CalendarItemNextIconGlyph}" Icon="{DynamicResource CalendarItemNextIconGlyph}"
Theme="{DynamicResource BorderlessIconButton}"/> Theme="{DynamicResource BorderlessIconButton}" />
<u:IconButton <u:IconButton
Name="{x:Static u:CalendarView.PART_FastNextButton}" Name="{x:Static u:CalendarView.PART_FastNextButton}"
Grid.Column="4" Grid.Column="4"
Classes="Tertiary" Classes="Tertiary"
Icon="{DynamicResource CalendarViewFastBackwardGlyph}" Icon="{DynamicResource CalendarViewFastBackwardGlyph}"
Theme="{DynamicResource BorderlessIconButton}"/> Theme="{DynamicResource BorderlessIconButton}" />
</Grid> </Grid>
<Grid <Grid
Name="{x:Static u:CalendarView.PART_MonthGrid}" Name="{x:Static u:CalendarView.PART_MonthGrid}"

View File

@@ -1,10 +1,10 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converter="clr-namespace:Ursa.Themes.Semi.Converters" xmlns:u="https://irihi.tech/ursa"
xmlns:u="https://irihi.tech/ursa"> xmlns:converters="using:Ursa.Themes.Semi.Converters">
<ControlTheme x:Key="{x:Type u:Clock}" TargetType="u:Clock"> <ControlTheme x:Key="{x:Type u:Clock}" TargetType="u:Clock">
<Setter Property="HandBrush" Value="{DynamicResource ClockHandBrush}"/> <Setter Property="HandBrush" Value="{DynamicResource ClockHandBrush}" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="u:Clock"> <ControlTemplate TargetType="u:Clock">
<Grid> <Grid>
@@ -17,7 +17,7 @@
<UniformGrid Rows="2" IsVisible="{TemplateBinding ShowHourHand}"> <UniformGrid Rows="2" IsVisible="{TemplateBinding ShowHourHand}">
<Border <Border
Width="16" Width="16"
Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Bounds.Width, Converter={x:Static converter:ClockHandLengthConverter.Hour}}" Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Bounds.Width, Converter={x:Static converters:ClockHandLengthConverter.Hour}}"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Background="{TemplateBinding HandBrush}" Background="{TemplateBinding HandBrush}"
CornerRadius="8" /> CornerRadius="8" />
@@ -28,7 +28,7 @@
<UniformGrid Rows="2" IsVisible="{TemplateBinding ShowMinuteHand}"> <UniformGrid Rows="2" IsVisible="{TemplateBinding ShowMinuteHand}">
<Border <Border
Width="8" Width="8"
Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Bounds.Width, Converter={x:Static converter:ClockHandLengthConverter.Minute}}" Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Bounds.Width, Converter={x:Static converters:ClockHandLengthConverter.Minute}}"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Background="{TemplateBinding HandBrush}" Background="{TemplateBinding HandBrush}"
CornerRadius="4" /> CornerRadius="4" />
@@ -39,7 +39,7 @@
<UniformGrid Rows="2" IsVisible="{TemplateBinding ShowSecondHand}"> <UniformGrid Rows="2" IsVisible="{TemplateBinding ShowSecondHand}">
<Border <Border
Width="4" Width="4"
Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Bounds.Width, Converter={x:Static converter:ClockHandLengthConverter.Second}}" Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Bounds.Width, Converter={x:Static converters:ClockHandLengthConverter.Second}}"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Background="{TemplateBinding HandBrush}" Background="{TemplateBinding HandBrush}"
CornerRadius="4" /> CornerRadius="4" />
@@ -57,4 +57,4 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -23,4 +23,4 @@
</Setter> </Setter>
--> -->
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -95,7 +95,7 @@
</DataValidationErrors> </DataValidationErrors>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^.clearButton, ^.ClearButton"> <Style Selector="^.clearButton, ^.ClearButton">
<Style Selector="^:pointerover /template/ Button#ClearButton"> <Style Selector="^:pointerover /template/ Button#ClearButton">
<Setter Property="IsVisible" Value="{Binding $parent[u:DatePicker].SelectedDate, Converter={x:Static ObjectConverters.IsNotNull}}" /> <Setter Property="IsVisible" Value="{Binding $parent[u:DatePicker].SelectedDate, Converter={x:Static ObjectConverters.IsNotNull}}" />
@@ -131,4 +131,4 @@
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -2,8 +2,7 @@
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa" xmlns:u="https://irihi.tech/ursa"
xmlns:iri="https://irihi.tech/shared" xmlns:iri="https://irihi.tech/shared">
x:CompileBindings="True">
<ControlTheme x:Key="{x:Type u:DateRangePicker}" TargetType="u:DateRangePicker"> <ControlTheme x:Key="{x:Type u:DateRangePicker}" TargetType="u:DateRangePicker">
<Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" /> <Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" /> <Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
@@ -171,4 +170,4 @@
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="https://github.com/avaloniaui"
xmlns:u="https://irihi.tech/ursa"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<ControlTheme x:Key="{x:Type u:DateTimePicker}" TargetType="u:DateTimePicker"> <ControlTheme x:Key="{x:Type u:DateTimePicker}" TargetType="u:DateTimePicker">
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackground}" /> <Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackground}" />
<Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerForeground}" /> <Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerForeground}" />
@@ -87,11 +88,12 @@
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}" FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
FontSize="{DynamicResource DefaultFontSize}" FontSize="{DynamicResource DefaultFontSize}"
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" /> IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" />
<u:TimePickerPresenter Grid.Column="1" <u:TimePickerPresenter
Grid.Column="1"
Name="{x:Static u:DateTimePicker.PART_TimePicker}" Name="{x:Static u:DateTimePicker.PART_TimePicker}"
FontSize="{DynamicResource DefaultFontSize}" FontSize="{DynamicResource DefaultFontSize}"
NeedsConfirmation="{TemplateBinding NeedConfirmation}" NeedsConfirmation="{TemplateBinding NeedConfirmation}"
PanelFormat="{TemplateBinding PanelFormat}"/> PanelFormat="{TemplateBinding PanelFormat}" />
</Grid> </Grid>
</Border> </Border>
</Popup> </Popup>
@@ -101,7 +103,7 @@
</DataValidationErrors> </DataValidationErrors>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^.clearButton, ^.ClearButton"> <Style Selector="^.clearButton, ^.ClearButton">
<Style Selector="^:pointerover /template/ Button#ClearButton"> <Style Selector="^:pointerover /template/ Button#ClearButton">
<Setter Property="IsVisible" Value="{Binding $parent[u:DateTimePicker].SelectedDate, Converter={x:Static ObjectConverters.IsNotNull}}" /> <Setter Property="IsVisible" Value="{Binding $parent[u:DateTimePicker].SelectedDate, Converter={x:Static ObjectConverters.IsNotNull}}" />
@@ -137,4 +139,4 @@
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -17,8 +17,8 @@
<TransformOperationsTransition Property="RenderTransform" Duration="0.2" /> <TransformOperationsTransition Property="RenderTransform" Duration="0.2" />
</Transitions> </Transitions>
</Setter> </Setter>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="RenderTransform" Value="scale(1.0)" /> <Setter Property="RenderTransform" Value="scale(1.0)" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="u:CustomDialogControl"> <ControlTemplate TargetType="u:CustomDialogControl">
@@ -134,8 +134,8 @@
<Setter Property="MinWidth" Value="{DynamicResource DialogMinWidth}" /> <Setter Property="MinWidth" Value="{DynamicResource DialogMinWidth}" />
<Setter Property="MinHeight" Value="{DynamicResource DialogMinHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource DialogMinHeight}" />
<Setter Property="CornerRadius" Value="{DynamicResource DialogCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource DialogCornerRadius}" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="Transitions"> <Setter Property="Transitions">
<Transitions> <Transitions>
<TransformOperationsTransition Property="RenderTransform" Duration="0.2" /> <TransformOperationsTransition Property="RenderTransform" Duration="0.2" />

View File

@@ -1,4 +1,6 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith> <Design.PreviewWith>
<StackPanel Orientation="Horizontal" Margin="20"> <StackPanel Orientation="Horizontal" Margin="20">
<Button Theme="{DynamicResource CloseButton}" /> <Button Theme="{DynamicResource CloseButton}" />

View File

@@ -1,15 +1,16 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="https://github.com/avaloniaui"
xmlns:u="https://irihi.tech/ursa" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:iri="https://irihi.tech/shared"> xmlns:u="https://irihi.tech/ursa"
xmlns:iri="https://irihi.tech/shared">
<ControlTheme TargetType="u:DisableContainer" x:Key="{x:Type u:DisableContainer}"> <ControlTheme TargetType="u:DisableContainer" x:Key="{x:Type u:DisableContainer}">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="u:DisableContainer"> <ControlTemplate TargetType="u:DisableContainer">
<Panel> <Panel>
<ContentPresenter Content="{TemplateBinding Content}" /> <ContentPresenter Content="{TemplateBinding Content}" />
<iri:PureRectangle Background="Transparent" IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.IsEnabled, Converter={x:Static BoolConverters.Not}}" Cursor="No" ToolTip.Tip="{TemplateBinding DisabledTip}"/> <iri:PureRectangle Background="Transparent" IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.IsEnabled, Converter={x:Static BoolConverters.Not}}" Cursor="No" ToolTip.Tip="{TemplateBinding DisabledTip}" />
</Panel> </Panel>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -41,7 +41,7 @@
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{DynamicResource ThicknessDividerTextMargin}" Margin="{DynamicResource ThicknessDividerTextMargin}"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"/> IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}" />
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" /> <Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
</Grid> </Grid>
</ControlTemplate> </ControlTemplate>
@@ -62,7 +62,7 @@
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{DynamicResource ThicknessDividerTextMargin}" Margin="{DynamicResource ThicknessDividerTextMargin}"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"/> IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}" />
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" /> <Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
</Grid> </Grid>
</ControlTemplate> </ControlTemplate>
@@ -83,7 +83,7 @@
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{DynamicResource ThicknessDividerTextMargin}" Margin="{DynamicResource ThicknessDividerTextMargin}"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"/> IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}" />
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" /> <Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
</Grid> </Grid>
</ControlTemplate> </ControlTemplate>
@@ -104,7 +104,7 @@
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{DynamicResource ThicknessDividerTextMargin}" Margin="{DynamicResource ThicknessDividerTextMargin}"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"/> IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}" />
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" /> <Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
</Grid> </Grid>
</ControlTemplate> </ControlTemplate>

View File

@@ -8,8 +8,8 @@
<Setter Property="HorizontalAlignment" Value="Stretch" /> <Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="MinWidth" Value="96" /> <Setter Property="MinWidth" Value="96" />
<Setter Property="MinHeight" Value="96" /> <Setter Property="MinHeight" Value="96" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="Padding" Value="{DynamicResource DrawerMargin}" /> <Setter Property="Padding" Value="{DynamicResource DrawerMargin}" />
<Setter Property="BorderThickness" Value="{DynamicResource DrawerBorderThickness}" /> <Setter Property="BorderThickness" Value="{DynamicResource DrawerBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource DrawerCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource DrawerCornerRadius}" />
@@ -105,8 +105,8 @@
<Setter Property="HorizontalAlignment" Value="Stretch" /> <Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="MinWidth" Value="96" /> <Setter Property="MinWidth" Value="96" />
<Setter Property="MinHeight" Value="96" /> <Setter Property="MinHeight" Value="96" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="Padding" Value="{DynamicResource DrawerMargin}" /> <Setter Property="Padding" Value="{DynamicResource DrawerMargin}" />
<Setter Property="BorderThickness" Value="{DynamicResource DrawerBorderThickness}" /> <Setter Property="BorderThickness" Value="{DynamicResource DrawerBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource DrawerCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource DrawerCornerRadius}" />
@@ -238,4 +238,4 @@
<Setter Property="ResizeDirection" Value="Left" /> <Setter Property="ResizeDirection" Value="Left" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,3 +0,0 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</ResourceDictionary>

View File

@@ -32,4 +32,4 @@
</Setter> </Setter>
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -2,7 +2,7 @@
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa" xmlns:u="https://irihi.tech/ursa"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters"> xmlns:converters="using:Ursa.Themes.Semi.Converters">
<ControlTheme x:Key="{x:Type u:Form}" <ControlTheme x:Key="{x:Type u:Form}"
TargetType="u:Form"> TargetType="u:Form">
<Setter Property="Grid.IsSharedSizeScope" <Setter Property="Grid.IsSharedSizeScope"
@@ -80,8 +80,7 @@
<ControlTemplate TargetType="u:FormItem"> <ControlTemplate TargetType="u:FormItem">
<Grid RowDefinitions="*, *"> <Grid RowDefinitions="*, *">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" <ColumnDefinition Width="Auto" SharedSizeGroup="Label" />
SharedSizeGroup="Label" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border <Border
@@ -98,7 +97,7 @@
Name="PART_Label" Name="PART_Label"
Content="{TemplateBinding Label}" Content="{TemplateBinding Label}"
Background="Transparent" Background="Transparent"
FontWeight="{DynamicResource TextBlockTitleFontWeight}"/> FontWeight="{DynamicResource TextBlockTitleFontWeight}" />
<TextBlock <TextBlock
Foreground="{DynamicResource FormAsteriskForeground}" Foreground="{DynamicResource FormAsteriskForeground}"
IsVisible="{TemplateBinding IsRequired}" IsVisible="{TemplateBinding IsRequired}"

View File

@@ -129,4 +129,4 @@
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxDisabledBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource TextBoxDisabledBorderBrush}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -2,7 +2,7 @@
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa" xmlns:u="https://irihi.tech/ursa"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters"> xmlns:converters="using:Ursa.Themes.Semi.Converters">
<Design.PreviewWith> <Design.PreviewWith>
<StackPanel Margin="20" Width="400"> <StackPanel Margin="20" Width="400">
<u:IconButton Icon="{StaticResource SemiIconCamera}" <u:IconButton Icon="{StaticResource SemiIconCamera}"
@@ -29,7 +29,6 @@
<Button Theme="{DynamicResource BorderlessButton}" Classes="Danger" Content="Button" /> <Button Theme="{DynamicResource BorderlessButton}" Classes="Danger" Content="Button" />
</StackPanel> </StackPanel>
</Design.PreviewWith> </Design.PreviewWith>
<converters:BooleansToOpacityConverter x:Key="OpacityConverter" />
<ControlTheme x:Key="{x:Type u:IconButton}" TargetType="u:IconButton"> <ControlTheme x:Key="{x:Type u:IconButton}" TargetType="u:IconButton">
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" /> <Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
@@ -75,7 +74,7 @@
ContentTemplate="{TemplateBinding IconTemplate}" ContentTemplate="{TemplateBinding IconTemplate}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Foreground="{Binding #PART_ContentPresenter.Foreground}" Foreground="{Binding #PART_ContentPresenter.Foreground}"
Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=!IsLoading, Converter={StaticResource OpacityConverter}}"> Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=!IsLoading, Converter={converters:BooleansToOpacityConverter}}">
<ContentPresenter.DataTemplates> <ContentPresenter.DataTemplates>
<DataTemplate DataType="Geometry"> <DataTemplate DataType="Geometry">
<PathIcon <PathIcon

View File

@@ -28,4 +28,4 @@
<Setter Property="Cursor" Value="Hand" /> <Setter Property="Cursor" Value="Hand" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,9 +1,9 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="using:Avalonia.Controls.Converters"
xmlns:u="https://irihi.tech/ursa" xmlns:u="https://irihi.tech/ursa"
xmlns:iri="https://irihi.tech/shared"> xmlns:iri="https://irihi.tech/shared"
xmlns:converters="using:Avalonia.Controls.Converters">
<converters:PlatformKeyGestureConverter x:Key="KeyGestureConverter" /> <converters:PlatformKeyGestureConverter x:Key="KeyGestureConverter" />
<ControlTheme x:Key="{x:Type u:KeyGestureInput}" TargetType="u:KeyGestureInput"> <ControlTheme x:Key="{x:Type u:KeyGestureInput}" TargetType="u:KeyGestureInput">
@@ -25,8 +25,9 @@
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"> CornerRadius="{TemplateBinding CornerRadius}">
<Panel VerticalAlignment="Stretch" Margin="{TemplateBinding Padding}"> <Panel VerticalAlignment="Stretch" Margin="{TemplateBinding Padding}">
<Grid ColumnDefinitions="Auto, *, Auto" > <Grid ColumnDefinitions="Auto, *, Auto">
<ContentPresenter Grid.Column="0" <ContentPresenter
Grid.Column="0"
Content="{TemplateBinding InnerLeftContent}" Content="{TemplateBinding InnerLeftContent}"
Padding="{TemplateBinding Padding, Converter={iri:ThicknessMixerConverter Right}}" Padding="{TemplateBinding Padding, Converter={iri:ThicknessMixerConverter Right}}"
DockPanel.Dock="Left" DockPanel.Dock="Left"
@@ -34,7 +35,7 @@
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Foreground="{DynamicResource TextBoxInnerForeground}" Foreground="{DynamicResource TextBoxInnerForeground}"
IsVisible="{Binding Path=InnerLeftContent, RelativeSource={RelativeSource TemplatedParent}, IsVisible="{Binding Path=InnerLeftContent, RelativeSource={RelativeSource TemplatedParent},
Converter={x:Static ObjectConverters.IsNotNull}}" /> Converter={x:Static ObjectConverters.IsNotNull}}" />
<ContentPresenter <ContentPresenter
Grid.Column="2" Grid.Column="2"
Content="{TemplateBinding InnerRightContent}" Content="{TemplateBinding InnerRightContent}"
@@ -44,14 +45,14 @@
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Foreground="{DynamicResource TextBoxInnerForeground}" Foreground="{DynamicResource TextBoxInnerForeground}"
IsVisible="{Binding Path=InnerRightContent, RelativeSource={RelativeSource TemplatedParent}, IsVisible="{Binding Path=InnerRightContent, RelativeSource={RelativeSource TemplatedParent},
Converter={x:Static ObjectConverters.IsNotNull}}" /> Converter={x:Static ObjectConverters.IsNotNull}}" />
<SelectableTextBlock <SelectableTextBlock
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Text="{TemplateBinding Gesture, Text="{TemplateBinding Gesture,Converter={StaticResource KeyGestureConverter}}" />
Converter={StaticResource KeyGestureConverter}}" /> <Button
<Button Grid.Column="1" Grid.Column="1"
Name="PART_ClearButton" Name="PART_ClearButton"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Command="{Binding $parent[u:KeyGestureInput].Clear}" Command="{Binding $parent[u:KeyGestureInput].Clear}"
@@ -87,4 +88,4 @@
</Style> </Style>
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,15 +1,14 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters" xmlns:u="https://irihi.tech/ursa"
xmlns:iri="https://irihi.tech/shared" xmlns:iri="https://irihi.tech/shared"
xmlns:u="clr-namespace:Ursa.Controls;assembly=Ursa"> xmlns:converters="using:Ursa.Themes.Semi.Converters">
<Design.PreviewWith> <Design.PreviewWith>
<StackPanel Margin="20"> <StackPanel Margin="20">
<u:LoadingIcon Classes="Large"/> <u:LoadingIcon Classes="Large" />
</StackPanel> </StackPanel>
</Design.PreviewWith> </Design.PreviewWith>
<converters:BrushToColorConverter x:Key="BrushToColorConverter" />
<ControlTheme x:Key="{x:Type u:LoadingIcon}" TargetType="u:LoadingIcon"> <ControlTheme x:Key="{x:Type u:LoadingIcon}" TargetType="u:LoadingIcon">
<Setter Property="IsLoading" Value="True" /> <Setter Property="IsLoading" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource LoadingIconForeground}" /> <Setter Property="Foreground" Value="{DynamicResource LoadingIconForeground}" />
@@ -29,8 +28,8 @@
<ConicGradientBrush Angle="50"> <ConicGradientBrush Angle="50">
<GradientStops> <GradientStops>
<GradientStop Offset="0.4" Color="Transparent" /> <GradientStop Offset="0.4" Color="Transparent" />
<GradientStop Offset="0.8" Color="{Binding Foreground, Converter={StaticResource BrushToColorConverter}, RelativeSource={RelativeSource TemplatedParent}}" /> <GradientStop Offset="0.8" Color="{Binding Foreground, Converter={converters:BrushToColorConverter}, RelativeSource={RelativeSource TemplatedParent}}" />
<GradientStop Offset="1.0" Color="{Binding Foreground, Converter={StaticResource BrushToColorConverter}, RelativeSource={RelativeSource TemplatedParent}}" /> <GradientStop Offset="1.0" Color="{Binding Foreground, Converter={converters:BrushToColorConverter}, RelativeSource={RelativeSource TemplatedParent}}" />
</GradientStops> </GradientStops>
</ConicGradientBrush> </ConicGradientBrush>
</Arc.Stroke> </Arc.Stroke>
@@ -127,4 +126,4 @@
<Setter Property="Effect" Value="blur(5)" /> <Setter Property="Effect" Value="blur(5)" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,8 +1,8 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:iri="https://irihi.tech/shared" xmlns:u="https://irihi.tech/ursa"
xmlns:u="https://irihi.tech/ursa"> xmlns:iri="https://irihi.tech/shared">
<ControlTheme x:Key="{x:Type u:Marquee}" TargetType="u:Marquee"> <ControlTheme x:Key="{x:Type u:Marquee}" TargetType="u:Marquee">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
@@ -22,4 +22,4 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -179,7 +179,7 @@
<Setter Property="Foreground" Value="{DynamicResource ComboBoxIconPressedForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ComboBoxIconPressedForeground}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^:focus"> <Style Selector="^:focus">
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorFocusBackground}" /> <Setter Property="Background" Value="{DynamicResource ComboBoxSelectorFocusBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxSelectorFocusBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ComboBoxSelectorFocusBorderBrush}" />
@@ -301,4 +301,4 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,9 +1,8 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters" xmlns:u="https://irihi.tech/ursa"
xmlns:u="https://irihi.tech/ursa"> xmlns:converters="using:Ursa.Themes.Semi.Converters">
<converters:NavMenuMarginConverter x:Key="NavMarginConverter" />
<ControlTheme x:Key="{x:Type u:NavMenu}" TargetType="u:NavMenu"> <ControlTheme x:Key="{x:Type u:NavMenu}" TargetType="u:NavMenu">
<Setter Property="Grid.IsSharedSizeScope" Value="True" /> <Setter Property="Grid.IsSharedSizeScope" Value="True" />
@@ -45,13 +44,9 @@
<Setter Property="Grid.IsSharedSizeScope" Value="False" /> <Setter Property="Grid.IsSharedSizeScope" Value="False" />
</Style> </Style>
<Style Selector="^.enable_animation"> <Style Selector="^.enable_animation">
<Setter Property="u:SizeAnimationHelper.TriggerAvaloniaProperty" <Setter Property="u:SizeAnimationHelper.TriggerAvaloniaProperty" Value="{x:Static u:NavMenu.IsHorizontalCollapsedProperty}" />
Value="{x:Static u:NavMenu.IsHorizontalCollapsedProperty}"> <Setter Property="u:SizeAnimationHelper.CreateAnimation" Value="{DynamicResource NavMenuWidthAnimationGenerator}" />
</Setter> <Setter Property="u:SizeAnimationHelper.EnableWHAnimation" Value="True" />
<Setter Property="u:SizeAnimationHelper.CreateAnimation"
Value="{DynamicResource NavMenuWidthAnimationGenerator}">
</Setter>
<Setter Property="u:SizeAnimationHelper.EnableWHAnimation" Value="True"></Setter>
</Style> </Style>
</ControlTheme> </ControlTheme>
@@ -71,7 +66,7 @@
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Center"> VerticalAlignment="Center">
<Grid.Margin> <Grid.Margin>
<MultiBinding Converter="{StaticResource NavMarginConverter}"> <MultiBinding Converter="{converters:NavMenuMarginConverter}">
<Binding Path="SubMenuIndent" RelativeSource="{RelativeSource TemplatedParent}" /> <Binding Path="SubMenuIndent" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Level" RelativeSource="{RelativeSource TemplatedParent}" /> <Binding Path="Level" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="IsHorizontalCollapsed" RelativeSource="{RelativeSource TemplatedParent}" /> <Binding Path="IsHorizontalCollapsed" RelativeSource="{RelativeSource TemplatedParent}" />

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="https://github.com/avaloniaui"
xmlns:u="https://irihi.tech/ursa"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<Design.PreviewWith> <Design.PreviewWith>
<ThemeVariantScope RequestedThemeVariant="Dark"> <ThemeVariantScope RequestedThemeVariant="Dark">
<ReversibleStackPanel Orientation="Vertical" ReverseOrder="True"> <ReversibleStackPanel Orientation="Vertical" ReverseOrder="True">

View File

@@ -222,4 +222,4 @@
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -33,4 +33,4 @@
</Setter> </Setter>
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -39,7 +39,7 @@
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Background="Transparent" Background="Transparent"
Cursor="SizeAll"/> Cursor="SizeAll" />
<Button <Button
Name="PART_ClearButton" Name="PART_ClearButton"
Margin="0,0,8,0" Margin="0,0,8,0"
@@ -63,7 +63,7 @@
<Setter Property="IsVisible" Value="True" /> <Setter Property="IsVisible" Value="True" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.Large"> <Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownLargeHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource NumericUpDownLargeHeight}" />
</Style> </Style>
@@ -71,4 +71,4 @@
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownSmallHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource NumericUpDownSmallHeight}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -86,4 +86,4 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,7 +1,8 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="https://github.com/avaloniaui"
xmlns:u="https://irihi.tech/ursa" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:iri="https://irihi.tech/shared"> xmlns:u="https://irihi.tech/ursa"
xmlns:iri="https://irihi.tech/shared">
<ControlTheme x:Key="{x:Type u:PopConfirm}" <ControlTheme x:Key="{x:Type u:PopConfirm}"
TargetType="u:PopConfirm"> TargetType="u:PopConfirm">
<Setter Property="Placement" Value="BottomEdgeAlignedLeft" /> <Setter Property="Placement" Value="BottomEdgeAlignedLeft" />

View File

@@ -209,7 +209,7 @@
<Style Selector="^:error /template/ Thumb#thumb"> <Style Selector="^:error /template/ Thumb#thumb">
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style> </Style>
<Style Selector="^:disabled"> <Style Selector="^:disabled">
<Style Selector="^ /template/ Border#PART_InnerSection"> <Style Selector="^ /template/ Border#PART_InnerSection">
<Setter Property="Background" Value="{DynamicResource SliderTrackDisabledForeground}" /> <Setter Property="Background" Value="{DynamicResource SliderTrackDisabledForeground}" />
@@ -224,4 +224,4 @@
</Style> </Style>
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="https://github.com/avaloniaui"
xmlns:u="https://irihi.tech/ursa"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<ControlTheme x:Key="{x:Type u:RatingCharacter}" TargetType="u:RatingCharacter"> <ControlTheme x:Key="{x:Type u:RatingCharacter}" TargetType="u:RatingCharacter">
<Setter Property="Character" Value="{DynamicResource RatingStarIconGlyph}" /> <Setter Property="Character" Value="{DynamicResource RatingStarIconGlyph}" />
<Setter Property="Background" Value="{DynamicResource RatingCharacterBackground}" /> <Setter Property="Background" Value="{DynamicResource RatingCharacterBackground}" />

View File

@@ -1,8 +1,8 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:iri="https://irihi.tech/shared" xmlns:u="https://irihi.tech/ursa"
xmlns:u="https://irihi.tech/ursa"> xmlns:iri="https://irihi.tech/shared">
<ControlTheme x:Key="{x:Type u:WindowResizerThumb}" TargetType="u:WindowResizerThumb"> <ControlTheme x:Key="{x:Type u:WindowResizerThumb}" TargetType="u:WindowResizerThumb">
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="Template"> <Setter Property="Template">
@@ -142,4 +142,4 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -40,8 +40,8 @@
<Setter Property="RenderTransform" Value="rotate(270deg)" /> <Setter Property="RenderTransform" Value="rotate(270deg)" />
</Style> </Style>
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="PrimaryScrollToButton" TargetType="u:ScrollToButton"> <ControlTheme x:Key="PrimaryScrollToButton" TargetType="u:ScrollToButton">
<Setter Property="HorizontalAlignment" Value="Right" /> <Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Bottom" /> <Setter Property="VerticalAlignment" Value="Bottom" />

View File

@@ -38,7 +38,7 @@
<ControlTheme x:Key="{x:Type u:SelectionListItem}" TargetType="u:SelectionListItem"> <ControlTheme x:Key="{x:Type u:SelectionListItem}" TargetType="u:SelectionListItem">
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="8" /> <Setter Property="Padding" Value="8" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="u:SelectionListItem"> <ControlTemplate TargetType="u:SelectionListItem">
@@ -58,4 +58,4 @@
<Setter Property="FontWeight" Value="{DynamicResource TextBlockTitleFontWeight}" /> <Setter Property="FontWeight" Value="{DynamicResource TextBlockTitleFontWeight}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -35,4 +35,4 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa"> xmlns:u="https://irihi.tech/ursa">
<Design.PreviewWith> <Design.PreviewWith>
<u:ClosableTag Content="Closable Tag"/> <u:ClosableTag Content="Closable Tag" />
</Design.PreviewWith> </Design.PreviewWith>
<ControlTheme x:Key="{x:Type u:TagInput}" TargetType="u:TagInput"> <ControlTheme x:Key="{x:Type u:TagInput}" TargetType="u:TagInput">
<Setter Property="InputTheme" Value="{DynamicResource TagInputTextBoxTheme}" /> <Setter Property="InputTheme" Value="{DynamicResource TagInputTextBoxTheme}" />

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="https://github.com/avaloniaui"
xmlns:u="https://irihi.tech/ursa"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<ControlTheme TargetType="u:ThemeToggleButton" x:Key="{x:Type u:ThemeToggleButton}"> <ControlTheme TargetType="u:ThemeToggleButton" x:Key="{x:Type u:ThemeToggleButton}">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="u:ThemeToggleButton"> <ControlTemplate TargetType="u:ThemeToggleButton">

View File

@@ -1,8 +1,8 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:iri="https://irihi.tech/shared" xmlns:u="https://irihi.tech/ursa"
xmlns:u="https://irihi.tech/ursa"> xmlns:iri="https://irihi.tech/shared">
<Design.PreviewWith> <Design.PreviewWith>
<u:TimePickerPresenter Height="300" /> <u:TimePickerPresenter Height="300" />
</Design.PreviewWith> </Design.PreviewWith>
@@ -106,7 +106,7 @@
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" /> <Setter Property="BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" />
<Setter Property="MinHeight" Value="32"/> <Setter Property="MinHeight" Value="32" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="u:TimePicker"> <ControlTemplate TargetType="u:TimePicker">
<DataValidationErrors> <DataValidationErrors>
@@ -153,8 +153,7 @@
Name="{x:Static iri:PartNames.PART_Popup}" Name="{x:Static iri:PartNames.PART_Popup}"
Grid.Column="0" Grid.Column="0"
IsLightDismissEnabled="True" IsLightDismissEnabled="True"
IsOpen="{TemplateBinding IsDropdownOpen, IsOpen="{TemplateBinding IsDropdownOpen,Mode=TwoWay}"
Mode=TwoWay}"
Placement="BottomEdgeAlignedLeft" Placement="BottomEdgeAlignedLeft"
PlacementTarget="Background"> PlacementTarget="Background">
<Border <Border
@@ -178,19 +177,17 @@
Margin="8,8,8,0" Margin="8,8,8,0"
Content="{TemplateBinding PopupInnerTopContent}" Content="{TemplateBinding PopupInnerTopContent}"
DockPanel.Dock="Top" DockPanel.Dock="Top"
IsVisible="{TemplateBinding PopupInnerTopContent, IsVisible="{TemplateBinding PopupInnerTopContent,Converter={x:Static ObjectConverters.IsNotNull}}" />
Converter={x:Static ObjectConverters.IsNotNull}}" />
<ContentPresenter <ContentPresenter
Name="PART_PopupFooter" Name="PART_PopupFooter"
Margin="8,0,8,8" Margin="8,0,8,8"
Content="{TemplateBinding PopupInnerBottomContent}" Content="{TemplateBinding PopupInnerBottomContent}"
DockPanel.Dock="Bottom" DockPanel.Dock="Bottom"
IsVisible="{TemplateBinding PopupInnerBottomContent, IsVisible="{TemplateBinding PopupInnerBottomContent,Converter={x:Static ObjectConverters.IsNotNull}}" />
Converter={x:Static ObjectConverters.IsNotNull}}" />
<u:TimePickerPresenter <u:TimePickerPresenter
Name="{x:Static u:TimePicker.PART_Presenter}" Name="{x:Static u:TimePicker.PART_Presenter}"
NeedsConfirmation="{TemplateBinding NeedConfirmation}" NeedsConfirmation="{TemplateBinding NeedConfirmation}"
PanelFormat="{TemplateBinding PanelFormat}"/> PanelFormat="{TemplateBinding PanelFormat}" />
</DockPanel> </DockPanel>
</Border> </Border>
</Popup> </Popup>
@@ -205,7 +202,7 @@
<Setter Property="IsVisible" Value="{Binding $parent[u:TimePicker].SelectedTime, Converter={x:Static ObjectConverters.IsNotNull}}" /> <Setter Property="IsVisible" Value="{Binding $parent[u:TimePicker].SelectedTime, Converter={x:Static ObjectConverters.IsNotNull}}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Button#PART_Button"> <Style Selector="^:pointerover /template/ Button#PART_Button">
<Setter Property="IsVisible" Value="{Binding $parent[u:TimePicker].SelectedTime, Converter={x:Static ObjectConverters.IsNull}}"/> <Setter Property="IsVisible" Value="{Binding $parent[u:TimePicker].SelectedTime, Converter={x:Static ObjectConverters.IsNull}}" />
</Style> </Style>
</Style> </Style>
@@ -238,4 +235,4 @@
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,8 +1,8 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:iri="https://irihi.tech/shared" xmlns:u="https://irihi.tech/ursa"
xmlns:u="https://irihi.tech/ursa"> xmlns:iri="https://irihi.tech/shared">
<ControlTheme x:Key="{x:Type u:TimeRangePicker}" TargetType="u:TimeRangePicker"> <ControlTheme x:Key="{x:Type u:TimeRangePicker}" TargetType="u:TimeRangePicker">
<Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" /> <Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" /> <Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
@@ -138,8 +138,7 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
NeedsConfirmation="{TemplateBinding NeedConfirmation}" NeedsConfirmation="{TemplateBinding NeedConfirmation}"
PanelFormat="{TemplateBinding PanelFormat}" PanelFormat="{TemplateBinding PanelFormat}" />
/>
<Rectangle <Rectangle
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
@@ -152,8 +151,7 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="2" Grid.Column="2"
NeedsConfirmation="{TemplateBinding NeedConfirmation}" NeedsConfirmation="{TemplateBinding NeedConfirmation}"
PanelFormat="{TemplateBinding PanelFormat}" PanelFormat="{TemplateBinding PanelFormat}" />
/>
</Grid> </Grid>
</DockPanel> </DockPanel>
</Border> </Border>
@@ -192,4 +190,4 @@
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,9 +1,7 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters" xmlns:u="https://irihi.tech/ursa">
xmlns:u="https://irihi.tech/ursa"
xmlns:usemi="https://irihi.tech/ursa/themes/semi">
<Design.PreviewWith> <Design.PreviewWith>
<StackPanel Width="100" Spacing="20"> <StackPanel Width="100" Spacing="20">
<u:Timeline> <u:Timeline>
@@ -23,14 +21,6 @@
</Setter> </Setter>
</ControlTheme> </ControlTheme>
<converters:TimelineItemTypeToIconForegroundConverter
x:Key="ForegroundConverter"
DefaultBrush="{DynamicResource DefaultTimelineIconForeground}"
ErrorBrush="{DynamicResource ErrorTimelineIconForeground}"
OngoingBrush="{DynamicResource OngoingTimelineIconForeground}"
SuccessBrush="{DynamicResource SuccessTimelineIconForeground}"
WarningBrush="{DynamicResource WarningTimelineIconForeground}" />
<ControlTheme x:Key="{x:Type u:TimelineItem}" TargetType="u:TimelineItem"> <ControlTheme x:Key="{x:Type u:TimelineItem}" TargetType="u:TimelineItem">
<Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" /> <Setter Property="VerticalAlignment" Value="Top" />
@@ -88,7 +78,7 @@
VerticalAlignment="Top" VerticalAlignment="Top"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
TextElement.FontSize="12"/> TextElement.FontSize="12" />
<TextBlock <TextBlock
Name="{x:Static u:TimelineItem.PART_Time}" Name="{x:Static u:TimelineItem.PART_Time}"
Grid.Row="0" Grid.Row="0"
@@ -111,28 +101,28 @@
<Setter Property="Fill" Value="Transparent" /> <Setter Property="Fill" Value="Transparent" />
</Style> </Style>
<Style Selector="^ /template/ TextBlock#PART_Time"> <Style Selector="^ /template/ TextBlock#PART_Time">
<Setter Property="Foreground" Value="{DynamicResource TextBlockTertiaryForeground}"/> <Setter Property="Foreground" Value="{DynamicResource TextBlockTertiaryForeground}" />
</Style> </Style>
<Style Selector="^ /template/ ContentPresenter#PART_Content"> <Style Selector="^ /template/ ContentPresenter#PART_Content">
<Setter Property="TextElement.Foreground" Value="{DynamicResource TextBlockTertiaryForeground}"/> <Setter Property="TextElement.Foreground" Value="{DynamicResource TextBlockTertiaryForeground}" />
</Style> </Style>
<Style Selector="^:empty-icon /template/ Ellipse#PART_DefaultIcon"> <Style Selector="^:empty-icon /template/ Ellipse#PART_DefaultIcon">
<Setter Property="IsVisible" Value="True"/> <Setter Property="IsVisible" Value="True" />
</Style> </Style>
<Style Selector="^:empty-icon[Type=Default] /template/ Ellipse#PART_DefaultIcon"> <Style Selector="^:empty-icon[Type=Default] /template/ Ellipse#PART_DefaultIcon">
<Setter Property="Fill" Value="{DynamicResource SemiGrey6}"/> <Setter Property="Fill" Value="{DynamicResource SemiGrey6}" />
</Style> </Style>
<Style Selector="^:empty-icon[Type=Error] /template/ Ellipse#PART_DefaultIcon"> <Style Selector="^:empty-icon[Type=Error] /template/ Ellipse#PART_DefaultIcon">
<Setter Property="Fill" Value="{DynamicResource SemiRed6}"/> <Setter Property="Fill" Value="{DynamicResource SemiRed6}" />
</Style> </Style>
<Style Selector="^:empty-icon[Type=Ongoing] /template/ Ellipse#PART_DefaultIcon"> <Style Selector="^:empty-icon[Type=Ongoing] /template/ Ellipse#PART_DefaultIcon">
<Setter Property="Fill" Value="{DynamicResource SemiBlue6}"/> <Setter Property="Fill" Value="{DynamicResource SemiBlue6}" />
</Style> </Style>
<Style Selector="^:empty-icon[Type=Success] /template/ Ellipse#PART_DefaultIcon"> <Style Selector="^:empty-icon[Type=Success] /template/ Ellipse#PART_DefaultIcon">
<Setter Property="Fill" Value="{DynamicResource SemiGreen6}"/> <Setter Property="Fill" Value="{DynamicResource SemiGreen6}" />
</Style> </Style>
<Style Selector="^:empty-icon[Type=Warning] /template/ Ellipse#PART_DefaultIcon"> <Style Selector="^:empty-icon[Type=Warning] /template/ Ellipse#PART_DefaultIcon">
<Setter Property="Fill" Value="{DynamicResource SemiOrange6}"/> <Setter Property="Fill" Value="{DynamicResource SemiOrange6}" />
</Style> </Style>
<Style Selector="^:all-left"> <Style Selector="^:all-left">
<Style Selector="^ /template/ ContentPresenter#PART_Header"> <Style Selector="^ /template/ ContentPresenter#PART_Header">
@@ -198,4 +188,4 @@
</Style> </Style>
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="https://github.com/avaloniaui"
xmlns:u="https://irihi.tech/ursa"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<Design.PreviewWith> <Design.PreviewWith>
<ThemeVariantScope RequestedThemeVariant="Dark"> <ThemeVariantScope RequestedThemeVariant="Dark">
<ReversibleStackPanel> <ReversibleStackPanel>

View File

@@ -25,9 +25,9 @@
</Setter> </Setter>
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="{x:Type u:ToolBar}" TargetType="u:ToolBar"> <ControlTheme x:Key="{x:Type u:ToolBar}" TargetType="u:ToolBar">
<Setter Property="HorizontalAlignment" Value="Left"/> <Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top"/> <Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent" />
<Setter Property="ItemsPanel"> <Setter Property="ItemsPanel">
<ItemsPanelTemplate> <ItemsPanelTemplate>
<u:ToolBarPanel /> <u:ToolBarPanel />
@@ -136,4 +136,4 @@
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,10 +1,10 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls" xmlns:u="https://irihi.tech/ursa"
xmlns:converters1="clr-namespace:Ursa.Converters;assembly=Ursa"
xmlns:iri="https://irihi.tech/shared" xmlns:iri="https://irihi.tech/shared"
xmlns:u="https://irihi.tech/ursa"> xmlns:converters="using:Avalonia.Controls.Converters"
xmlns:converters1="using:Ursa.Converters">
<Design.PreviewWith> <Design.PreviewWith>
<StackPanel Height="300"> <StackPanel Height="300">
<u:TreeComboBox <u:TreeComboBox
@@ -316,4 +316,4 @@
<Setter Property="IsHitTestVisible" Value="False" /> <Setter Property="IsHitTestVisible" Value="False" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -34,4 +34,4 @@
<Setter Property="Stroke" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ActiveStrokeBrush}" /> <Setter Property="Stroke" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ActiveStrokeBrush}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -43,4 +43,4 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -13,7 +13,7 @@
<Setter Property="u:OverlayDialogHost.IsModalStatusScope" Value="True" /> <Setter Property="u:OverlayDialogHost.IsModalStatusScope" Value="True" />
<Setter Property="IsMinimizeButtonVisible" Value="{OnPlatform {x:True},macOS={x:False}}" /> <Setter Property="IsMinimizeButtonVisible" Value="{OnPlatform {x:True},macOS={x:False}}" />
<Setter Property="IsRestoreButtonVisible" Value="{OnPlatform {x:True},macOS={x:False}}" /> <Setter Property="IsRestoreButtonVisible" Value="{OnPlatform {x:True},macOS={x:False}}" />
<Setter Property="IsCloseButtonVisible" Value="{OnPlatform {x:True},macOS={x:False}}"/> <Setter Property="IsCloseButtonVisible" Value="{OnPlatform {x:True},macOS={x:False}}" />
<Setter Property="SystemDecorations"> <Setter Property="SystemDecorations">
<OnPlatform> <OnPlatform>
<On Options="Default"> <On Options="Default">
@@ -47,9 +47,9 @@
RightContent="{Binding $parent[u:UrsaWindow].RightContent}" /> RightContent="{Binding $parent[u:UrsaWindow].RightContent}" />
<VisualLayerManager> <VisualLayerManager>
<Panel> <Panel>
<u:OverlayDialogHost <u:OverlayDialogHost
Name="{x:Static u:UrsaWindow.PART_DialogHost}" Name="{x:Static u:UrsaWindow.PART_DialogHost}"
IsModalStatusReporter="True" IsModalStatusReporter="True"
IsTopLevel="True" /> IsTopLevel="True" />
<u:WindowResizer <u:WindowResizer
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"

View File

@@ -5,11 +5,11 @@
<ResourceInclude Source="Avatar.axaml" /> <ResourceInclude Source="Avatar.axaml" />
<ResourceInclude Source="Badge.axaml" /> <ResourceInclude Source="Badge.axaml" />
<ResourceInclude Source="Banner.axaml" /> <ResourceInclude Source="Banner.axaml" />
<ResourceInclude Source="ButtonGroup.axaml" />
<ResourceInclude Source="Breadcrumb.axaml" /> <ResourceInclude Source="Breadcrumb.axaml" />
<ResourceInclude Source="ButtonGroup.axaml" />
<ResourceInclude Source="Calendar.axaml" /> <ResourceInclude Source="Calendar.axaml" />
<ResourceInclude Source="ControlClassesInput.axaml" />
<ResourceInclude Source="Clock.axaml" /> <ResourceInclude Source="Clock.axaml" />
<ResourceInclude Source="ControlClassesInput.axaml" />
<ResourceInclude Source="DatePicker.axaml" /> <ResourceInclude Source="DatePicker.axaml" />
<ResourceInclude Source="DateRangePicker.axaml" /> <ResourceInclude Source="DateRangePicker.axaml" />
<ResourceInclude Source="DateTimePicker.axaml" /> <ResourceInclude Source="DateTimePicker.axaml" />
@@ -19,7 +19,6 @@
<ResourceInclude Source="Divider.axaml" /> <ResourceInclude Source="Divider.axaml" />
<ResourceInclude Source="Drawer.axaml" /> <ResourceInclude Source="Drawer.axaml" />
<ResourceInclude Source="DualBadge.axaml" /> <ResourceInclude Source="DualBadge.axaml" />
<ResourceInclude Source="ElasticWrapPanel.axaml" />
<ResourceInclude Source="EnumSelector.axaml" /> <ResourceInclude Source="EnumSelector.axaml" />
<ResourceInclude Source="Form.axaml" /> <ResourceInclude Source="Form.axaml" />
<ResourceInclude Source="IconButton.axaml" /> <ResourceInclude Source="IconButton.axaml" />
@@ -33,11 +32,11 @@
<ResourceInclude Source="MultiComboBox.axaml" /> <ResourceInclude Source="MultiComboBox.axaml" />
<ResourceInclude Source="NavMenu.axaml" /> <ResourceInclude Source="NavMenu.axaml" />
<ResourceInclude Source="Notification.axaml" /> <ResourceInclude Source="Notification.axaml" />
<ResourceInclude Source="NumberDisplayer.axaml" />
<ResourceInclude Source="NumericUpDown.axaml" /> <ResourceInclude Source="NumericUpDown.axaml" />
<ResourceInclude Source="NumPad.axaml" /> <ResourceInclude Source="NumPad.axaml" />
<ResourceInclude Source="NumberDisplayer.axaml" />
<ResourceInclude Source="Pagination.axaml" /> <ResourceInclude Source="Pagination.axaml" />
<ResourceInclude Source="PathPicker.axaml"/> <ResourceInclude Source="PathPicker.axaml" />
<ResourceInclude Source="PinCode.axaml" /> <ResourceInclude Source="PinCode.axaml" />
<ResourceInclude Source="PopConfirm.axaml" /> <ResourceInclude Source="PopConfirm.axaml" />
<ResourceInclude Source="RangeSlider.axaml" /> <ResourceInclude Source="RangeSlider.axaml" />
@@ -46,18 +45,18 @@
<ResourceInclude Source="ScrollToButton.axaml" /> <ResourceInclude Source="ScrollToButton.axaml" />
<ResourceInclude Source="SelectionList.axaml" /> <ResourceInclude Source="SelectionList.axaml" />
<ResourceInclude Source="Skeleton.axaml" /> <ResourceInclude Source="Skeleton.axaml" />
<ResourceInclude Source="SplashWindow.axaml"/> <ResourceInclude Source="SplashWindow.axaml" />
<ResourceInclude Source="TagInput.axaml" /> <ResourceInclude Source="TagInput.axaml" />
<ResourceInclude Source="ThemeSelector.axaml" /> <ResourceInclude Source="ThemeSelector.axaml" />
<ResourceInclude Source="TimeBox.axaml" />
<ResourceInclude Source="Timeline.axaml" />
<ResourceInclude Source="TimePicker.axaml" /> <ResourceInclude Source="TimePicker.axaml" />
<ResourceInclude Source="TimeRangePicker.axaml" /> <ResourceInclude Source="TimeRangePicker.axaml" />
<ResourceInclude Source="Timeline.axaml" />
<ResourceInclude Source="TreeComboBox.axaml"/>
<ResourceInclude Source="TwoTonePathIcon.axaml" />
<ResourceInclude Source="Toast.axaml" /> <ResourceInclude Source="Toast.axaml" />
<ResourceInclude Source="ToolBar.axaml" /> <ResourceInclude Source="ToolBar.axaml" />
<ResourceInclude Source="TimeBox.axaml"/> <ResourceInclude Source="TreeComboBox.axaml" />
<ResourceInclude Source="TwoTonePathIcon.axaml" />
<ResourceInclude Source="UrsaView.axaml" /> <ResourceInclude Source="UrsaView.axaml" />
<ResourceInclude Source="UrsaWindow.axaml"/> <ResourceInclude Source="UrsaWindow.axaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,21 +1,17 @@
using System.Globalization; using System.Globalization;
using Avalonia.Data.Converters; using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Themes.Semi.Converters; namespace Ursa.Themes.Semi.Converters;
public class BooleansToOpacityConverter: IValueConverter public class BooleansToOpacityConverter : MarkupValueConverter
{ {
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) public override object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{ {
if (value is bool b) if (value is bool b)
{ {
return b? 1.0: 0.0; return b ? 1.0 : 0.0;
} }
return 1; return 1;
} }
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
} }

View File

@@ -1,22 +1,18 @@
using System.Globalization; using System.Globalization;
using Avalonia.Data.Converters;
using Avalonia.Media; using Avalonia.Media;
using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Themes.Semi.Converters; namespace Ursa.Themes.Semi.Converters;
public class BrushToColorConverter: IValueConverter public class BrushToColorConverter : MarkupValueConverter
{ {
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) public override object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{ {
if (value is ISolidColorBrush b) if (value is ISolidColorBrush b)
{ {
return b.Color; return b.Color;
} }
return Colors.Transparent; return Colors.Transparent;
} }
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
} }

View File

@@ -1,25 +1,21 @@
using System.Globalization; using System.Globalization;
using Avalonia.Data.Converters; using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Themes.Semi.Converters; namespace Ursa.Themes.Semi.Converters;
public class ClockHandLengthConverter(double ratio) : IValueConverter public class ClockHandLengthConverter(double ratio) : MarkupValueConverter
{ {
public static ClockHandLengthConverter Hour { get; } = new(1-0.618); public static ClockHandLengthConverter Hour { get; } = new(1 - 0.618);
public static ClockHandLengthConverter Minute { get; } = new(0.618); public static ClockHandLengthConverter Minute { get; } = new(0.618);
public static ClockHandLengthConverter Second { get; } = new(1); public static ClockHandLengthConverter Second { get; } = new(1);
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{ {
if (value is double d) if (value is double d)
{ {
return d * ratio / 2; return d * ratio / 2;
} }
return 0.0; return 0.0;
} }
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
} }

View File

@@ -1,38 +0,0 @@
using System.Globalization;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Data.Converters;
namespace Ursa.Themes.Semi.Converters;
[Obsolete("This converter is deprecated. Use CornerRadiusMixerConverter instead.")]
public class CornerRadiusTakeConverter: IValueConverter
{
private readonly Dock _dock;
internal CornerRadiusTakeConverter(Dock dock)
{
_dock = dock;
}
public static CornerRadiusTakeConverter Left { get; } = new(Dock.Left);
public static CornerRadiusTakeConverter Top { get; } = new(Dock.Top);
public static CornerRadiusTakeConverter Right { get; } = new(Dock.Right);
public static CornerRadiusTakeConverter Bottom { get; } = new(Dock.Bottom);
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if(value is not CornerRadius c) return AvaloniaProperty.UnsetValue;
return _dock switch
{
Dock.Left => new CornerRadius(c.TopLeft, 0, 0, c.BottomLeft),
Dock.Top => new CornerRadius(c.TopLeft, c.TopRight, 0, 0),
Dock.Right => new CornerRadius(0, c.TopRight, c.BottomRight, 0),
Dock.Bottom => new CornerRadius(0, 0, c.BottomRight, c.BottomLeft),
_ => AvaloniaProperty.UnsetValue
};
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}

View File

@@ -1,11 +1,10 @@
using System.Globalization; using System.Globalization;
using Avalonia.Controls;
using Avalonia.Data.Converters;
using Avalonia.Layout; using Avalonia.Layout;
using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Themes.Semi.Converters; namespace Ursa.Themes.Semi.Converters;
public class FormContentHeightToAlignmentConverter: IValueConverter public class FormContentHeightToAlignmentConverter : MarkupValueConverter
{ {
public static FormContentHeightToAlignmentConverter Instance = new(32); public static FormContentHeightToAlignmentConverter Instance = new(32);
public double Threshold { get; set; } public double Threshold { get; set; }
@@ -14,23 +13,17 @@ public class FormContentHeightToAlignmentConverter: IValueConverter
{ {
Threshold = 32; Threshold = 32;
} }
// ReSharper disable once ConvertToPrimaryConstructor // ReSharper disable once ConvertToPrimaryConstructor
// Justification: need to keep the default constructor for XAML // Justification: need to keep the default constructor for XAML
public FormContentHeightToAlignmentConverter(double threshold) public FormContentHeightToAlignmentConverter(double threshold)
{ {
Threshold = threshold; Threshold = threshold;
} }
public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{ {
if(value is not double d) return VerticalAlignment.Center; if (value is not double d) return VerticalAlignment.Center;
return d > Threshold ? VerticalAlignment.Top : VerticalAlignment.Center; return d > Threshold ? VerticalAlignment.Top : VerticalAlignment.Center;
} }
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
} }

View File

@@ -1,10 +1,10 @@
using System.Globalization; using System.Globalization;
using Avalonia; using Avalonia;
using Avalonia.Data.Converters; using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Themes.Semi.Converters; namespace Ursa.Themes.Semi.Converters;
public class FormContentHeightToMarginConverter: IValueConverter public class FormContentHeightToMarginConverter : MarkupValueConverter
{ {
public static FormContentHeightToMarginConverter Instance = new(); public static FormContentHeightToMarginConverter Instance = new();
public double Threshold { get; set; } public double Threshold { get; set; }
@@ -13,22 +13,17 @@ public class FormContentHeightToMarginConverter: IValueConverter
{ {
Threshold = 32; Threshold = 32;
} }
// ReSharper disable once ConvertToPrimaryConstructor // ReSharper disable once ConvertToPrimaryConstructor
// Justification: need to keep the default constructor for XAML // Justification: need to keep the default constructor for XAML
public FormContentHeightToMarginConverter(double threshold) public FormContentHeightToMarginConverter(double threshold)
{ {
Threshold = threshold; Threshold = threshold;
} }
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{ {
if(value is not double d) return new Thickness(0); if (value is not double d) return new Thickness(0);
return d > Threshold ? new Thickness(0, 8, 8, 0) : new Thickness(0, 0, 8, 0); return d > Threshold ? new Thickness(0, 8, 8, 0) : new Thickness(0, 0, 8, 0);
} }
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
} }

View File

@@ -1,17 +1,18 @@
using System.Globalization; using System.Globalization;
using Avalonia; using Avalonia;
using Avalonia.Data.Converters; using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Themes.Semi.Converters; namespace Ursa.Themes.Semi.Converters;
public class NavMenuMarginConverter: IMultiValueConverter public class NavMenuMarginConverter : MarkupMultiValueConverter
{ {
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture) public override object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
{ {
if (values[0] is double indent && values[1] is int level && values[2] is bool b) if (values[0] is double indent && values[1] is int level && values[2] is bool b)
{ {
return b ? new Thickness() : new Thickness(indent * (level-1), 0, 0, 0); return b ? new Thickness() : new Thickness(indent * (level - 1), 0, 0, 0);
} }
return AvaloniaProperty.UnsetValue; return AvaloniaProperty.UnsetValue;
} }
} }

View File

@@ -1,37 +0,0 @@
using System.Globalization;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Data.Converters;
namespace Ursa.Themes.Semi.Converters;
[Obsolete("This converter is deprecated. Use ThicknessMixerConverter instead.")]
public class ThicknessTakeConverter: IValueConverter
{
private readonly Dock _dock;
internal ThicknessTakeConverter(Dock dock)
{
_dock = dock;
}
public static ThicknessTakeConverter Left { get; } = new(Dock.Left);
public static ThicknessTakeConverter Top { get; } = new(Dock.Top);
public static ThicknessTakeConverter Right { get; } = new(Dock.Right);
public static ThicknessTakeConverter Bottom { get; } = new(Dock.Bottom);
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is not Thickness t) return AvaloniaProperty.UnsetValue;
return _dock switch
{
Dock.Left => new Thickness(t.Left, 0, 0, 0),
Dock.Top => new Thickness(0, t.Top, 0, 0),
Dock.Right => new Thickness(0, 0, t.Right, 0),
Dock.Bottom => new Thickness(0, 0, 0, t.Bottom),
_ => AvaloniaProperty.UnsetValue
};
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}

View File

@@ -1,81 +0,0 @@
using System.Globalization;
using Avalonia;
using Avalonia.Data.Converters;
using Avalonia.Media;
using Ursa.Controls;
namespace Ursa.Themes.Semi.Converters;
public class TimelineItemTypeToIconForegroundConverter: AvaloniaObject, IMultiValueConverter
{
public static readonly StyledProperty<IBrush> DefaultBrushProperty = AvaloniaProperty.Register<TimelineItemTypeToIconForegroundConverter, IBrush>(
nameof(DefaultBrush));
public IBrush DefaultBrush
{
get => GetValue(DefaultBrushProperty);
set => SetValue(DefaultBrushProperty, value);
}
public static readonly StyledProperty<IBrush> OngoingBrushProperty = AvaloniaProperty.Register<TimelineItemTypeToIconForegroundConverter, IBrush>(
nameof(OngoingBrush));
public IBrush OngoingBrush
{
get => GetValue(OngoingBrushProperty);
set => SetValue(OngoingBrushProperty, value);
}
public static readonly StyledProperty<IBrush> SuccessBrushProperty = AvaloniaProperty.Register<TimelineItemTypeToIconForegroundConverter, IBrush>(
nameof(SuccessBrush));
public IBrush SuccessBrush
{
get => GetValue(SuccessBrushProperty);
set => SetValue(SuccessBrushProperty, value);
}
public static readonly StyledProperty<IBrush> WarningBrushProperty = AvaloniaProperty.Register<TimelineItemTypeToIconForegroundConverter, IBrush>(
nameof(WarningBrush));
public IBrush WarningBrush
{
get => GetValue(WarningBrushProperty);
set => SetValue(WarningBrushProperty, value);
}
public static readonly StyledProperty<IBrush> ErrorBrushProperty = AvaloniaProperty.Register<TimelineItemTypeToIconForegroundConverter, IBrush>(
nameof(ErrorBrush));
public IBrush ErrorBrush
{
get => GetValue(ErrorBrushProperty);
set => SetValue(ErrorBrushProperty, value);
}
public object Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
{
if (values[0] is TimelineItemType type)
{
switch (type)
{
case TimelineItemType.Error:
return ErrorBrush;
case TimelineItemType.Warning:
return WarningBrush;
case TimelineItemType.Success:
return SuccessBrush;
case TimelineItemType.Ongoing:
return OngoingBrush;
case TimelineItemType.Default:
if (values[1] is IBrush brush)
{
return brush;
}
return DefaultBrush;
}
}
return AvaloniaProperty.UnsetValue;
}
}

View File

@@ -1,12 +1,12 @@
using System.Globalization; using System.Globalization;
using Avalonia; using Avalonia;
using Avalonia.Data.Converters; using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Themes.Semi.Converters; namespace Ursa.Themes.Semi.Converters;
public class TreeLevelToPaddingConverter : IMultiValueConverter public class TreeLevelToPaddingConverter : MarkupMultiValueConverter
{ {
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture) public override object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
{ {
if (values[0] is int i && values[1] is Thickness indent) if (values[0] is int i && values[1] is Thickness indent)
{ {

View File

@@ -1,9 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StaticResource x:Key="TimelineHeaderForeground" ResourceKey="SemiColorText0" /> <StaticResource x:Key="TimelineHeaderForeground" ResourceKey="SemiColorText0" />
<StaticResource x:Key="DefaultTimelineIconForeground" ResourceKey="SemiColorFill2" />
<StaticResource x:Key="OngoingTimelineIconForeground" ResourceKey="SemiColorPrimary" />
<StaticResource x:Key="SuccessTimelineIconForeground" ResourceKey="SemiColorSuccess" />
<StaticResource x:Key="WarningTimelineIconForeground" ResourceKey="SemiColorWarning" />
<StaticResource x:Key="ErrorTimelineIconForeground" ResourceKey="SemiColorDanger" />
<StaticResource x:Key="TimelineLineBrush" ResourceKey="SemiColorFill2" /> <StaticResource x:Key="TimelineLineBrush" ResourceKey="SemiColorFill2" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,7 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="Avatar.axaml" />
<ResourceInclude Source="Anchor.axaml" /> <ResourceInclude Source="Anchor.axaml" />
<ResourceInclude Source="Avatar.axaml" />
<ResourceInclude Source="Badge.axaml" /> <ResourceInclude Source="Badge.axaml" />
<ResourceInclude Source="Banner.axaml" /> <ResourceInclude Source="Banner.axaml" />
<ResourceInclude Source="Breadcrumb.axaml" /> <ResourceInclude Source="Breadcrumb.axaml" />

View File

@@ -1,9 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StaticResource x:Key="TimelineHeaderForeground" ResourceKey="SemiColorText0" /> <StaticResource x:Key="TimelineHeaderForeground" ResourceKey="SemiColorText0" />
<StaticResource x:Key="DefaultTimelineIconForeground" ResourceKey="SemiColorFill2" />
<StaticResource x:Key="OngoingTimelineIconForeground" ResourceKey="SemiColorPrimary" />
<StaticResource x:Key="SuccessTimelineIconForeground" ResourceKey="SemiColorSuccess" />
<StaticResource x:Key="WarningTimelineIconForeground" ResourceKey="SemiColorWarning" />
<StaticResource x:Key="ErrorTimelineIconForeground" ResourceKey="SemiColorDanger" />
<StaticResource x:Key="TimelineLineBrush" ResourceKey="SemiColorFill2" /> <StaticResource x:Key="TimelineLineBrush" ResourceKey="SemiColorFill2" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,7 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="Avatar.axaml" />
<ResourceInclude Source="Anchor.axaml" /> <ResourceInclude Source="Anchor.axaml" />
<ResourceInclude Source="Avatar.axaml" />
<ResourceInclude Source="Badge.axaml" /> <ResourceInclude Source="Badge.axaml" />
<ResourceInclude Source="Banner.axaml" /> <ResourceInclude Source="Banner.axaml" />
<ResourceInclude Source="Breadcrumb.axaml" /> <ResourceInclude Source="Breadcrumb.axaml" />

View File

@@ -1,7 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="Avatar.axaml" />
<ResourceInclude Source="Anchor.axaml" /> <ResourceInclude Source="Anchor.axaml" />
<ResourceInclude Source="Avatar.axaml" />
<ResourceInclude Source="Badge.axaml" /> <ResourceInclude Source="Badge.axaml" />
<ResourceInclude Source="Banner.axaml" /> <ResourceInclude Source="Banner.axaml" />
<ResourceInclude Source="ButtonGroup.axaml" /> <ResourceInclude Source="ButtonGroup.axaml" />

View File

@@ -1,11 +1,11 @@
using System.Globalization; using System.Globalization;
using Avalonia.Data.Converters; using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Converters; namespace Ursa.Converters;
public class BadgeContentOverflowConverter : IMultiValueConverter public class BadgeContentOverflowConverter : MarkupMultiValueConverter
{ {
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture) public override object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
{ {
var overflowMark = parameter as string ?? "+"; var overflowMark = parameter as string ?? "+";
if (double.TryParse(values[0]?.ToString(), out var b) && values[1] is int count and > 0) if (double.TryParse(values[0]?.ToString(), out var b) && values[1] is int count and > 0)

View File

@@ -1,87 +0,0 @@
using System.Globalization;
using Avalonia;
using Avalonia.Data.Converters;
namespace Ursa.Converters;
[Obsolete("This converter is deprecated. Use CornerRadiusMixerConverter instead.")]
[Flags]
public enum CornerRadiusPosition
{
TopLeft = 1,
TopRight = 2,
BottomLeft = 4,
BottomRight = 8,
Top = 3,
Left = 5,
Right = 10,
Bottom = 12,
}
[Obsolete("This converter is deprecated. Use CornerRadiusMixerConverter instead.")]
public class CornerRadiusIncludeConverter(CornerRadiusPosition position) : IValueConverter
{
public static CornerRadiusIncludeConverter TopLeft { get; } = new( CornerRadiusPosition.TopLeft );
public static CornerRadiusIncludeConverter TopRight { get; } = new( CornerRadiusPosition.TopRight );
public static CornerRadiusIncludeConverter BottomLeft { get; } = new( CornerRadiusPosition.BottomLeft );
public static CornerRadiusIncludeConverter BottomRight { get; } = new( CornerRadiusPosition.BottomRight );
public static CornerRadiusIncludeConverter Top { get; } = new( CornerRadiusPosition.Top );
public static CornerRadiusIncludeConverter Left { get; } = new( CornerRadiusPosition.Left );
public static CornerRadiusIncludeConverter Right { get; } = new( CornerRadiusPosition.Right );
public static CornerRadiusIncludeConverter Bottom { get; } = new( CornerRadiusPosition.Bottom );
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is CornerRadius r)
{
double topLeft = position.HasFlag(CornerRadiusPosition.TopLeft) ? r.TopLeft : 0;
double topRight = position.HasFlag(CornerRadiusPosition.TopRight) ? r.TopRight : 0;
double bottomLeft = position.HasFlag(CornerRadiusPosition.BottomLeft) ? r.BottomLeft : 0;
double bottomRight = position.HasFlag(CornerRadiusPosition.BottomRight) ? r.BottomRight : 0;
return new CornerRadius(topLeft, topRight, bottomRight, bottomLeft);
}
return AvaloniaProperty.UnsetValue;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
[Obsolete("This converter is deprecated. Use CornerRadiusMixerConverter instead.")]
public class CornerRadiusExcludeConverter : IValueConverter
{
public static CornerRadiusExcludeConverter TopLeft { get; } = new( CornerRadiusPosition.TopLeft );
public static CornerRadiusExcludeConverter TopRight { get; } = new( CornerRadiusPosition.TopRight );
public static CornerRadiusExcludeConverter BottomLeft { get; } = new( CornerRadiusPosition.BottomLeft );
public static CornerRadiusExcludeConverter BottomRight { get; } = new( CornerRadiusPosition.BottomRight );
public static CornerRadiusExcludeConverter Top { get; } = new( CornerRadiusPosition.Top );
public static CornerRadiusExcludeConverter Left { get; } = new( CornerRadiusPosition.Left );
public static CornerRadiusExcludeConverter Right { get; } = new( CornerRadiusPosition.Right );
public static CornerRadiusExcludeConverter Bottom { get; } = new( CornerRadiusPosition.Bottom );
private readonly CornerRadiusPosition _position;
public CornerRadiusExcludeConverter(CornerRadiusPosition position)
{
_position = position;
}
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is CornerRadius r)
{
double topLeft = _position.HasFlag(CornerRadiusPosition.TopLeft) ? 0 : r.TopLeft;
double topRight = _position.HasFlag(CornerRadiusPosition.TopRight) ? 0 : r.TopRight;
double bottomLeft = _position.HasFlag(CornerRadiusPosition.BottomLeft) ? 0 : r.BottomLeft;
double bottomRight = _position.HasFlag(CornerRadiusPosition.BottomRight) ? 0 : r.BottomRight;
return new CornerRadius(topLeft, topRight, bottomRight, bottomLeft);
}
return AvaloniaProperty.UnsetValue;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}

View File

@@ -1,19 +1,20 @@
using System.Globalization; using System.Globalization;
using Avalonia.Controls.Templates; using Avalonia.Controls.Templates;
using Avalonia.Data.Converters; using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Converters; namespace Ursa.Converters;
public class SelectionBoxTemplateConverter: IMultiValueConverter public class SelectionBoxTemplateConverter : MarkupMultiValueConverter
{ {
public static SelectionBoxTemplateConverter Instance { get; } = new(); public static SelectionBoxTemplateConverter Instance { get; } = new();
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture) public override object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
{ {
for (int i = 0; i < values.Count; i++) for (int i = 0; i < values.Count; i++)
{ {
if (values[i] is IDataTemplate template) return template; if (values[i] is IDataTemplate template) return template;
} }
return null; return null;
} }
} }

View File

@@ -1,82 +0,0 @@
using System.Globalization;
using Avalonia;
using Avalonia.Data.Converters;
namespace Ursa.Converters;
[Obsolete("This converter is deprecated. Use ThicknessMixerConverter instead.")]
[Flags]
public enum ThicknessPosition
{
Left = 1,
Top = 2,
Right = 4,
Bottom = 8,
TopLeft = 3,
TopRight = 6,
BottomLeft = 9,
BottomRight = 12,
}
[Obsolete("This converter is deprecated. Use ThicknessMixerConverter instead.")]
public class ThicknessExcludeConverter(ThicknessPosition position) : IValueConverter
{
public static ThicknessExcludeConverter Left { get; } = new( ThicknessPosition.Left );
public static ThicknessExcludeConverter Top { get; } = new( ThicknessPosition.Top );
public static ThicknessExcludeConverter Right { get; } = new( ThicknessPosition.Right );
public static ThicknessExcludeConverter Bottom { get; } = new( ThicknessPosition.Bottom );
public static ThicknessExcludeConverter TopLeft { get; } = new( ThicknessPosition.TopLeft );
public static ThicknessExcludeConverter TopRight { get; } = new( ThicknessPosition.TopRight );
public static ThicknessExcludeConverter BottomLeft { get; } = new( ThicknessPosition.BottomLeft );
public static ThicknessExcludeConverter BottomRight { get; } = new( ThicknessPosition.BottomRight );
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is Thickness t)
{
double left = position.HasFlag(ThicknessPosition.Left) ? 0d: t.Left;
double top = position.HasFlag(ThicknessPosition.Top) ? 0d : t.Top;
double right = position.HasFlag(ThicknessPosition.Right) ? 0d : t.Right;
double bottom = position.HasFlag(ThicknessPosition.Bottom) ? 0d : t.Bottom;
return new Thickness(left, top, right, bottom);
}
return AvaloniaProperty.UnsetValue;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
[Obsolete("This converter is deprecated. Use ThicknessMixerConverter instead.")]
public class ThicknessIncludeConverter(ThicknessPosition position) : IValueConverter
{
public static ThicknessIncludeConverter Left { get; } = new( ThicknessPosition.Left );
public static ThicknessIncludeConverter Top { get; } = new( ThicknessPosition.Top );
public static ThicknessIncludeConverter Right { get; } = new( ThicknessPosition.Right );
public static ThicknessIncludeConverter Bottom { get; } = new( ThicknessPosition.Bottom );
public static ThicknessIncludeConverter TopLeft { get; } = new( ThicknessPosition.TopLeft );
public static ThicknessIncludeConverter TopRight { get; } = new( ThicknessPosition.TopRight );
public static ThicknessIncludeConverter BottomLeft { get; } = new( ThicknessPosition.BottomLeft );
public static ThicknessIncludeConverter BottomRight { get; } = new( ThicknessPosition.BottomRight );
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is Thickness t)
{
var left = position.HasFlag(ThicknessPosition.Left) ? t.Left : 0d;
var top = position.HasFlag(ThicknessPosition.Top) ? t.Top : 0d;
var right = position.HasFlag(ThicknessPosition.Right) ? t.Right : 0d;
var bottom = position.HasFlag(ThicknessPosition.Bottom) ? t.Bottom : 0d;
return new Thickness(left, top, right, bottom);
}
return AvaloniaProperty.UnsetValue;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}

View File

@@ -15,7 +15,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)"/> <PackageReference Include="Avalonia" Version="$(AvaloniaVersion)"/>
<PackageReference Include="Irihi.Avalonia.Shared" Version="0.3.0" /> <PackageReference Include="Irihi.Avalonia.Shared" Version="0.3.1" />
<PackageReference Include="Irihi.Avalonia.Shared.Contracts" Version="0.3.0" /> <PackageReference Include="Irihi.Avalonia.Shared.Contracts" Version="0.3.1" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:u="https://irihi.tech/ursa" xmlns:u="https://irihi.tech/ursa"
xmlns:helpers="clr-namespace:Irihi.Avalonia.Shared.Helpers;assembly=Irihi.Avalonia.Shared" xmlns:iri="https://irihi.tech/shared"
mc:Ignorable="d" d:DesignWidth="800" mc:Ignorable="d" d:DesignWidth="800"
d:DesignHeight="450" d:DesignHeight="450"
x:Class="HeadlessTest.Ursa.Controls.DialogTests.StyleClassTests.TestWindow" x:Class="HeadlessTest.Ursa.Controls.DialogTests.StyleClassTests.TestWindow"
@@ -16,7 +16,7 @@
</Style> </Style>
<Style Selector="u|DefaultDialogControl.Custom2"> <Style Selector="u|DefaultDialogControl.Custom2">
<Style Selector="^ /template/ Button#PART_OKButton"> <Style Selector="^ /template/ Button#PART_OKButton">
<Setter Property="helpers:ClassHelper.Classes" Value="Warning Small" /> <Setter Property="iri:ClassHelper.Classes" Value="Warning Small" />
</Style> </Style>
</Style> </Style>
</u:UrsaWindow.Styles> </u:UrsaWindow.Styles>