feat: extract Semi Resources.

This commit is contained in:
Zhang Dian
2024-10-16 20:39:51 +08:00
parent ec1028fcc8
commit 41b11bba44
27 changed files with 146 additions and 64 deletions

View File

@@ -31,7 +31,7 @@
VerticalAlignment="Center"
Content="{TemplateBinding Icon}"
ContentTemplate="{TemplateBinding IconTemplate}"
Foreground="{DynamicResource SemiColorText2}"
Foreground="{DynamicResource BreadcrumbItemForeground}"
IsVisible="{TemplateBinding Icon,
Converter={x:Static ObjectConverters.IsNotNull}}" />
<ContentPresenter
@@ -39,14 +39,14 @@
VerticalAlignment="Center"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Foreground="{DynamicResource SemiColorText2}"
Foreground="{DynamicResource BreadcrumbItemForeground}"
IsVisible="{TemplateBinding Content,
Converter={x:Static ObjectConverters.IsNotNull}}" />
<ContentPresenter
Name="Separator"
VerticalAlignment="Center"
Content="{TemplateBinding Separator}"
Foreground="{DynamicResource SemiColorText3}">
Foreground="{DynamicResource BreadcrumbItemSeparatorForeground}">
<ContentPresenter.IsVisible>
<TemplateBinding Converter="{x:Static ObjectConverters.IsNotNull}" Property="Separator" />
</ContentPresenter.IsVisible>
@@ -66,10 +66,10 @@
</Style>
<Style Selector="^:last">
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
<Setter Property="Foreground" Value="{DynamicResource SemiColorText0}" />
<Setter Property="Foreground" Value="{DynamicResource BreadcrumbItemLastForeground}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource SemiColorText0}" />
<Setter Property="Foreground" Value="{DynamicResource BreadcrumbItemLastForeground}" />
<Setter Property="FontWeight" Value="{DynamicResource TextBlockTitleFontWeight}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#Separator">
@@ -77,19 +77,19 @@
</Style>
<Style Selector="^[IsReadOnly=False]:pointerover">
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
<Setter Property="Foreground" Value="{DynamicResource SemiBlue5}" />
<Setter Property="Foreground" Value="{DynamicResource BreadcrumbItemPointeroverForeground}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource SemiBlue5}" />
<Setter Property="Foreground" Value="{DynamicResource BreadcrumbItemPointeroverForeground}" />
</Style>
</Style>
</Style>
<Style Selector="^[IsReadOnly=False]:pointerover">
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
<Setter Property="Foreground" Value="{DynamicResource SemiBlue5}" />
<Setter Property="Foreground" Value="{DynamicResource BreadcrumbItemPointeroverForeground}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource SemiBlue5}" />
<Setter Property="Foreground" Value="{DynamicResource BreadcrumbItemPointeroverForeground}" />
</Style>
</Style>
</ControlTheme>

View File

@@ -5,7 +5,7 @@
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:Clock}" TargetType="u:Clock">
<Setter Property="HandBrush" Value="{DynamicResource SemiGrey6}"/>
<Setter Property="HandBrush" Value="{DynamicResource ClockHandBrush}"/>
<Setter Property="Template">
<ControlTemplate TargetType="u:Clock">
<Grid>
@@ -13,8 +13,8 @@
ShowHourTicks="{TemplateBinding ShowHourTicks}"
ShowMinuteTicks="{TemplateBinding ShowMinuteTicks}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
HourTickForeground="{DynamicResource SemiGrey6}"
MinuteTickForeground="{DynamicResource SemiGrey4}" />
HourTickForeground="{DynamicResource ClockHourTickForeground}"
MinuteTickForeground="{DynamicResource ClockMinuteTickForeground}" />
<UniformGrid Rows="2" IsVisible="{TemplateBinding ShowHourHand}">
<Border
Width="16"
@@ -51,8 +51,8 @@
<Ellipse
Width="20"
Height="20"
Fill="White"
Stroke="{DynamicResource SemiBlue5}"
Fill="{DynamicResource ClockArborFill}"
Stroke="{DynamicResource ClockArborStroke}"
StrokeThickness="3" />
</Grid>
</ControlTemplate>

View File

