Skip to content

Commit

Permalink
background simplification and unnoticeable style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kikipoulet committed Aug 22, 2024
1 parent fd9608b commit 6839ef8
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 67 deletions.
4 changes: 2 additions & 2 deletions SukiUI.Demo/Features/ControlsLibrary/CollectionsView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
<suki:GlassCard>
<suki:GroupBox Header="ComboBox">
<showMeTheXaml:XamlDisplay UniqueId="ComboBox">
<ComboBox ItemsSource="{Binding SimpleContent}" SelectedItem="{Binding SelectedSimpleContent}" />
<ComboBox VerticalAlignment="Top" ItemsSource="{Binding SimpleContent}" SelectedItem="{Binding SelectedSimpleContent}" />
</showMeTheXaml:XamlDisplay>
</suki:GroupBox>
</suki:GlassCard>

<suki:GlassCard>
<suki:GroupBox Header="AutoCompleteBox">
<showMeTheXaml:XamlDisplay UniqueId="AutoCompleteBox">
<AutoCompleteBox>
<AutoCompleteBox VerticalAlignment="Top">
<AutoCompleteBox.ItemsSource>
<objectModel:ObservableCollection x:TypeArguments="system:String">
<system:String>USA 1</system:String>
Expand Down
12 changes: 6 additions & 6 deletions SukiUI.Demo/Features/ControlsLibrary/Dialogs/DialogsView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@
<WrapPanel Classes="PageContainer">
<suki:GlassCard>
<suki:GroupBox Header="Standard Dialog">
<Button Margin="15,10,15,0"
<Button VerticalAlignment="Top" Margin="15,10,15,0"
Command="{Binding OpenStandardDialogCommand}"
Content="Show Dialog" />
</suki:GroupBox>
</suki:GlassCard>
<suki:GlassCard>
<suki:GroupBox Header="Multi Option Dialog">
<Button Margin="15,10,15,0"
<Button VerticalAlignment="Top" Margin="15,10,15,0"
Command="{Binding OpenMultiOptionDialogCommand}"
Content="Show Dialog" />
</suki:GroupBox>
</suki:GlassCard>
<suki:GlassCard>
<suki:GroupBox Header="Background Closable Dialog">
<Button Margin="15,10,15,0"
<Button VerticalAlignment="Top" Margin="15,10,15,0"
Command="{Binding OpenBackgroundCloseDialogCommand}"
Content="Show Dialog" />
</suki:GroupBox>
Expand All @@ -54,22 +54,22 @@
<suki:GroupBox Header="Messagebox Style Dialogs">
<StackPanel Spacing="5">
<ComboBox ItemsSource="{Binding NotificationTypes}" SelectedItem="{Binding SelectedType}"/>
<Button Margin="15,10,15,0"
<Button VerticalAlignment="Top" Margin="15,10,15,0"
Command="{Binding OpenMessageBoxStyleDialogCommand}"
Content="Show Dialog" />
</StackPanel>
</suki:GroupBox>
</suki:GlassCard>
<suki:GlassCard>
<suki:GroupBox Header="ViewModel Dialog">
<Button Margin="15,10,15,0"
<Button VerticalAlignment="Top" Margin="15,10,15,0"
Command="{Binding OpenViewModelDialogCommand}"
Content="Show Dialog" />
</suki:GroupBox>
</suki:GlassCard>
<suki:GlassCard>
<suki:GroupBox Header="Window Dialog Demo">
<Button Margin="15,10,15,0"
<Button VerticalAlignment="Top" Margin="15,10,15,0"
Command="{Binding OpenDialogWindowDemoCommand}"
Content="Open" />
</suki:GroupBox>
Expand Down
2 changes: 1 addition & 1 deletion SukiUI.Demo/Features/ControlsLibrary/MiscView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</suki:GlassCard>
<suki:GlassCard>
<suki:GroupBox Header="DropDownButton">
<DropDownButton Content="Click To Open">
<DropDownButton VerticalAlignment="Top" Content="Click To Open">
<DropDownButton.Flyout>
<Flyout>
<Border Padding="10"
Expand Down
28 changes: 14 additions & 14 deletions SukiUI.Demo/Features/ControlsLibrary/PropertyGridView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@
</Style>
</ScrollViewer.Styles>
<StackPanel DataContext="{Binding Form}" Orientation="Vertical">
<TextBox suki:TextBoxExtensions.Prefix="NullableName: " Text="{Binding NullableName}" />
<TextBox suki:TextBoxExtensions.Prefix="NullableDescription: " Text="{Binding NullableDescription}" />
<TextBox suki:TextBoxExtensions.Prefix="NullableBoolean: " Text="{Binding NullableBoolean}" />
<TextBox suki:TextBoxExtensions.Prefix="NullableDateTime: " Text="{Binding NullableDateTime}" />
<TextBox suki:TextBoxExtensions.Prefix="NullableInteger: " Text="{Binding NullableInteger}" />
<TextBox suki:TextBoxExtensions.Prefix="NullableLong: " Text="{Binding NullableLong}" />
<TextBox suki:TextBoxExtensions.Prefix="NullableDecimal: " Text="{Binding NullableDecimal}" />
<TextBox suki:TextBoxExtensions.Prefix="NullableFloat: " Text="{Binding NullableFloat}" />
<TextBox suki:TextBoxExtensions.Prefix="NullableDouble: " Text="{Binding NullableDouble}" />
<TextBox suki:TextBoxExtensions.Prefix="Name: " Text="{Binding Name}" />
<TextBox suki:TextBoxExtensions.Prefix="Integer: " Text="{Binding Integer}" />
<TextBox suki:TextBoxExtensions.Prefix="Decimal: " Text="{Binding Decimal}" />
<TextBox suki:TextBoxExtensions.Prefix="Boolean: " Text="{Binding Boolean}" />
<TextBox suki:TextBoxExtensions.Prefix="DateTime: " Text="{Binding DateTime}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="NullableName: " Text="{Binding NullableName}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="NullableDescription: " Text="{Binding NullableDescription}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="NullableBoolean: " Text="{Binding NullableBoolean}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="NullableDateTime: " Text="{Binding NullableDateTime}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="NullableInteger: " Text="{Binding NullableInteger}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="NullableLong: " Text="{Binding NullableLong}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="NullableDecimal: " Text="{Binding NullableDecimal}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="NullableFloat: " Text="{Binding NullableFloat}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="NullableDouble: " Text="{Binding NullableDouble}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="Name: " Text="{Binding Name}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="Integer: " Text="{Binding Integer}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="Decimal: " Text="{Binding Decimal}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="Boolean: " Text="{Binding Boolean}" />
<TextBox Classes="NoShadow" suki:TextBoxExtensions.Prefix="DateTime: " Text="{Binding DateTime}" />
</StackPanel>
</ScrollViewer>
</suki:GroupBox>
Expand Down
2 changes: 1 addition & 1 deletion SukiUI.Demo/Features/Theming/ThemingView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Margin="10"
Classes="Flat"

