feat: add outline.

This commit is contained in:
rabbitism
2024-08-24 20:45:24 +08:00
parent 3c194e35d6
commit db20544756
2 changed files with 44 additions and 0 deletions

View File

@@ -104,5 +104,19 @@
Text="🐼" /> Text="🐼" />
</u:IconButton.Icon> </u:IconButton.Icon>
</u:IconButton> </u:IconButton>
<u:IconButton
IsLoading="{Binding #loading.IsChecked}"
Icon="🐼"
Content="Borderless"
Theme="{DynamicResource BorderlessIconButton}">
</u:IconButton>
<u:IconButton
IsLoading="{Binding #loading.IsChecked}"
Icon="🐼"
Content="Outline"
Theme="{DynamicResource OutlineIconButton}">
</u:IconButton>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View File

@@ -284,4 +284,34 @@
</Style> </Style>
</ControlTheme> </ControlTheme>
<ControlTheme
x:Key="OutlineIconButton"
BasedOn="{StaticResource {x:Type u:IconButton}}"
TargetType="u:IconButton">
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style>
<Style Selector="^.Success">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineSuccessBorderBrush}" />
</Style>
<Style Selector="^.Warning">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineWarningBorderBrush}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" />
</Style>
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme>
</ResourceDictionary> </ResourceDictionary>