Skip to content

Commit

Permalink
update to avalonia 11.2 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
kikipoulet committed Aug 23, 2024
1 parent 6839ef8 commit 0038d92
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 62 deletions.
2 changes: 1 addition & 1 deletion SukiUI.Demo/Features/ControlsLibrary/MiscView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</suki:GlassCard>
<suki:GlassCard>
<suki:GroupBox Header="Time Picker">
<TimePicker />
<!-- <TimePicker /> -->
</suki:GroupBox>
</suki:GlassCard>
<suki:GlassCard>
Expand Down
4 changes: 2 additions & 2 deletions SukiUI.Demo/Features/Dashboard/DashboardView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
FontWeight="DemiBold"
Text="Sign-in to your account" />
<TextBlock Margin="6,0,0,3"
FontWeight="DemiBold"
FontWeight="DemiBold" Foreground="{DynamicResource SukiLowText}"
Text="Username" />
<TextBox suki:TextBoxExtensions.Prefix="" Watermark="John" />
<TextBlock Margin="6,18,0,3"
FontWeight="DemiBold"
FontWeight="DemiBold" Foreground="{DynamicResource SukiLowText}"
Text="Password" />
<TextBox Name="PasswordTextBox" Watermark="*******"
Margin="0,0,0,25"
Expand Down
12 changes: 6 additions & 6 deletions SukiUI.Demo/SukiUI.Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.1.2" />
<PackageReference Include="Avalonia" Version="11.2.0-beta1" />
<PackageReference Include="Avalonia.AvaloniaEdit" Version="11.1.0" />
<PackageReference Include="Avalonia.Controls.ColorPicker" Version="11.1.2" />
<PackageReference Include="Avalonia.Desktop" Version="11.1.2" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.2" />
<PackageReference Include="Avalonia.Controls.ColorPicker" Version="11.2.0-beta1" />
<PackageReference Include="Avalonia.Desktop" Version="11.2.0-beta1" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.0-beta1" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.0" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.2" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.0-beta1" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.0-beta1" />
<PackageReference Include="AvaloniaEdit.TextMate" Version="11.1.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Dock.Avalonia" Version="11.1.0.1" />
Expand Down
10 changes: 5 additions & 5 deletions SukiUI.Demo/SukiUIDemoView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<Grid ColumnDefinitions="*,20,*">

<suki:GlassCard CornerRadius="15" Padding="15">
<DockPanel>
<DockPanel FlowDirection="LeftToRight">
<Border Background="{DynamicResource SukiPrimaryColor}" Height="35" Padding="0" CornerRadius="100" Width="35">
<avalonia:MaterialIcon Height="20" Width="20" Kind="Wifi" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"></avalonia:MaterialIcon>
</Border>
Expand All @@ -70,7 +70,7 @@
</DockPanel>
</suki:GlassCard>
<suki:GlassCard Grid.Column="2" CornerRadius="15" Padding="15">
<DockPanel>
<DockPanel FlowDirection="LeftToRight">
<suki:GlassCard Height="35" Padding="0" CornerRadius="100" Width="35">
<avalonia:MaterialIcon Height="20" Width="20" HorizontalAlignment="Center" VerticalAlignment="Center" Kind="Bluetooth" Foreground="{DynamicResource SukiText}"></avalonia:MaterialIcon>
</suki:GlassCard>
Expand All @@ -82,8 +82,8 @@

<suki:GlassCard CornerRadius="15" Padding="15">

<DockPanel>
<TextBlock Text="Volume" Margin="0,0,0,10" FontSize="15"
<DockPanel FlowDirection="LeftToRight">
<TextBlock Text="Volume" Margin="0,0,0,10" FontSize="15"
DockPanel.Dock="Top" FontWeight="DemiBold"
VerticalAlignment="Center" />
<avalonia:MaterialIcon DockPanel.Dock="Left" Foreground="{DynamicResource SukiLowText}" Kind="VolumeLow"> </avalonia:MaterialIcon>
Expand All @@ -94,7 +94,7 @@
</suki:GlassCard>

