Skip to content

Commit

Permalink
Merge pull request #488 from irihitech/semi
Browse files Browse the repository at this point in the history
Upgrade Ursa-Semi theme to utilize Semi Design 11.2.1 latest design
  • Loading branch information
zdpcdt authored Nov 16, 2024
2 parents 1e1ebb0 + 983c6c3 commit b58fc7f
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 26 deletions.
1 change: 1 addition & 0 deletions demo/Ursa.Demo/Pages/DialogDemo.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
<Grid Grid.Column="1">
<Border
BorderBrush="{DynamicResource SemiGrey1}"
Background="{DynamicResource SemiColorBackground1}"
BorderThickness="1"
ClipToBounds="True"
CornerRadius="12">
Expand Down
1 change: 1 addition & 0 deletions demo/Ursa.Demo/Pages/DrawerDemo.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<Grid Grid.Column="1" ClipToBounds="True">
<Border
BorderBrush="{DynamicResource SemiGrey1}"
Background="{DynamicResource SemiColorBackground1}"
BorderThickness="1"
ClipToBounds="True"
CornerRadius="20">
Expand Down
2 changes: 1 addition & 1 deletion src/Ursa.Themes.Semi/Controls/DatePicker.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
Placement="BottomEdgeAlignedLeft"
PlacementTarget="{TemplateBinding}">
<Border
Margin="8"
Margin="{DynamicResource ComboBoxPopupBorderMargin}"
Padding="8"
Background="{DynamicResource ComboBoxPopupBackground}"
BorderBrush="{DynamicResource ComboBoxPopupBorderBrush}"
Expand Down
2 changes: 1 addition & 1 deletion src/Ursa.Themes.Semi/Controls/DateRangePicker.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
Placement="BottomEdgeAlignedLeft"
PlacementTarget="Background">
<Border
Margin="8"
Margin="{DynamicResource ComboBoxPopupBorderMargin}"
Padding="8"
HorizontalAlignment="Stretch"
Background="{DynamicResource ComboBoxPopupBackground}"
Expand Down
2 changes: 1 addition & 1 deletion src/Ursa.Themes.Semi/Controls/DateTimePicker.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
Placement="BottomEdgeAlignedLeft"
PlacementTarget="{TemplateBinding}">
<Border
Margin="8"
Margin="{DynamicResource ComboBoxPopupBorderMargin}"
Padding="8"
Background="{DynamicResource ComboBoxPopupBackground}"
BorderBrush="{DynamicResource ComboBoxPopupBorderBrush}"
Expand Down
6 changes: 4 additions & 2 deletions src/Ursa.Themes.Semi/Controls/Dialog.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Classes="Shadow"
ClipToBounds="False"
Background="{DynamicResource SemiColorBackground2}"
CornerRadius="{TemplateBinding CornerRadius}"
Focusable="True"
IsHitTestVisible="True"
Expand Down Expand Up @@ -162,6 +163,7 @@
VerticalAlignment="{TemplateBinding VerticalAlignment}"
BoxShadow="0 0 8 0 #1A000000"
Classes="Shadow"
Background="{DynamicResource SemiColorBackground2}"
ClipToBounds="False"
CornerRadius="{TemplateBinding CornerRadius}"
Focusable="True"
Expand Down Expand Up @@ -463,7 +465,7 @@

<ControlTheme x:Key="{x:Type u:DialogWindow}" TargetType="u:DialogWindow">
<Setter Property="Title" Value="{x:Null}" />
<Setter Property="Background" Value="{DynamicResource BorderCardBackground}" />
<Setter Property="Background" Value="{DynamicResource SemiColorBackground2}" />
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource WindowDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource WindowDefaultForeground}" />
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
Expand Down Expand Up @@ -535,7 +537,7 @@

