Skip to content

Commit

Permalink
toast better background
Browse files Browse the repository at this point in the history
  • Loading branch information
kikipoulet committed May 25, 2024
1 parent cf80f3d commit 9a06c7f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 deletions.
34 changes: 29 additions & 5 deletions SukiUI/Controls/SukiToast.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,34 @@
<Setter Property="Template">
<ControlTemplate>
<Border Name="PART_ToastCard"
Width="300"
Width="300"
Margin="30,5,30,10"
Padding="0"
Padding="0" BorderThickness="1" BorderBrush="{DynamicResource SukiBorderBrush}"
BoxShadow="{DynamicResource SukiPopupShadow}"
Classes="Card"
CornerRadius="2">
<DockPanel Margin="0,-7" LastChildFill="True">
Background="{DynamicResource SukiCardBackground}"
CornerRadius="15">
<Border CornerRadius="15" ClipToBounds="True">
<Panel>

<Panel Margin="0">
<Panel.Background>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
<GradientStop Color="{DynamicResource SukiPrimaryColor7}" Offset="1"></GradientStop>
<GradientStop Color="Transparent" Offset="0"></GradientStop>
</LinearGradientBrush>
</Panel.Background>
</Panel>
<Panel Margin="0">
<Panel.Background>
<LinearGradientBrush StartPoint="0%,50%" EndPoint="100%,50%">
<GradientStop Color="{DynamicResource SukiAccentColor7}" Offset="0"></GradientStop>
<GradientStop Color="Transparent" Offset="1"></GradientStop>
</LinearGradientBrush>
</Panel.Background>
</Panel>
<Panel Margin="20, 22">

<DockPanel Margin="0,-7" LastChildFill="True">
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
<PathIcon Width="16" Margin="-6,0,0,0"
Height="16"
Expand All @@ -32,6 +53,9 @@
Foreground="{DynamicResource SukiText}"
TextWrapping="Wrap" />
</DockPanel>
</Panel>
</Panel>
</Border>
</Border>
</ControlTemplate>
</Setter>
Expand Down
2 changes: 1 addition & 1 deletion SukiUI/Theme/BorderStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Orientation="Horizontal">
<Border Width="100"
Height="100"
Classes="Card" />
Classes="GradientCard" />
</WrapPanel>
</Design.PreviewWith>

Expand Down
1 change: 1 addition & 0 deletions SukiUI/Theme/Index.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ private void SetColorWithOpacities(string baseName, Color baseColor)
SetResource($"{baseName}25", baseColor.WithAlpha(0.25));
SetResource($"{baseName}15", baseColor.WithAlpha(0.15));
SetResource($"{baseName}10", baseColor.WithAlpha(0.10));
SetResource($"{baseName}7", baseColor.WithAlpha(0.07));
SetResource($"{baseName}5", baseColor.WithAlpha(0.05));
SetResource($"{baseName}0", baseColor.WithAlpha(0.00));
}
Expand Down
8 changes: 6 additions & 2 deletions SukiUI/Theme/NotificationCardStyle.axaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Styles 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:controls="clr-namespace:SukiUI.Controls">
<Design.PreviewWith>
<Border Padding="0" Background="{DynamicResource SukiBackground}">
<NotificationCard Content="Testing" />
Expand Down Expand Up @@ -30,7 +31,9 @@
BorderThickness="{TemplateBinding BorderThickness}"
ClipToBounds="True"
CornerRadius="10">
<DockPanel>
<Panel>

<DockPanel>
<PathIcon Margin="11,11,5,5"
VerticalAlignment="Top"
Data="{x:Static content:Icons.CircleInformation}"
Expand All @@ -43,6 +46,7 @@
DockPanel.Dock="Top" />
<ContentControl Name="PART_Content" Content="{TemplateBinding Content}" />
</DockPanel>
</Panel>
</Border>
</Border>
</LayoutTransformControl>
Expand Down

0 comments on commit 9a06c7f

Please sign in to comment.