<suki:GlassCard CornerRadius="15" Padding="15">
<DockPanel>
<DockPanel FlowDirection="LeftToRight">
<ToggleSwitch VerticalAlignment="Center" DockPanel.Dock="Right" IsChecked="True" />
<TextBlock DockPanel.Dock="Bottom" Text="Disable notifications." Margin="0,8,0,0"
Foreground="{DynamicResource SukiLowText}"
Expand Down
19 changes: 5 additions & 14 deletions SukiUI.Dock/DocumentTabStripItem.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:core="using:Dock.Model.Core"
xmlns:suki="https://github.com/kikipoulet/SukiUI"
x:CompileBindings="True">
<Design.PreviewWith>
<Border Padding="20">
Expand Down Expand Up @@ -58,21 +59,11 @@
<Border Name="SelectedBorder" IsVisible="False"
Margin="6,0"
Padding="0"
BoxShadow="{DynamicResource SukiSmallPopupShadow}"
Background="{DynamicResource SukiCardBackground}"

CornerRadius="8">
<Border CornerRadius="8" ClipToBounds="True">
<Panel>
<Panel Margin="0">
<Panel.Background>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
<GradientStop Color="{DynamicResource SukiAccentColor5}" Offset="0"></GradientStop>
<GradientStop Color="{DynamicResource SukiPrimaryColor5}" Offset="1"></GradientStop>
</LinearGradientBrush>
</Panel.Background>
</Panel>
</Panel>
</Border>
<suki:GlassCard Classes="Control" CornerRadius="8">

</suki:GlassCard>
</Border>

<Border Margin="12,4" Background="{TemplateBinding Background}"
Expand Down
2 changes: 1 addition & 1 deletion SukiUI.Dock/HostWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<Setter Property="Background" Value="Transparent" />
<Setter Property="(TextElement.FontSize)" Value="{DynamicResource DockFontSizeNormal}" />
<Setter Property="FontFamily" Value="{TemplateBinding FontFamily}" />
<!-- <Setter Property="FontFamily" Value="{TemplateBinding FontFamily}" /> -->
<Setter Property="TextBlock.Foreground" Value="{DynamicResource DockThemeForegroundBrush}" />
<Setter Property="WindowState" Value="Normal" />
<Setter Property="UseLayoutRounding" Value="True" />
Expand Down
19 changes: 5 additions & 14 deletions SukiUI.Dock/ToolTabStripItem.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:dmc="using:Dock.Model.Controls"
xmlns:suki="https://github.com/kikipoulet/SukiUI"
x:CompileBindings="True">
<Design.PreviewWith>
<Border Padding="20">
Expand Down Expand Up @@ -61,21 +62,11 @@
<Border Name="SelectedBorder" IsVisible="False"
Margin="6,0"
Padding="0"
BoxShadow="{DynamicResource SukiSmallPopupShadow}"
Background="{DynamicResource SukiCardBackground}"

CornerRadius="8">
<Border CornerRadius="8" ClipToBounds="True">
<Panel>
<Panel Margin="0">
<Panel.Background>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
<GradientStop Color="{DynamicResource SukiAccentColor5}" Offset="0"></GradientStop>
<GradientStop Color="{DynamicResource SukiPrimaryColor5}" Offset="1"></GradientStop>
</LinearGradientBrush>
</Panel.Background>
</Panel>
</Panel>
</Border>
<suki:GlassCard Classes="Control" CornerRadius="8" >