@@ -38,7 +38,7 @@
Height="1"
Margin="0,8"
HorizontalAlignment="Stretch"
Fill="{DynamicResource SemiColorBorder}"
Fill="{DynamicResource FormGroupForeground}"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Header, Converter={x:Static ObjectConverters.IsNotNull}}" />
<ItemsPresenter
ItemsPanel="{TemplateBinding ItemsPanel}" />
@@ -64,7 +64,7 @@
FontWeight="{DynamicResource TextBlockTitleFontWeight}"
Target="{Binding #PART_ContentPresenter.Content}" />
<TextBlock
Foreground="{DynamicResource SemiRed6}"
Foreground="{DynamicResource FormAsteriskForeground}"
IsVisible="{TemplateBinding IsRequired}"
Text="*" />
</StackPanel>
@@ -100,7 +100,7 @@
FontWeight="{DynamicResource TextBlockTitleFontWeight}"
Target="{Binding #PART_ContentPresenter.Content}" />
<TextBlock
Foreground="{DynamicResource SemiRed6}"
Foreground="{DynamicResource FormAsteriskForeground}"
IsVisible="{TemplateBinding IsRequired}"
Text="*" />
</StackPanel>

View File

@@ -237,7 +237,7 @@
Height="{DynamicResource NavigationMenuSeparatorBorderHeight}"
Margin="{DynamicResource NavigationMenuSeparatorBorderMargin}"
HorizontalAlignment="Stretch"
Fill="{DynamicResource SemiColorBorder}" />
Fill="{DynamicResource NavigationMenuItemSeparatorBorderForeground}" />
</StackPanel>
</ControlTemplate>
</Setter>

View File

@@ -79,7 +79,7 @@
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
FontSize="14"
Foreground="{DynamicResource SemiGrey9}" />
Foreground="{DynamicResource TimelineHeaderForeground}" />
<ContentPresenter
Name="{x:Static u:TimelineItem.PART_Content}"
Grid.Row="1"

View File

@@ -54,7 +54,7 @@
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
DockPanel.Dock="Left"
Foreground="{DynamicResource SemiColorText2}"
Foreground="{DynamicResource ToolBarHeaderForeground}"
IsVisible="{TemplateBinding Header,
Converter={x:Static ObjectConverters.IsNotNull}}" />
<Panel Name="PART_PopupButtonPanel" DockPanel.Dock="Right">
@@ -67,7 +67,7 @@
<PathIcon
Name="PART_Icon"
Height="12"
Foreground="{DynamicResource SemiColorText2}"
Foreground="{DynamicResource ToolBarHeaderForeground}"
Data="{DynamicResource ToolBarHorizontalMoreGlyph}" />
</ToggleButton>
<Popup
@@ -122,7 +122,7 @@
<Rectangle
Name="PART_Rect"
Margin="4"
Fill="{DynamicResource SemiColorBorder}" />
Fill="{DynamicResource ToolBarSeparatorForeground}" />
</ControlTemplate>
</Setter>
<Style Selector="^ /template/ Rectangle#PART_Rect">

View File

@@ -8,10 +8,10 @@
<Setter Property="Height" Value="{DynamicResource IconElementThemeHeight}" />
<Setter Property="Width" Value="{DynamicResource IconElementThemeWidth}" />
<Setter Property="StrokeThickness" Value="0.4" />
<Setter Property="Foreground" Value="{DynamicResource SemiBlue2}" />
<Setter Property="StrokeBrush" Value="{DynamicResource SemiBlue6}" />
<Setter Property="ActiveForeground" Value="{DynamicResource SemiBlue6}" />
<Setter Property="ActiveStrokeBrush" Value="{DynamicResource SemiBlue6}" />
<Setter Property="Foreground" Value="{DynamicResource TwoTonePathIconForeground}" />
<Setter Property="StrokeBrush" Value="{DynamicResource TwoTonePathIconStrokeBrush}" />
<Setter Property="ActiveForeground" Value="{DynamicResource TwoTonePathIconActiveForeground}" />
<Setter Property="ActiveStrokeBrush" Value="{DynamicResource TwoTonePathIconActiveStrokeBrush}" />
<Setter Property="Template">
<ControlTemplate TargetType="u:TwoTonePathIcon">
<Border Background="{TemplateBinding Background}">