Skip to content

Commit

Permalink
Merge branch 'kikipoulet:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzh0816 authored Oct 12, 2024
2 parents 3326902 + da9b61c commit 647e180
Show file tree
Hide file tree
Showing 18 changed files with 64 additions and 79 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Many thanks to [McCree Lee](https://github.com/AuroraZiling) for his work on the

<br/>

![colorthemes](https://github.com/user-attachments/assets/78f2ae9c-4fd7-4402-876f-791e5fb8a10a)
![sukicolorpresentation](https://github.com/user-attachments/assets/70fdaa99-6274-478a-bb2a-025a0b7f1182)


<br/>

Expand Down Expand Up @@ -80,14 +81,16 @@ SukiUI offer a versatile way to display unique toasts, to help you create nice i

<br/>

![dialogs](https://github.com/user-attachments/assets/f786d724-0cae-417a-bc60-69e4d1a2bfc0)
![dialogslight](https://github.com/user-attachments/assets/51f05964-e847-4ed6-a1f7-78616eea9cee)


<br/> <br/>

### Dock

SukiUI includes styles for the [Dock](https://github.com/wieslawsoltes/Dock) library.

![dock](https://github.com/user-attachments/assets/ef7ec55f-f13c-4214-b5ce-ad5ef3042868)

![dockgradient](https://github.com/user-attachments/assets/828cf7f1-ca76-4e36-ab27-921c35f93280)


11 changes: 2 additions & 9 deletions SukiUI.Demo/Features/ControlsLibrary/CardsView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@
<DockPanel Margin="0,12,0,0">
<TextBlock DockPanel.Dock="Left" FontWeight="DemiBold" VerticalAlignment="Center" Text="Is Opaque :" />
<ToggleSwitch Margin="8,0,0,0" IsChecked="{Binding IsOpaque}" />

</DockPanel>
<DockPanel>
<TextBlock DockPanel.Dock="Left" FontWeight="DemiBold" VerticalAlignment="Center" Text="Is Interactive :" />
<ToggleSwitch Margin="8,0,0,0" IsChecked="{Binding IsInteractive}" />

</DockPanel>
</StackPanel>
</suki:GroupBox>
Expand All @@ -66,23 +64,19 @@
</suki:GlassCard>
<suki:GlassCard>
<suki:GlassCard.Resources>
<system:Double x:Key="GlassOpacity">0.2</system:Double>
<system:Double x:Key="GlassOpacity">0.5</system:Double>
</suki:GlassCard.Resources>
<suki:GroupBox Header="Overriden Opacity">
<TextBlock Classes="h4">This card's resources sets the double resource of "GlassOpacity" to 0.2</TextBlock>
<TextBlock Classes="h4">This card's resources sets the double resource of "GlassOpacity" to 0.5</TextBlock>
</suki:GroupBox>
</suki:GlassCard>

</WrapPanel>

<Border Background="{DynamicResource SukiControlBorderBrush}" Height="1" Margin="30,30"></Border>
<TextBlock TextWrapping="Wrap" HorizontalAlignment="Left" Margin="30,0,30,30" FontWeight="DemiBold" Text="GlassCard are animated with CompositionAnimations by the property IsAnimated set to 'True' by default. Opacity changes and Size changes of the GlassCard are automatically animated. See below the differences by adding an item."></TextBlock>

<StackPanel Spacing="12" Margin="30,10" Orientation="Horizontal">
<Button Classes="Flat" Content="Add Item" Command="{Binding AddItemCommand}"></Button>
<Button Content="Remove Item" Command="{Binding RemoveItemCommand}"></Button>
</StackPanel>

<Grid ColumnDefinitions="*,*" Margin="15">
<suki:GlassCard HorizontalAlignment="Left" IsAnimated="False" Margin="15">
<StackPanel Spacing="35">
Expand All @@ -103,7 +97,6 @@
</ItemsControl>
</StackPanel>
</suki:GlassCard>

<suki:GlassCard Grid.Column="1" HorizontalAlignment="Left" Margin="15">
<StackPanel Spacing="35">
<TextBlock FontWeight="DemiBold" FontSize="17" Text="Animated"></TextBlock>
Expand Down
2 changes: 1 addition & 1 deletion SukiUI.Demo/SukiUIDemoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public partial class SukiUIDemoViewModel : ObservableObject
[ObservableProperty] private DemoPageBase? _activePage;
[ObservableProperty] private bool _windowLocked;
[ObservableProperty] private bool _titleBarVisible = true;
[ObservableProperty] private SukiBackgroundStyle _backgroundStyle = SukiBackgroundStyle.Bubble;
[ObservableProperty] private SukiBackgroundStyle _backgroundStyle = SukiBackgroundStyle.Gradient;
[ObservableProperty] private bool _animationsEnabled;
[ObservableProperty] private string? _customShaderFile;
[ObservableProperty] private bool _transitionsEnabled;
Expand Down
3 changes: 2 additions & 1 deletion SukiUI/ColorTheme/Dark.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<Color x:Key="SukiControlBorderBrush">#606060</Color>
<Color x:Key="SukiMediumBorderBrush">#555555</Color>
<Color x:Key="SukiLightBorderBrush">#454545</Color>
<Color x:Key="SukiMenuBorderBrush">#454545</Color>
<Color x:Key="GlassBorderBrush">#252729</Color>

<Color x:Key="SukiText">#edffffff</Color>
Expand All @@ -27,7 +28,7 @@
<BoxShadows x:Key="SukiBigPopupShadow">1 4 17 0 #111111</BoxShadows>

<LinearGradientBrush x:Key="PopupGradientBrush" StartPoint="0%,0%" EndPoint="100%,100%">
<GradientStop Color="{DynamicResource SukiAccentColor3}" Offset="0"></GradientStop>
<GradientStop Color="{DynamicResource SukiPrimaryColor3}" Offset="0"></GradientStop>
<GradientStop Color="{DynamicResource SukiPrimaryColor10}" Offset="0.9"></GradientStop>

</LinearGradientBrush>
Expand Down
9 changes: 5 additions & 4 deletions SukiUI/ColorTheme/Light.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=netstandard">
<Color x:Key="SukiBackground">Transparent</Color>
<Color x:Key="SukiStrongBackground">#fafafa</Color>
<Color x:Key="SukiStrongBackground">#fcfcfc</Color>
<Color x:Key="SukiLightBackground">Transparent</Color>
<Color x:Key="SukiCardBackground">White</Color>
<Color x:Key="SukiGlassCardBackground">#fdfefefe</Color>
Expand All @@ -14,6 +14,7 @@
<Color x:Key="SukiControlBorderBrush">#cecece</Color>
<Color x:Key="SukiMediumBorderBrush">#e2e2e2</Color>
<Color x:Key="SukiLightBorderBrush">#f1f1f1</Color>
<Color x:Key="SukiMenuBorderBrush">#d7d7d7</Color>
<Color x:Key="GlassBorderBrush">#e3e3e7</Color>

<Color x:Key="SukiText">#222222</Color>
Expand All @@ -27,15 +28,15 @@
<BoxShadows x:Key="SukiBigPopupShadow">1 4 17 0 #999999</BoxShadows>

<LinearGradientBrush x:Key="PopupGradientBrush" StartPoint="0%,0%" EndPoint="100%,100%">
<GradientStop Color="{DynamicResource SukiAccentColor5}" Offset="0"></GradientStop>
<GradientStop Color="{DynamicResource SukiPrimaryColor5}" Offset="1"></GradientStop>
<GradientStop Color="#03111111" Offset="0"></GradientStop>
<GradientStop Color="#02111111" Offset="1"></GradientStop>

</LinearGradientBrush>

<system:Boolean x:Key="IsDark">False</system:Boolean>
<system:Boolean x:Key="IsLight">True</system:Boolean>

<system:Double x:Key="GlassOpacity">0.42</system:Double>
<system:Double x:Key="GlassOpacity">0.48</system:Double>

<system:Double x:Key="ControlGlassOpacity">0.05</system:Double>
<system:Double x:Key="DiscreteControlGlassOpacity">0.4</system:Double>
Expand Down
6 changes: 3 additions & 3 deletions SukiUI/Content/Shaders/Background/gradient.sksl
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ vec4 main(vec2 fragCoord) {
float opacityLayer2 = 0.85 - (iDark / 2);


float iPrimaryOpacity = 0.2; // Exemple de nouvelle opacité pour iPrimary
float iPrimaryOpacity = 1.5; // Exemple de nouvelle opacité pour iPrimary
if (iDark == 1) {
iPrimaryOpacity = 0.4;
}
vec3 iPrimaryWithOpacity = iPrimary * iPrimaryOpacity;


float iAccentOpacity = 1;
float iAccentOpacity = -1.05;
if (iDark == 1) {
iAccentOpacity = 2;
}
Expand All @@ -89,7 +89,7 @@ vec4 main(vec2 fragCoord) {

vec3 col;
if (iDark == 0) {
col = blendOverlay(iBase, finalComp);
col = blendOverlay(iBase * 1.02, finalComp);
} else {
col = blendOverlayDark(iBase, finalComp);
}
Expand Down
29 changes: 8 additions & 21 deletions SukiUI/Controls/GlassMorphism/GlassCard.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<Setter Property="Padding" Value="20" />
<Setter Property="Template">
<ControlTemplate>

<Panel Name="RootPanel" Opacity="0">
<Border Name="PART_BorderCard" RenderTransformOrigin="50%,50%"
Background="{TemplateBinding Background}"
Expand All @@ -16,28 +15,24 @@
ClipToBounds="{TemplateBinding ClipToBounds}"
CornerRadius="{TemplateBinding CornerRadius}"
Opacity="{DynamicResource GlassOpacity}">

<Border.Transitions>
<Transitions>
<DoubleTransition Property="Width"
Duration="0:0:0.5"
Easing="QuadraticEaseOut"/>
Duration="0:0:0.5"
Easing="QuadraticEaseOut" />
<DoubleTransition Property="Height"
Duration="0:0:0.5"
Easing="QuadraticEaseOut"/>
Duration="0:0:0.5"
Easing="QuadraticEaseOut" />
</Transitions>
</Border.Transitions>

<Border.Transitions>
<Transitions>
<BrushTransition Property="Background" Duration="0:0:0.15" />
<!-- <BrushTransition Property="Background" Duration="0:0:0.15" /> -->
<BrushTransition Property="BorderBrush" Duration="0:0:0.15" />
<DoubleTransition Property="Opacity" Duration="0:0:0.15" />
</Transitions>
</Border.Transitions>
</Border>


<Border Name="PART_ClipBorder"
Background="{DynamicResource SukiPrimaryColor0}"
BorderBrush="{DynamicResource SukiPrimaryColor0}"
Expand All @@ -49,18 +44,16 @@
<BrushTransition Property="BorderBrush" Duration="0:0:0.15" />
</Transitions>
</Border.Transitions>
<ContentPresenter Name="PART_CP" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" />
<ContentPresenter Name="PART_CP" Margin="{TemplateBinding Padding}"
Content="{TemplateBinding Content}" />
</Border>
</Panel>
</ControlTemplate>
</Setter>


<Style Selector="^.Control">
<Setter Property="IsAnimated" Value="False"></Setter>
<Setter Property="Padding" Value="0"></Setter>
</Style>

<Style Selector="^.Discrete">
<Setter Property="BorderBrush" Value="{DynamicResource SukiControlBorderBrush}" />
<Setter Property="Padding" Value="0"></Setter>
Expand All @@ -69,14 +62,10 @@
<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">
<Setter Property="BorderBrush" Value="{DynamicResource SukiAccentColor0}" />
</Style>
Expand All @@ -102,12 +91,10 @@
<Style Selector="^.Primary /template/ Border#PART_BorderCard">
<Setter Property="Background" Value="{DynamicResource SukiPrimaryColor25}" />
</Style>

<Style Selector="^.PrimaryOpaque /template/ Border#PART_BorderCard">
<Setter Property="Opacity" Value="1"/>
<Setter Property="Opacity" Value="1" />
<Setter Property="Background" Value="{DynamicResource SukiPrimaryColor}" />
</Style>

<Style Selector="^[IsVisible=True] /template/ Panel#RootPanel">
<Setter Property="Opacity" Value="1" />
</Style>
Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Controls/SukiBackground.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class SukiBackground : Control
{
public static readonly StyledProperty<SukiBackgroundStyle> StyleProperty =
AvaloniaProperty.Register<SukiWindow, SukiBackgroundStyle>(nameof(Style),
defaultValue: SukiBackgroundStyle.Bubble);
defaultValue: SukiBackgroundStyle.Gradient);

/// <summary>
/// Which of the default background styles to use - DEFAULT: Gradient
Expand Down
6 changes: 3 additions & 3 deletions SukiUI/Controls/SukiToast.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<Panel Margin="0">
<Panel.Background>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
<GradientStop Offset="0" Color="{DynamicResource SukiAccentColor5}" />
<GradientStop Offset="0" Color="{DynamicResource SukiPrimaryColor5}" />
<GradientStop Offset="1" Color="{DynamicResource SukiPrimaryColor10}" />
</LinearGradientBrush>
</Panel.Background>
Expand All @@ -34,8 +34,8 @@
<Panel Margin="0">
<Panel.Background>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
<GradientStop Offset="0" Color="{DynamicResource SukiAccentColor3}" />
<GradientStop Offset="1" Color="{DynamicResource SukiPrimaryColor3}" />
<GradientStop Offset="0" Color="{DynamicResource SukiAccentColor1}" />
<GradientStop Offset="1" Color="{DynamicResource SukiPrimaryColor1}" />
</LinearGradientBrush>
</Panel.Background>
</Panel>
Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Controls/SukiWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public bool BackgroundAnimationEnabled

public static readonly StyledProperty<SukiBackgroundStyle> BackgroundStyleProperty =
AvaloniaProperty.Register<SukiWindow, SukiBackgroundStyle>(nameof(BackgroundStyle),
defaultValue: SukiBackgroundStyle.Bubble);
defaultValue: SukiBackgroundStyle.Gradient);

/// <inheritdoc cref="SukiBackground.Style"/>
public SukiBackgroundStyle BackgroundStyle
Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Theme/ContextMenu.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ControlTheme x:Key="SukiContextMenuStyle" TargetType="ContextMenu">
<Setter Property="Background" Value="{DynamicResource SukiCardBackground}" />
<Setter Property="CornerRadius" Value="6" />
<Setter Property="BorderBrush" Value="{DynamicResource SukiLightBorderBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource SukiMenuBorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<ControlTemplate>
Expand Down
4 changes: 2 additions & 2 deletions SukiUI/Theme/Menu.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Border Name="root"
Margin="5,5"
Background="{TemplateBinding Background}"
BorderBrush="{DynamicResource SukiLightBorderBrush}"
BorderBrush="{DynamicResource SukiMenuBorderBrush}"
BorderThickness="0"
CornerRadius="8">
<Panel>
Expand Down Expand Up @@ -49,7 +49,7 @@
<Border Name="PART_Border"
Margin="16,8,8,8"
Background="{DynamicResource SukiCardBackground}"
BorderBrush="{DynamicResource SukiLightBorderBrush}"
BorderBrush="{DynamicResource SukiMenuBorderBrush}"
BorderThickness="1"
BoxShadow="{DynamicResource SukiPopupShadow}"
ClipToBounds="True"
Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Theme/MenuFlyoutPresenter.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ControlTheme x:Key="SukiMenuFlyoutPresenterStyle" TargetType="MenuFlyoutPresenter">
<Setter Property="Background" Value="{DynamicResource SukiCardBackground}" />
<Setter Property="CornerRadius" Value="6" />
<Setter Property="BorderBrush" Value="{DynamicResource SukiLightBorderBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource SukiMenuBorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<ControlTemplate>
Expand Down
3 changes: 2 additions & 1 deletion SukiUI/Theme/MenuItem.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<converters:PlatformKeyGestureConverter x:Key="KeyGestureConverter" />

<ControlTheme x:Key="SukiMenuItemStyle" TargetType="MenuItem">

<Setter Property="Background" Value="{DynamicResource SukiBackground}" />
<Setter Property="BorderThickness" Value="1.5" />
<Setter Property="FontSize" Value="14" />
Expand Down Expand Up @@ -77,7 +78,7 @@
<Border Name="PART_Border"
Margin="16,8,8,8"
Background="{DynamicResource SukiCardBackground}"
BorderBrush="{DynamicResource SukiLightBorderBrush}"
BorderBrush="{DynamicResource SukiMenuBorderBrush}"
BorderThickness="1"
BoxShadow="{DynamicResource SukiPopupShadow}"
ClipToBounds="True"
Expand Down
7 changes: 0 additions & 7 deletions docs/docs/documentation/controls/inputs/radiobutton.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ A control used for collecting the user's choice.

![{3562E3E6-C5A7-4D5C-BB1A-BF95347A6AA3}](https://github.com/user-attachments/assets/3157a435-10dd-4d84-ac91-e83739023ee9)



```xml
<RadioButton Content="Option One"
GroupName="A"
Expand All @@ -18,8 +16,6 @@ A control used for collecting the user's choice.

![{6BB65B0C-C0E8-4F6E-ADC0-EB29FFDD93DA}](https://github.com/user-attachments/assets/7d573d74-65b0-4379-a4b7-2830bfd381cf)



```xml
<RadioButton Classes="Chips" Content="Option One" IsChecked="True" />
```
Expand All @@ -28,9 +24,6 @@ A control used for collecting the user's choice.

![{466C440E-25EE-4CF1-985F-EC8105043D22}](https://github.com/user-attachments/assets/aea0e668-c02c-432c-9f3f-e8621e726444)




```xml
<RadioButton Classes="GigaChips" Content="Option One" IsChecked="True" />
```
Expand Down
Loading

0 comments on commit 647e180

Please sign in to comment.