<ControlTheme x:Key="{x:Type u:DefaultDialogWindow}" TargetType="u:DefaultDialogWindow">
<Setter Property="Title" Value="{x:Null}" />
<Setter Property="Background" Value="{DynamicResource BorderCardBackground}" />
<Setter Property="Background" Value="{DynamicResource SemiColorBackground2}" />
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource WindowDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource WindowDefaultForeground}" />
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
Expand Down
2 changes: 2 additions & 0 deletions src/Ursa.Themes.Semi/Controls/Drawer.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Name="PART_Root"
Margin="{TemplateBinding Padding,
Converter={x:Static c:ThicknessTakeConverter.Left}}"
Background="{DynamicResource SemiColorBackground2}"
Padding="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Expand Down Expand Up @@ -111,6 +112,7 @@
Name="PART_Root"
Margin="{TemplateBinding Padding,
Converter={x:Static c:ThicknessTakeConverter.Left}}"
Background="{DynamicResource SemiColorBackground2}"
Padding="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Expand Down
3 changes: 2 additions & 1 deletion src/Ursa.Themes.Semi/Controls/MessageBox.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:MessageBoxWindow}" TargetType="u:MessageBoxWindow">
<Setter Property="Title" Value="{x:Null}" />
<Setter Property="Background" Value="{DynamicResource BorderCardBackground}" />
<Setter Property="Background" Value="{DynamicResource SemiColorBackground2}" />
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource WindowDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource WindowDefaultForeground}" />
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
Expand Down Expand Up @@ -178,6 +178,7 @@
VerticalAlignment="Center"
Classes="Shadow"
ClipToBounds="False"
Background="{DynamicResource SemiColorBackground2}"
CornerRadius="{TemplateBinding CornerRadius}"
IsHitTestVisible="True"
Theme="{DynamicResource CardBorder}">
Expand Down
19 changes: 7 additions & 12 deletions src/Ursa.Themes.Semi/Controls/MultiComboBox.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,12 @@
IsOpen="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsDropDownOpen, Mode=TwoWay}"
PlacementTarget="PART_RootGrid">
<Border
Margin="0,4"
Margin="{DynamicResource ComboBoxPopupBorderMargin}"
HorizontalAlignment="Stretch"
Background="{DynamicResource ComboBoxPopupBackground}"
BorderBrush="{DynamicResource ComboBoxPopupBorderBrush}"
BorderThickness="{DynamicResource ComboBoxPopupBorderThickness}"
BoxShadow="{DynamicResource ComboBoxPopupBoxShadow}"
ClipToBounds="True"
CornerRadius="6">
<DockPanel LastChildFill="True">
<ContentPresenter Content="{TemplateBinding PopupInnerTopContent}" DockPanel.Dock="Top"/>
Expand Down Expand Up @@ -217,12 +216,8 @@
<Setter Property="Cursor" Value="Hand" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource ListBoxItemCheckFontSize}" />
<Setter Property="CornerRadius" Value="{DynamicResource ListBoxItemCheckBoxCornerRadius}" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="Foreground" Value="{DynamicResource ListBoxItemCheckForeground}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="{DynamicResource ListBoxItemCheckDefaultBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackground}" />
<Setter Property="Template">
<ControlTemplate TargetType="u:MultiComboBoxItem">
<Border
Expand All @@ -235,11 +230,11 @@
<PathIcon
Name="CheckGlyph"
Grid.Column="0"
Width="{DynamicResource ListBoxItemCheckBoxGlyphWidth}"
Height="{DynamicResource ListBoxItemCheckBoxGlyphHeight}"
Width="{DynamicResource CheckBoxBoxGlyphWidth}"
Height="{DynamicResource CheckBoxBoxGlyphHeight}"
Margin="8,0"
VerticalAlignment="Center"
Data="{DynamicResource ListBoxItemCheckCheckGlyph}"
Data="{DynamicResource CheckBoxCheckGlyph}"
Opacity="0" />
<ContentPresenter
x:Name="ContentPresenter"
Expand Down Expand Up @@ -268,13 +263,13 @@
<!-- Pointerover State -->
<Style Selector="^:pointerover">
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemPointeroverForeground}" />
<Setter Property="Background" Value="{DynamicResource ListBoxItemPointeroverBackground}" />
<Setter Property="Background" Value="{DynamicResource ComboBoxItemPointeroverBackground}" />
</Style>

