Skip to content

Commit

Permalink
Merge Combo Box
Browse files Browse the repository at this point in the history
Add Combo Box style
  • Loading branch information
syminomega authored Jun 26, 2022
2 parents 563666a + abca948 commit fe54378
Show file tree
Hide file tree
Showing 9 changed files with 407 additions and 26 deletions.
Binary file modified Images/StylesDemo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SyminUI 是 WPF 的 UI 组件库,并使用称为 **C#UI** 的 MVU 设计模式

[![dotnet package](https://github.com/syminomega/SyminUI/actions/workflows/dotnet-desktop.yml/badge.svg)](https://github.com/syminomega/SyminUI/actions/workflows/dotnet-desktop.yml)

## Preview 预览 (2022-06-25)
## Preview 预览 (2022-06-26)
Currently is in early preview stage. **Pull requests are not available at this moment.**\
目前处于早期预览阶段,**Pull Request 暂未全面开放**

Expand Down
3 changes: 2 additions & 1 deletion SyminUI/Themes/Decorations/CardBorder.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
TextElement.Foreground="{TemplateBinding Foreground}"/>
<svd:LightedSurface.Effect>
<DropShadowEffect BlurRadius="12" Color="{StaticResource Shader.ShadowColor}" Opacity="0.6"/>
<DropShadowEffect BlurRadius="12" Color="{StaticResource Shader.ShadowColor}"
Opacity="0.6"/>
</svd:LightedSurface.Effect>
</svd:LightedSurface>

Expand Down
354 changes: 354 additions & 0 deletions SyminUI/Themes/Styles/ComboBoxStyle.xaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion SyminUI/Themes/Styles/GroupBoxStyle.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Style TargetType="{x:Type GroupBox}">
<Setter Property="BorderBrush" Value="{StaticResource Border.Section}"/>
<Setter Property="Background" Value="{StaticResource Background.Section}"/>
<Setter Property="Foreground" Value="{StaticResource Text.Contrast}"/>
<Setter Property="Foreground" Value="{StaticResource Text.Main}"/>
<Setter Property="Margin" Value="4"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Padding" Value="4"/>
Expand All @@ -26,6 +26,7 @@
<Border x:Name="Header" Grid.Row="0" CornerRadius="4,4,0,0"
Background="{TemplateBinding BorderBrush}">
<ContentPresenter ContentSource="Header"
TextElement.Foreground="{StaticResource Text.Contrast}"
RecognizesAccessKey="True" Margin="8"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
Expand Down
2 changes: 2 additions & 0 deletions SyminUI/Themes/Styles/ToggleButtonStyle.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="circle"
Value="{StaticResource Background.Button.Disabled}"/>
<Setter Property="Effect" TargetName="circle"
Value="{x:Null}"/>
<Setter Property="Background" TargetName="borderOn"
Value="{StaticResource Primary.Disabled}"/>
<Setter Property="Background" TargetName="borderOff"
Expand Down
5 changes: 3 additions & 2 deletions SyminUI/Themes/SyminLight.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<SolidColorBrush x:Key="Background.Main" Color="{StaticResource Background.MainColor}"/>
<SolidColorBrush x:Key="Background.Window" Color="#E8E9EC"/>
<SolidColorBrush x:Key="Background.FocusedMask" Color="#7F9FA2AC"/>
<SolidColorBrush x:Key="Background.SelectedMask" Color="#7FC8CBD4"/>
<SolidColorBrush x:Key="Background.LightMask" Color="#7FFFFFFF"/>
<SolidColorBrush x:Key="Background.Section" Color="#DFE1E7"/>

Expand All @@ -52,8 +53,8 @@
<SolidColorBrush x:Key="Background.Pure" Color="White"/>
<SolidColorBrush x:Key="Background.TextField" Color="#FBFBFB"/>
<SolidColorBrush x:Key="Background.Label" Color="#F2F2F2"/>
<SolidColorBrush x:Key="Background.Toggle" Color="#C3C6D6"/>
<SolidColorBrush x:Key="Background.Toggle.Disabled" Color="#E5E6EC"/>
<SolidColorBrush x:Key="Background.Toggle" Color="#CACCDB"/>
<SolidColorBrush x:Key="Background.Toggle.Disabled" Color="#CCCDD2"/>
<!--实色填充的系统控件:滚动条、GridSplitter等-->
<SolidColorBrush x:Key="Background.Handler" Color="#87898A"/>
<SolidColorBrush x:Key="Background.Handler.Focused" Color="#5E5E5E"/>
Expand Down
1 change: 1 addition & 0 deletions SyminUI/Themes/SyminStyle.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<ResourceDictionary Source="Styles/ButtonsStyle.xaml"/>
<ResourceDictionary Source="Styles/ToggleButtonStyle.xaml"/>
<ResourceDictionary Source="Styles/TextBoxStyle.xaml"/>
<ResourceDictionary Source="Styles/ComboBoxStyle.xaml"/>
<ResourceDictionary Source="Styles/ProgressBarStyle.xaml"/>
<ResourceDictionary Source="Styles/SliderStyle.xaml"/>
<ResourceDictionary Source="Styles/CheckBoxStyle.xaml"/>
Expand Down
63 changes: 42 additions & 21 deletions SyminViewTest/StyleTestWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,43 +98,64 @@
</ScrollViewer>

<GroupBox Header="Other Styles" Grid.Column="1" Margin="12,4">
<StackPanel Orientation="Vertical" Margin="4">
<Grid Height="120" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<svd:SlotBorder Content="Slot" VerticalContentAlignment="Center"
<ScrollViewer>
<StackPanel Orientation="Vertical" Margin="4">
<Grid Height="120" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<svd:SlotBorder Content="Slot" VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Foreground="{StaticResource Gradient.Primary}"
FontSize="24" Radius="16"/>
<svd:EmbossBorder Content="Emboss" VerticalContentAlignment="Center"
<svd:EmbossBorder Content="Emboss" VerticalContentAlignment="Center"
HorizontalContentAlignment="Center" Grid.Column="1"
Foreground="{StaticResource Gradient.Primary}"
FontSize="24" CornerRadius="16"
ContextMenu="{StaticResource ContextMenuDemo}"/>
<svd:CardBorder Content="Card" Grid.Column="2" FontSize="24"
<svd:CardBorder Content="Card" Grid.Column="2" FontSize="24"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Foreground="{StaticResource Gradient.Primary}"
CornerRadius="16"/>

</Grid>
<TextBox Text="Text Box (Input Field)"/>
<ProgressBar Height="24" IsIndeterminate="{Binding ElementName=ProgressCheckbox,Path=IsChecked}"
</Grid>
<TextBox Text="Text Box (Input Field)"/>
<ProgressBar Height="24" IsIndeterminate="{Binding ElementName=ProgressCheckbox,Path=IsChecked}"
Value="{Binding ElementName=progressSlider,Path=Value}"/>
<Slider x:Name="progressSlider" Maximum="100" Minimum="0" Value="25"/>
<CheckBox x:Name="ProgressCheckbox" Content="Progress Is Indeterminate"/>
<CheckBox Content="Check Box Indeterminate Disabled" IsChecked="{x:Null}" IsEnabled="False"/>
<svd:LightedSurface Height="80" Margin="4"
<Slider x:Name="progressSlider" Maximum="100" Minimum="0" Value="25"/>
<CheckBox x:Name="ProgressCheckbox" Content="Progress Is Indeterminate"/>
<CheckBox Content="Check Box Indeterminate Disabled" IsChecked="{x:Null}" IsEnabled="False"/>
<UniformGrid Columns="2" Rows="1">
<ComboBox SelectedIndex="0" >
<ComboBoxItem Content="Selection A"/>
<ComboBoxItem Content="Selection B"/>
<ComboBoxItem Content="Selection C"/>
</ComboBox>
<ComboBox SelectedIndex="0" IsEditable="True" >
<ComboBoxItem Content="Selection Editable"/>
<ComboBoxItem Content="Selection B"/>
<ComboBoxItem Content="Selection C"/>
</ComboBox>
</UniformGrid>
<svd:LightedSurface Height="80" Margin="4"
Background="{StaticResource Background.Main}"
CornerRadius="16" Content="Lighed Surface" FontSize="24"/>
<StackPanel Orientation="Horizontal">
<ToggleButton Content="Toggle"/>
<ToggleButton Style="{StaticResource SwitchButton}"/>
<StackPanel Orientation="Horizontal">
<ToggleButton Content="Toggle" IsChecked="True"/>
<ToggleButton Style="{StaticResource SwitchButton}"
IsChecked="True"/>
<ToggleButton Content="Toggle Disabled"
IsEnabled="False"/>
<ToggleButton Style="{StaticResource SwitchButton}"
IsEnabled="False"/>
</StackPanel>

</StackPanel>
</StackPanel>
</ScrollViewer>

</GroupBox>

<GroupBox Header="Vertical" Grid.Column="2">
Expand Down

0 comments on commit fe54378

Please sign in to comment.