Command="{Binding $parent[theming:ThemingView].((theming:ThemingViewModel)DataContext).TryCustomShaderCommand}"
CommandParameter="{Binding}"
Content="{Binding}" />
Expand Down
4 changes: 2 additions & 2 deletions SukiUI/ColorTheme/Dark.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Color x:Key="SukiBackground">Transparent</Color>
<Color x:Key="SukiStrongBackground">#353535</Color>
<Color x:Key="SukiLightBackground">Transparent</Color>
<Color x:Key="SukiCardBackground">#292929</Color>
<Color x:Key="SukiCardBackground">#323232</Color>
<Color x:Key="SukiGlassCardBackground">#49aaaaaa</Color>
<Color x:Key="SukiGlassCardOpaqueBackground">#333333</Color>
<Color x:Key="SukiControlTouchBackground">#505050</Color>
Expand All @@ -27,7 +27,7 @@
<BoxShadows x:Key="SukiBigPopupShadow">1 4 17 0 #111111</BoxShadows>

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

</LinearGradientBrush>
Expand Down
14 changes: 7 additions & 7 deletions SukiUI/Content/Shaders/Background/bubble.sksl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ vec3 blendOverlay(vec3 base, vec3 blend) {

vec3 blendOverlayDark(vec3 base, vec3 blend) {
vec3 result;
result.r = (base.r < 0.5) ? (4 * base.r * blend.r) : (3.5 - 2.0 * (3 - base.r) * (3.5 - blend.r));
result.g = (base.g < 0.5) ? (4 * base.g * blend.g) : (3.5 - 2.0 * (3 - base.g) * (3.5 - blend.g));
result.b = (base.b < 0.5) ? (4 * base.b * blend.b) : (3.5 - 2.0 * (3 - base.b) * (3.5 - blend.b));
result.r = (base.r < 0.5) ? (5 * base.r * blend.r) : (4 - 2.0 * (3 - base.r) * (4 - blend.r));
result.g = (base.g < 0.5) ? (5 * base.g * blend.g) : (4 - 2.0 * (3 - base.g) * (4 - blend.g));
result.b = (base.b < 0.5) ? (5 * base.b * blend.b) : (4 - 2.0 * (3 - base.b) * (4 - blend.b));
return mix(base, clamp(result, 0.0, 1.0), 0.5); // Mélange avec la couleur de base pour réduire l'assombrissement
}

Expand Down Expand Up @@ -66,16 +66,16 @@ vec4 main(vec2 fragCoord) {
float opacityLayer2 = 0.85 - (iDark / 2);


float iPrimaryOpacity = 1; // Exemple de nouvelle opacité pour iPrimary
float iPrimaryOpacity = 1.1; // Exemple de nouvelle opacité pour iPrimary
if (iDark == 1) {
iPrimaryOpacity = 0.28;
iPrimaryOpacity = 0.52;
}
vec3 iPrimaryWithOpacity = iPrimary * iPrimaryOpacity;


float iAccentOpacity = 0.8;
float iAccentOpacity = 1;
if (iDark == 1) {
iAccentOpacity = 0.34;
iAccentOpacity = 0.9;
}
vec3 iAccentWithOpacity = iAccent * iAccentOpacity;

Expand Down
10 changes: 5 additions & 5 deletions SukiUI/Content/Shaders/Background/bubblestrong.sksl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ vec3 blendOverlay(vec3 base, vec3 blend) {

vec3 blendOverlayDark(vec3 base, vec3 blend) {
vec3 result;
result.r = (base.r < 0.5) ? (4 * base.r * blend.r) : (3.5 - 2.0 * (3 - base.r) * (3.5 - blend.r));
result.g = (base.g < 0.5) ? (4 * base.g * blend.g) : (3.5 - 2.0 * (3 - base.g) * (3.5 - blend.g));
result.b = (base.b < 0.5) ? (4 * base.b * blend.b) : (3.5 - 2.0 * (3 - base.b) * (3.5 - blend.b));
result.r = (base.r < 0.5) ? (5 * base.r * blend.r) : (4 - 2.0 * (3 - base.r) * (4 - blend.r));
result.g = (base.g < 0.5) ? (5 * base.g * blend.g) : (4 - 2.0 * (3 - base.g) * (4 - blend.g));
result.b = (base.b < 0.5) ? (5 * base.b * blend.b) : (4 - 2.0 * (3 - base.b) * (4 - blend.b));
return mix(base, clamp(result, 0.0, 1.0), 0.5); // Mélange avec la couleur de base pour réduire l'assombrissement
}

Expand Down Expand Up @@ -68,14 +68,14 @@ vec4 main(vec2 fragCoord) {

float iPrimaryOpacity = 1.1; // Exemple de nouvelle opacité pour iPrimary
if (iDark == 1) {
iPrimaryOpacity = 0.34;
iPrimaryOpacity = 0.52;
}
vec3 iPrimaryWithOpacity = iPrimary * iPrimaryOpacity;


float iAccentOpacity = 1;
if (iDark == 1) {
iAccentOpacity = 0.55;
iAccentOpacity = 0.9;
}
vec3 iAccentWithOpacity = iAccent * iAccentOpacity;

Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Content/Shaders/Background/flat.sksl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
vec4 main(vec2 fragCoord) {

if(iDark == 1)
return vec4(iBase * 0.7, iAlpha);
return vec4(iBase * 1, iAlpha);

return vec4(iBase, iAlpha);
}
14 changes: 7 additions & 7 deletions SukiUI/Content/Shaders/Background/gradient.sksl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ vec3 blendOverlay(vec3 base, vec3 blend) {

vec3 blendOverlayDark(vec3 base, vec3 blend) {
vec3 result;
result.r = (base.r < 0.5) ? (4 * base.r * blend.r) : (3.5 - 2.0 * (3 - base.r) * (3.5 - blend.r));
result.g = (base.g < 0.5) ? (4 * base.g * blend.g) : (3.5 - 2.0 * (3 - base.g) * (3.5 - blend.g));
result.b = (base.b < 0.5) ? (4 * base.b * blend.b) : (3.5 - 2.0 * (3 - base.b) * (3.5 - blend.b));
result.r = (base.r < 0.5) ? (2 * base.r * blend.r) : (4 - 1.5 * (3 - base.r) * (4 - blend.r));
result.g = (base.g < 0.5) ? (2* base.g * blend.g) : (4 - 1.5 * (3 - base.g) * (4 - blend.g));
result.b = (base.b < 0.5) ? (2 * base.b * blend.b) : (4 - 1.5 * (3 - base.b) * (4 - blend.b));
return mix(base, clamp(result, 0.0, 1.0), 0.5); // Mélange avec la couleur de base pour réduire l'assombrissement
}

Expand Down Expand Up @@ -66,16 +66,16 @@ vec4 main(vec2 fragCoord) {
float opacityLayer2 = 0.85 - (iDark / 2);


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


float iAccentOpacity = 0;
float iAccentOpacity = 1;
if (iDark == 1) {
iAccentOpacity = 0;
iAccentOpacity = 1.8;
}
vec3 iAccentWithOpacity = iPrimary * iAccentOpacity;

Expand Down
18 changes: 3 additions & 15 deletions SukiUI/Controls/SukiDialog.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,10 @@
Background="{DynamicResource SukiCardBackground}"
CornerRadius="25">
<Panel>
<Panel IsVisible="{DynamicResource IsDark}" Margin="-5">
<Panel.Background>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
<GradientStop Color="{DynamicResource SukiAccentColor3}" Offset="0"></GradientStop>
<GradientStop Color="{DynamicResource SukiPrimaryColor15}" Offset="1"></GradientStop>
</LinearGradientBrush>
</Panel.Background>
</Panel>
<Panel IsVisible="{DynamicResource IsLight}" Margin="-5">
<Panel.Background>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
<GradientStop Color="{DynamicResource SukiAccentColor5}" Offset="0"></GradientStop>
<GradientStop Color="{DynamicResource SukiPrimaryColor7}" Offset="1"></GradientStop>
</LinearGradientBrush>
</Panel.Background>
<Panel Background="{DynamicResource PopupGradientBrush}" Margin="-5">

</Panel>



<StackPanel Margin="30,30,30,5" IsVisible="{Binding !IsViewModelOnly, RelativeSource={RelativeSource TemplatedParent}}" Spacing="24">
Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Controls/SukiWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</VisualLayerManager.ChromeOverlayLayer>
<Panel x:Name="PART_Root">
<!-- Margin -100 is there to exclude the unwanted bright corners -->
<suki:SukiBackground Name="PART_Background" Margin="-100"
<suki:SukiBackground Name="PART_Background" Margin="-150"
AnimationEnabled="{TemplateBinding BackgroundAnimationEnabled}"
ShaderCode="{TemplateBinding BackgroundShaderCode}"
ShaderFile="{TemplateBinding BackgroundShaderFile}"
Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Enums/SukiBackgroundStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public enum SukiBackgroundStyle
Gradient,
Flat,
Bubble,
BubbleStrong,


}
}
6 changes: 3 additions & 3 deletions SukiUI/Models/SukiColorTheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ private static Color GetBackgroundColor(Color input)
var minValue = Math.Min(Math.Min(r, g), b);
var maxValue = Math.Max(Math.Max(r, g), b);

r = (r == minValue) ? 62 : ((r == maxValue) ? 62 : 45);
g = (g == minValue) ? 62 : ((g == maxValue) ? 62 : 45);
b = (b == minValue) ? 62 : ((b == maxValue) ? 62 : 45);
r = (r == minValue) ? 52 : ((r == maxValue) ? 52 : 30);
g = (g == minValue) ? 52 : ((g == maxValue) ? 52 : 30);
b = (b == minValue) ? 52 : ((b == maxValue) ? 52 : 30);
return new Color(255, (byte)r, (byte)g, (byte)b);
}
}
Expand Down
10 changes: 10 additions & 0 deletions SukiUI/Theme/ToggleSwitchStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
<Setter Property="Template">
<ControlTemplate>
<DockPanel Name="DP">
<DockPanel.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Dark">
<system:Double x:Key="ControlGlassOpacity">0.4</system:Double>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>

</DockPanel.Resources>
<ContentPresenter x:Name="PART_OffContentPresenter"
DockPanel.Dock="Left" Margin="0,0,7,0"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Toasts/SukiToastBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void AddActionButton(object buttonContent, Action<ISukiToast> action, boo
{
Content = buttonContent,
Classes = { flatstyle ?"Flat" : "Basic" },
Margin = flatstyle ? new Thickness(14, 9, 0, 12) : new Thickness(14, -3, 0, 3)
Margin = flatstyle ? new Thickness(14, 9, 0, 12) : new Thickness(14, -3, 0, 2)
};


Expand Down
1 change: 1 addition & 0 deletions SukiUI/Utilities/Effects/SukiEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public override bool Equals(object obj)
}

private static readonly float[] White = { 0.95f, 0.95f, 0.95f };


internal SKShader ToShaderWithUniforms(float timeSeconds, ThemeVariant activeVariant, Rect bounds,
float animationScale, float alpha = 1f)
Expand Down

0 comments on commit 6839ef8

Please sign in to comment.