forked from Blessing-Studio/WonderLab.Override
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9dd7d4f
commit f06c893
Showing
8 changed files
with
164 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
WonderLab/Views/Controls/Themes/Controls/ComboBoxItemTheme.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<ResourceDictionary xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | ||
<Design.PreviewWith> | ||
<Border Padding="20"> | ||
<Border Background="{DynamicResource ComboBoxDropDownBackground}" BorderBrush="{DynamicResource ComboBoxDropDownBorderBrush}" BorderThickness="{DynamicResource ComboBoxDropdownBorderThickness}" Margin="0,-1,0,-1" Padding="{DynamicResource ComboBoxDropdownBorderPadding}" CornerRadius="{DynamicResource OverlayCornerRadius}"> | ||
<StackPanel HorizontalAlignment="Stretch"> | ||
<ComboBoxItem>Item 1</ComboBoxItem> | ||
<ComboBoxItem>Item 2 long</ComboBoxItem> | ||
<ComboBoxItem IsEnabled="True">Item 4</ComboBoxItem> | ||
<ComboBoxItem IsSelected="True">Item 3</ComboBoxItem> | ||
<ComboBoxItem IsSelected="True" IsEnabled="True">Item 5</ComboBoxItem> | ||
</StackPanel> | ||
</Border> | ||
</Border> | ||
</Design.PreviewWith> | ||
|
||
<ControlTheme x:Key="{x:Type ComboBoxItem}" TargetType="ComboBoxItem"> | ||
<Setter Property="Margin" Value="4 2" /> | ||
<Setter Property="CornerRadius" Value="6" /> | ||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> | ||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForeground}" /> | ||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackground}" /> | ||
<Setter Property="Padding" Value="{DynamicResource ComboBoxItemThemePadding}" /> | ||
<Setter Property="Template"> | ||
<ControlTemplate> | ||
<ContentPresenter Name="PART_ContentPresenter" | ||
Foreground="{TemplateBinding Foreground}" | ||
Background="{TemplateBinding Background}" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="{TemplateBinding BorderThickness}" | ||
CornerRadius="{TemplateBinding CornerRadius}" | ||
ContentTemplate="{TemplateBinding ContentTemplate}" | ||
Content="{TemplateBinding Content}" | ||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" | ||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" | ||
Padding="{TemplateBinding Padding}" /> | ||
</ControlTemplate> | ||
</Setter> | ||
|
||
<!-- PointerOver state --> | ||
<Style Selector="^:pointerover /template/ ContentPresenter"> | ||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundPointerOver}" /> | ||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushPointerOver}" /> | ||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundPointerOver}" /> | ||
</Style> | ||
|
||
<!-- Disabled state --> | ||
<Style Selector="^:disabled /template/ ContentPresenter"> | ||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundDisabled}" /> | ||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushDisabled}" /> | ||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundDisabled}" /> | ||
</Style> | ||
|
||
<!-- Pressed state --> | ||
<Style Selector="^:pressed /template/ ContentPresenter"> | ||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundPressed}" /> | ||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushPressed}" /> | ||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundPressed}" /> | ||
</Style> | ||
|
||
<!-- Selected state --> | ||
<Style Selector="^:selected"> | ||
<Style Selector="^ /template/ ContentPresenter"> | ||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundSelected}" /> | ||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushSelected}" /> | ||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundSelected}" /> | ||
</Style> | ||
<!-- Selected Disabled state --> | ||
<Style Selector="^:disabled /template/ ContentPresenter"> | ||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundSelectedDisabled}" /> | ||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushSelectedDisabled}" /> | ||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundSelectedDisabled}" /> | ||
</Style> | ||
<!-- Selected PointerOver state --> | ||
<Style Selector="^:pointerover /template/ ContentPresenter"> | ||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundSelectedPointerOver}" /> | ||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushSelectedPointerOver}" /> | ||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundSelectedPointerOver}" /> | ||
</Style> | ||
<!-- Selected Pressed state --> | ||
<Style Selector="^:pressed /template/ ContentPresenter"> | ||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundSelectedPressed}" /> | ||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushSelectedPressed}" /> | ||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundSelectedPressed}" /> | ||
</Style> | ||
</Style> | ||
</ControlTheme> | ||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters