Skip to content

Commit

Permalink
updating controls
Browse files Browse the repository at this point in the history
  • Loading branch information
kikipoulet committed Aug 13, 2024
1 parent 3cf4e4f commit 32082c9
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 28 deletions.
2 changes: 1 addition & 1 deletion SukiUI/ColorTheme/Dark.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<system:Double x:Key="GlassOpacity">0.18</system:Double>

<system:Double x:Key="ControlGlassOpacity">0.3</system:Double>
<system:Double x:Key="DiscreteControlGlassOpacity">0.14</system:Double>
<system:Double x:Key="DiscreteControlGlassOpacity">0.17</system:Double>
<Color x:Key="ControlSukiGlassCardBackground">#49aaaaaa</Color>

</ResourceDictionary>
2 changes: 1 addition & 1 deletion SukiUI/ColorTheme/Light.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<system:Double x:Key="GlassOpacity">0.42</system:Double>

<system:Double x:Key="ControlGlassOpacity">0.05</system:Double>
<system:Double x:Key="DiscreteControlGlassOpacity">0.3</system:Double>
<system:Double x:Key="DiscreteControlGlassOpacity">0.31</system:Double>
<Color x:Key="ControlSukiGlassCardBackground">#fd111111</Color>

</ResourceDictionary>
9 changes: 8 additions & 1 deletion SukiUI/Controls/GlassMorphism/GlassCard.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,21 @@
<Setter Property="IsAnimated" Value="False"></Setter>
<Setter Property="Padding" Value="0"></Setter>
</Style>

<Style Selector="^.Discrete">

<Setter Property="Padding" Value="0"></Setter>
</Style>
<Style Selector="^.Control /template/ Border#PART_BorderCard">
<Setter Property="Background" Value="{DynamicResource ControlSukiGlassCardBackground}" />
<Setter Property="Opacity" Value="{DynamicResource ControlGlassOpacity}" />
</Style>

<Style Selector="^.Discrete /template/ Border#PART_BorderCard">

<Setter Property="Background" Value="{DynamicResource SukiGlassCardBackground}" />
<Setter Property="Opacity" Value="{DynamicResource DiscreteControlGlassOpacity}" />


</Style>

<Style Selector="^.Primary /template/ Border#PART_ClipBorder">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<TextBlock Classes="Label" />
<DatePicker Grid.Column="2" Width="175"
Margin="4,0" Height="36"
Margin="-6,0" Height="36"
HorizontalAlignment="Right"
VerticalAlignment="Stretch"
IsEnabled="{Binding !IsReadOnly}"
Expand All @@ -59,7 +59,7 @@

<TextBlock Classes="Label" />
<DatePicker Grid.Column="2"
Margin="4,0" Height="36"
Margin="-6,0" Height="36"
HorizontalAlignment="Right" Width="175"
VerticalAlignment="Stretch"
IsEnabled="{Binding !IsReadOnly}"
Expand Down
10 changes: 8 additions & 2 deletions SukiUI/Theme/CalendarDatePickerStyle.axaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="using:System"
xmlns:suki="https://github.com/kikipoulet/SukiUI"
x:ClassModifier="internal">

<Design.PreviewWith>
Expand All @@ -13,21 +14,24 @@

<ControlTheme x:Key="{x:Type CalendarDatePicker}" TargetType="CalendarDatePicker">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Height" Value="38" />
<Setter Property="BorderThickness" Value="0,0,0,1" />
<Setter Property="FontSize" Value="14" />
<Setter Property="BorderBrush" Value="{DynamicResource SukiControlBorderBrush}" />
<Setter Property="Padding" Value="4" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<ControlTemplate>
<suki:GlassCard Height="{TemplateBinding Height}" CornerRadius="{DynamicResource SmallCornerRadius}" Classes="Discrete" >
<Grid ColumnDefinitions="*,Auto">
<Grid.Styles>
<Style Selector="Button.CalendarDropDown">
<Setter Property="Template">
<ControlTemplate>

<Grid Width="22"
Height="20"
Margin="0,0,0,0"
Margin="0,0,16,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="Transparent"
Expand Down Expand Up @@ -74,6 +78,7 @@
Fill="{DynamicResource SukiControlBorderBrush}"
StrokeThickness="0" />
</Grid>

</ControlTemplate>
</Setter>
</Style>
Expand All @@ -83,7 +88,7 @@
</Style>
</Grid.Styles>

<TextBox Name="PART_TextBox"
<TextBox Name="PART_TextBox" Classes="NoShadow"
Grid.Column="0"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
Expand Down Expand Up @@ -134,6 +139,7 @@

</Popup>
</Grid>
</suki:GlassCard>
</ControlTemplate>
</Setter>

Expand Down
18 changes: 11 additions & 7 deletions SukiUI/Theme/DatePicker.axaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:icons="clr-namespace:SukiUI.Content"
xmlns:sys="using:System">
xmlns:sys="using:System"
xmlns:suki="https://github.com/kikipoulet/SukiUI">
<Design.PreviewWith>
<Border Width="1000"
Height="500"
Expand Down Expand Up @@ -40,22 +41,24 @@
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ThemeControlHighlightMidBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Height" Value="40" />
<Setter Property="Height" Value="38" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Template">
<ControlTemplate>
<DataValidationErrors>
<Grid Name="LayoutRoot" Margin="0,0,0,0">

