feat: using IconButton in ThemeSelector Template.
This commit is contained in:
@@ -6,17 +6,11 @@
|
|||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
x:Class="Ursa.Demo.Views.TitleBarRightContent">
|
x:Class="Ursa.Demo.Views.TitleBarRightContent">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Button
|
<u:IconButton
|
||||||
Padding="8"
|
Theme="{StaticResource BorderlessIconButton}"
|
||||||
Width="32"
|
Classes="Tertiary"
|
||||||
Height="32"
|
Icon="{StaticResource SemiIconGithubLogo}"
|
||||||
Theme="{DynamicResource BorderlessButton}"
|
Click="OpenRepository" />
|
||||||
Click="OpenRepository">
|
|
||||||
<PathIcon
|
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
|
||||||
Data="{StaticResource SemiIconGithubLogo}"
|
|
||||||
Foreground="{DynamicResource SemiColorText1}" />
|
|
||||||
</Button>
|
|
||||||
<u:ThemeToggleButton
|
<u:ThemeToggleButton
|
||||||
IsThreeState="True"
|
IsThreeState="True"
|
||||||
Mode="Controller" />
|
Mode="Controller" />
|
||||||
|
|||||||
@@ -2,32 +2,27 @@
|
|||||||
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">
|
||||||
<ControlTheme TargetType="u:ThemeToggleButton" x:Key="{x:Type u:ThemeToggleButton}">
|
<ControlTheme TargetType="u:ThemeToggleButton" x:Key="{x:Type u:ThemeToggleButton}">
|
||||||
<Setter Property="Padding" Value="8" />
|
|
||||||
<Setter Property="Width" Value="32" />
|
|
||||||
<Setter Property="Height" Value="32" />
|
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="u:ThemeToggleButton">
|
<ControlTemplate TargetType="u:ThemeToggleButton">
|
||||||
<Button
|
<u:IconButton
|
||||||
Name="{x:Static u:ThemeToggleButton.PART_ThemeButton}"
|
Name="{x:Static u:ThemeToggleButton.PART_ThemeButton}"
|
||||||
Theme="{DynamicResource BorderlessButton}"
|
Theme="{StaticResource BorderlessIconButton}"
|
||||||
Padding="{TemplateBinding Padding}">
|
Classes="Tertiary"
|
||||||
<PathIcon
|
Padding="{TemplateBinding Padding}"
|
||||||
Name="PART_Icon"
|
Width="{TemplateBinding Width}"
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
Height="{TemplateBinding Height}" />
|
||||||
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
|
||||||
</Button>
|
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
<Style Selector="^:dark /template/ PathIcon#PART_Icon">
|
<Style Selector="^:dark /template/ u|IconButton#PART_ThemeButton">
|
||||||
<Setter Property="Data" Value="{DynamicResource ThemeSelectorButtonDarkGlyph}" />
|
<Setter Property="Icon" Value="{StaticResource ThemeSelectorButtonDarkGlyph}" />
|
||||||
<Setter Property="ToolTip.Tip" Value="{DynamicResource STRING_THEME_TOGGLE_DARK}" />
|
<Setter Property="ToolTip.Tip" Value="{DynamicResource STRING_THEME_TOGGLE_DARK}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:light /template/ PathIcon#PART_Icon">
|
<Style Selector="^:light /template/ u|IconButton#PART_ThemeButton">
|
||||||
<Setter Property="Data" Value="{DynamicResource ThemeSelectorButtonLightGlyph}" />
|
<Setter Property="Icon" Value="{StaticResource ThemeSelectorButtonLightGlyph}" />
|
||||||
<Setter Property="ToolTip.Tip" Value="{DynamicResource STRING_THEME_TOGGLE_LIGHT}" />
|
<Setter Property="ToolTip.Tip" Value="{DynamicResource STRING_THEME_TOGGLE_LIGHT}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ PathIcon#PART_Icon">
|
<Style Selector="^ /template/ u|IconButton#PART_ThemeButton">
|
||||||
<Setter Property="Data" Value="{DynamicResource ThemeSelectorButtonDefaultGlyph}" />
|
<Setter Property="Icon" Value="{StaticResource ThemeSelectorButtonDefaultGlyph}" />
|
||||||
<Setter Property="ToolTip.Tip" Value="{DynamicResource STRING_THEME_TOGGLE_SYSTEM}" />
|
<Setter Property="ToolTip.Tip" Value="{DynamicResource STRING_THEME_TOGGLE_SYSTEM}" />
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|||||||
Reference in New Issue
Block a user