<!-- Pressed State -->
<Style Selector="^:pressed">
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemPressedForeground}" />
<Setter Property="Background" Value="{DynamicResource ListBoxItemPressedBackground}" />
<Setter Property="Background" Value="{DynamicResource ComboBoxItemPressedBackground}" />
</Style>

<!-- Selected State -->
Expand Down
3 changes: 1 addition & 2 deletions src/Ursa.Themes.Semi/Controls/TimePicker.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,12 @@
Placement="BottomEdgeAlignedLeft"
PlacementTarget="Background">
<Border
Margin="0,4"
Margin="{DynamicResource ComboBoxPopupBorderMargin}"
HorizontalAlignment="Stretch"
Background="{DynamicResource ComboBoxPopupBackground}"
BorderBrush="{DynamicResource ComboBoxPopupBorderBrush}"
BorderThickness="{DynamicResource ComboBoxPopupBorderThickness}"
BoxShadow="{DynamicResource ComboBoxPopupBoxShadow}"
ClipToBounds="True"
CornerRadius="6">
<DockPanel>
<StackPanel DockPanel.Dock="Bottom" IsVisible="{TemplateBinding NeedConfirmation}">
Expand Down
3 changes: 1 addition & 2 deletions src/Ursa.Themes.Semi/Controls/TimeRangePicker.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,12 @@
Placement="BottomEdgeAlignedLeft"
PlacementTarget="Background">
<Border
Margin="0,4"
Margin="{DynamicResource ComboBoxPopupBorderMargin}"
HorizontalAlignment="Stretch"
Background="{DynamicResource ComboBoxPopupBackground}"
BorderBrush="{DynamicResource ComboBoxPopupBorderBrush}"
BorderThickness="{DynamicResource ComboBoxPopupBorderThickness}"
BoxShadow="{DynamicResource ComboBoxPopupBoxShadow}"
ClipToBounds="True"
CornerRadius="6">
<DockPanel>
<StackPanel DockPanel.Dock="Bottom" IsVisible="{TemplateBinding NeedConfirmation}">
Expand Down
3 changes: 1 addition & 2 deletions src/Ursa.Themes.Semi/Controls/TreeComboBox.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,11 @@
WindowManagerAddShadowHint="False">
<Border
Name="PopupBorder"
Margin="0,4"
Margin="{DynamicResource ComboBoxPopupBorderMargin}"
Background="{DynamicResource ComboBoxPopupBackground}"
BorderBrush="{DynamicResource ComboBoxPopupBorderBrush}"
BorderThickness="{DynamicResource ComboBoxPopupBorderThickness}"
BoxShadow="{DynamicResource ComboBoxPopupBoxShadow}"
ClipToBounds="True"
CornerRadius="6">
<DockPanel LastChildFill="True">
<ContentPresenter
Expand Down
2 changes: 1 addition & 1 deletion src/Ursa.Themes.Semi/Themes/Dark/Dialog.axaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="OverlayDialogMaskBrush" Color="#FFA7ABB0" Opacity="0.2" />
<SolidColorBrush x:Key="OverlayDialogMaskBrush" Color="#FF16161A" Opacity="0.6" />
</ResourceDictionary>
2 changes: 1 addition & 1 deletion src/Ursa.Themes.Semi/Themes/Light/Dialog.axaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="OverlayDialogMaskBrush" Color="#FF555B61" Opacity="0.2" />
<SolidColorBrush x:Key="OverlayDialogMaskBrush" Color="#FF16161A" Opacity="0.6" />
</ResourceDictionary>
2 changes: 2 additions & 0 deletions src/Ursa.Themes.Semi/Themes/Shared/_index.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@
<ResourceInclude Source="Toast.axaml" />
<ResourceInclude Source="ToolBar.axaml" />
</ResourceDictionary.MergedDictionaries>
<!-- This resource definition is from Semi Avalonia 11.2.1. This can be removed after Ursa dependency is higher than Avalonia 11.2.1 -->
<Thickness x:Key="ComboBoxPopupBorderMargin">4</Thickness>
</ResourceDictionary>

0 comments on commit b58fc7f

Please sign in to comment.