</suki:GlassCard>
</Border>
<Border Margin="12,4" Background="{TemplateBinding Background}"
TextElement.FontFamily="{TemplateBinding FontFamily}"
Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Content/Shaders/Background/bubble.sksl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ vec4 main(vec2 fragCoord) {
float opacityLayer2 = 0.85 - (iDark / 2);


float iPrimaryOpacity = 1.1; // Exemple de nouvelle opacité pour iPrimary
float iPrimaryOpacity = 1.1;
if (iDark == 1) {
iPrimaryOpacity = 0.52;
}
Expand Down
4 changes: 2 additions & 2 deletions SukiUI/Content/Shaders/Background/gradient.sksl
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ vec4 main(vec2 fragCoord) {

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


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

Expand Down
3 changes: 3 additions & 0 deletions SukiUI/Controls/Hosts/SukiToastHost.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
<Setter Property="Margin" Value="5"/>
<Setter Property="ItemsPanel">
<ItemsPanelTemplate>
<!--
<DockPanel VerticalAlignment="{TemplateBinding VerticalAlignment}" LastChildFill="True" />
-->
<DockPanel LastChildFill="True" />
</ItemsPanelTemplate>
</Setter>
<Setter Property="Template">
Expand Down
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) ? 52 : ((r == maxValue) ? 52 : 30);
g = (g == minValue) ? 52 : ((g == maxValue) ? 52 : 30);
b = (b == minValue) ? 52 : ((b == maxValue) ? 52 : 30);
r = (r == minValue) ? 47 : ((r == maxValue) ? 47 : 27);
g = (g == minValue) ? 47 : ((g == maxValue) ? 47 : 27);
b = (b == minValue) ? 47 : ((b == maxValue) ? 47 : 27);
return new Color(255, (byte)r, (byte)g, (byte)b);
}
}
Expand Down
8 changes: 4 additions & 4 deletions SukiUI/SukiUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.1.2" />
<PackageReference Include="Avalonia.Skia" Version="11.1.2" />
<PackageReference Include="Avalonia" Version="11.2.0-beta1" />
<PackageReference Include="Avalonia.Skia" Version="11.2.0-beta1" />
<PackageReference Include="SkiaSharp" Version="2.88.8" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.1.2" />
<PackageReference Include="Avalonia.Themes.Simple" Version="11.1.0" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.2.0-beta1" />
<PackageReference Include="Avalonia.Themes.Simple" Version="11.2.0-beta1" />
<PackageReference Include="ReactiveUI" Version="20.1.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Theme/FlyoutPresenter.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="TextElement.Foreground" Value="{DynamicResource SukiText}"/>
<Setter Property="Cursor" Value="Arrow"/>
<Setter Property="FlowDirection" Value="{TemplateBinding FlowDirection}"/>
<!-- <Setter Property="FlowDirection" Value="{TemplateBinding FlowDirection}"/> -->
<Setter Property="Template">
<ControlTemplate>
<Border Name="LayoutRoot"
Expand Down
11 changes: 9 additions & 2 deletions SukiUI/Theme/Menu.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
BorderThickness="0"
CornerRadius="8">
<Panel>
<controls:GlassCard CornerRadius="8" Opacity="0" Name="GlassMenuItemBackground" Classes="Control">
<controls:GlassCard.Transitions>
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.15"></DoubleTransition>
</Transitions>
</controls:GlassCard.Transitions>
</controls:GlassCard>
<ContentPresenter Name="PART_HeaderPresenter"
Margin="{TemplateBinding Padding}"
HorizontalContentAlignment="Left"
Expand Down Expand Up @@ -62,8 +69,8 @@
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SukiLightBorderBrush}" />
<Style Selector="^:pointerover /template/ controls|GlassCard#GlassMenuItemBackground">
<Setter Property="Opacity" Value="1" />
</Style>

<Style Selector="^:open /template/ LayoutTransformControl#PART_LayoutTransform">
Expand Down
12 changes: 6 additions & 6 deletions SukiUI/Theme/TimePickerStyle.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</Border>
</Design.PreviewWith>

<x:Double x:Key="TimePickerFlyoutPresenterItemHeight">40</x:Double>
<!-- <x:Double x:Key="TimePickerFlyoutPresenterItemHeight">40</x:Double>
<x:Double x:Key="TimePickerSpacerThemeWidth">1</x:Double>
<Thickness x:Key="TimePickerBorderThemeThickness">1</Thickness>
<x:Double x:Key="TimePickerFlyoutPresenterHighlightHeight">40</x:Double>
Expand Down Expand Up @@ -96,7 +96,7 @@
Foreground="{DynamicResource SukiLowText}" />
<Grid Name="PART_FlyoutButtonContentGrid">
<!-- Ignore col defs here, set in code -->
<Border x:Name="PART_FirstPickerHost"
Grid.Column="0"
HorizontalAlignment="Stretch"
Expand Down Expand Up @@ -239,7 +239,7 @@
</Setter>
</Style>
</Grid.Styles>
<!-- Ignore col defs here, set in code -->
<Panel Name="PART_HourHost" Grid.Column="0">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
<DateTimePickerPanel Name="PART_HourSelector"
Expand Down Expand Up @@ -328,7 +328,7 @@
Text="Apply" />
</StackPanel>
</Button>
<!-- <Button Name="PART_DismissButton"
<Button Name="PART_DismissButton"
Grid.Column="1"
Height="{DynamicResource TimePickerFlyoutPresenterAcceptDismissHostGridHeight}"
HorizontalAlignment="Stretch"
Expand All @@ -339,7 +339,7 @@
Stroke="{Binding $parent[Button].Foreground}"
StrokeLineCap="Round"
StrokeThickness="0.75" />
</Button>-->
</Button>
</Grid>
</Grid>
</Border>
Expand All @@ -351,5 +351,5 @@
<Setter Property="IsVisible" Value="True" />
</Style>
</Style>
</ControlTheme>
</ControlTheme> -->
</ResourceDictionary>

0 comments on commit 0038d92

Please sign in to comment.