Skip to content

Commit 833c01d

Browse files
author
eriklimakc
committed
fix: Improving Neumorphic ToggleSwitch
1 parent 91e7aa0 commit 833c01d

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Uno.Gallery/Uno.Gallery.Shared/Views/SamplePages/ShadowContainerSamplePage.xaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,13 +688,17 @@
688688
<StackPanel Spacing="20"
689689
Orientation="Vertical">
690690
<!-- Enabled -->
691+
<TextBlock Text="Enabled"
692+
Style="{StaticResource BodyMedium}" />
693+
694+
<ToggleSwitch Style="{StaticResource NeumorphicToggleSwitchStyle}"
695+
IsOn="True" />
691696
<ToggleSwitch Style="{StaticResource NeumorphicToggleSwitchStyle}" />
692-
<ToggleSwitch Style="{StaticResource NeumorphicToggleSwitchStyle}">
697+
<ToggleSwitch Style="{StaticResource NeumorphicToggleSwitchStyle}"
698+
IsOn="True">
693699
<ToggleSwitch.OnContent>
694700
<PathIcon Data="M0.166992 3.99997L1.50033 5.3333C4.81366 2.01997 10.187 2.01997 13.5003 5.3333L14.8337 3.99997C10.787 -0.0467007 4.22033 -0.0467007 0.166992 3.99997ZM5.50033 9.3333L7.50033 11.3333L9.50032 9.3333C8.40033 8.22663 6.60699 8.22663 5.50033 9.3333ZM2.83366 6.66663L4.16699 7.99997C6.00699 6.15997 8.99366 6.15997 10.8337 7.99997L12.167 6.66663C9.59366 4.0933 5.41366 4.0933 2.83366 6.66663Z" />
695701
</ToggleSwitch.OnContent>
696-
</ToggleSwitch>
697-
<ToggleSwitch Style="{StaticResource NeumorphicToggleSwitchStyle}">
698702
<ToggleSwitch.OffContent>
699703
<PathIcon Data="M14.827 5.00003C12.267 2.44003 8.70033 1.50669 5.39366 2.18669L7.07366 3.86669C9.38699 3.75336 11.7337 4.56669 13.4937 6.33336L14.827 5.00003V5.00003ZM12.1603 7.66669C11.3003 6.80669 10.267 6.24669 9.16699 5.96003L11.5203 8.31336L12.1603 7.66669V7.66669ZM0.833659 1.03336L2.88033 3.06669C1.90033 3.54669 0.980326 4.18669 0.166992 5.00003L1.49366 6.33336C2.32033 5.50669 3.27366 4.89336 4.29366 4.48669L5.78699 5.98003C4.70699 6.26003 3.68033 6.82003 2.83366 7.66669V7.67336L4.16033 9.00003C5.06699 8.09336 6.25366 7.64003 7.44033 7.62669L12.1537 12.3334L13.0003 11.4934L1.69366 0.193359L0.833659 1.03336ZM5.50033 10.3334L7.50033 12.3334L9.50033 10.3334C8.40033 9.22669 6.60699 9.22669 5.50033 10.3334Z" />
700704
</ToggleSwitch.OffContent>
@@ -711,6 +715,9 @@
711715
<StackPanel Spacing="20"
712716
Orientation="Vertical">
713717
<!-- Disabled -->
718+
<TextBlock Text="Disabled"
719+
Style="{StaticResource BodyMedium}" />
720+
714721
<ToggleSwitch Style="{StaticResource NeumorphicToggleSwitchStyle}"
715722
IsEnabled="False"
716723
IsOn="True" />

Uno.Gallery/Uno.Gallery.Shared/Views/Styles/NeumorphicStyles.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3196,7 +3196,8 @@
31963196
<Setter Property="ManipulationMode" Value="System,TranslateX" />
31973197
<Setter Property="FocusVisualMargin" Value="0" />
31983198
<Setter Property="UseSystemFocusVisuals" Value="False" />
3199-
3199+
<Setter Property="MinWidth" Value="0" />
3200+
32003201
<Setter Property="OnContent" Value="{x:Null}" />
32013202
<Setter Property="OffContent" Value="{x:Null}" />
32023203

0 commit comments

Comments
 (0)