<Button Name="PART_FlyoutButton"
<Button Name="PART_FlyoutButton" Margin="0"
Height="{TemplateBinding Height}"
Background="Transparent"
BorderThickness="0,0,0,1"
CornerRadius="0"
Background="Transparent"
BorderThickness="0,0,0,0"
CornerRadius="0" Padding="0"
IsEnabled="{TemplateBinding IsEnabled}"
TemplatedControl.IsTemplateFocusTarget="True">
<Grid Margin="0,1,0,0" ColumnDefinitions="Auto,Auto">
<suki:GlassCard CornerRadius="{DynamicResource SmallCornerRadius}" Height="{TemplateBinding Height}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" Classes="Discrete" >
<Grid Margin="14,0" ColumnDefinitions="Auto,Auto">
<Grid Name="PART_ButtonContentGrid"
Grid.Column="0"
VerticalAlignment="Center"
Expand Down Expand Up @@ -106,6 +109,7 @@
Foreground="{DynamicResource SukiLowText}" />

</Grid>
</suki:GlassCard>
</Button>

<Popup Name="PART_Popup"
Expand Down
15 changes: 7 additions & 8 deletions SukiUI/Theme/DropDownButton.axaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:content="clr-namespace:SukiUI.Content">
xmlns:content="clr-namespace:SukiUI.Content"
xmlns:suki="https://github.com/kikipoulet/SukiUI">
<ControlTheme x:Key="SukiDropDownButtonStyle" TargetType="DropDownButton">
<Setter Property="BorderThickness" Value="1.2" />
<Setter Property="BorderBrush" Value="{DynamicResource SukiMediumBorderBrush}" />
Expand All @@ -14,17 +15,15 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border Name="RootBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
<suki:GlassCard Name="RootBorder" Classes="Discrete"
Padding="0"
ClipToBounds="True"
CornerRadius="{TemplateBinding CornerRadius}">
<Border.Transitions>
<suki:GlassCard.Transitions>
<Transitions>
<BrushTransition Property="BorderBrush" Duration="0:0:0.25" />
</Transitions>
</Border.Transitions>
</suki:GlassCard.Transitions>
<Grid Name="InnerGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
Expand Down Expand Up @@ -68,7 +67,7 @@
</PathIcon>

</Grid>
</Border>
</suki:GlassCard>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Theme/NumericUpDownStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Border Padding="20">
<StackPanel Orientation="Horizontal" Spacing="5" >
<NumericUpDown Value="4" />
<TextBox Text="test"></TextBox>
<TextBox Classes="NoShadow" Text="test"></TextBox>
</StackPanel>
</Border>
</Design.PreviewWith>
Expand Down
7 changes: 5 additions & 2 deletions SukiUI/Theme/TextBoxStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<TextBox Width="200"
Margin="5"
Text="Elem" />
<TextBox Classes="FlatTextBox" Text="Elem" />
<TextBox Classes="NoShadow" Text="Elem" />

<Panel>
<Border Margin="0,0,0,25" Classes="Card">
Expand Down Expand Up @@ -357,6 +357,7 @@

<theme:StringToDoubleConverter x:Key="StringToDoubleC" />
</Border.Resources>
<Panel>
<suki:GlassCard Name="border"
Padding="0" Classes="Discrete"
BorderBrush="{TemplateBinding BorderBrush}"
Expand All @@ -368,6 +369,7 @@
<BrushTransition Property="BorderBrush" Duration="0:0:0.2" />
</Transitions>
</suki:GlassCard.Transitions>
</suki:GlassCard>
<Border Name="borderbottom"
Margin="1,-1,1,-1"
BorderBrush="{TemplateBinding BorderBrush}"
Expand Down Expand Up @@ -458,7 +460,7 @@

</DockPanel>
</Border>
</suki:GlassCard>
</Panel>
</Border>

</ControlTemplate>
Expand Down Expand Up @@ -608,6 +610,7 @@
<Style Selector="TextBox.NoShadow /template/ suki|GlassCard#border">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="IsVisible" Value="False"></Setter>
</Style>

<Style Selector="TextBox.NoShadow:focus /template/ suki|GlassCard#border">
Expand Down
9 changes: 6 additions & 3 deletions SukiUI/Theme/TimePickerStyle.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:icons="clr-namespace:SukiUI.Content"
xmlns:sys="using:System">
xmlns:sys="using:System"
xmlns:suki="https://github.com/kikipoulet/SukiUI">
<Design.PreviewWith>
<Border Height="500" Padding="20">
<StackPanel VerticalAlignment="Center" Spacing="20">
Expand Down Expand Up @@ -59,7 +60,7 @@

<ControlTheme x:Key="{x:Type TimePicker}" TargetType="TimePicker">
<Setter Property="FontSize" Value="{DynamicResource FontSizeNormal}" />
<Setter Property="BorderThickness" Value="0,0,0,1" />
<Setter Property="BorderThickness" Value="0,0,0,0" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="{DynamicResource SukiMediumBorderBrush}" />
Expand All @@ -71,6 +72,8 @@
<ControlTemplate>
<DataValidationErrors>
<Grid Name="LayoutRoot">
<suki:GlassCard Height="{TemplateBinding Height}" CornerRadius="{DynamicResource SmallCornerRadius}" Classes="Discrete" >

<Button x:Name="PART_FlyoutButton"
MinWidth="{DynamicResource TimePickerThemeMinWidth}"
MaxWidth="{DynamicResource TimePickerThemeMaxWidth}"
Expand Down Expand Up @@ -144,7 +147,7 @@
</Grid>
</DockPanel>
</Button>

</suki:GlassCard>
<Popup Name="PART_Popup"
IsLightDismissEnabled="True"
Placement="Bottom"
Expand Down

0 comments on commit 32082c9

Please sign in to comment.