From 451d899134db853a53fb755015beb1b577ec21af Mon Sep 17 00:00:00 2001 From: Emmanuel Hansen Date: Tue, 8 Sep 2026 12:16:12 +0000 Subject: [PATCH] fluent 2 - fixup toggleswitch --- .../Controls/ToggleSwitch.xaml | 134 +++++++++--------- 1 file changed, 70 insertions(+), 64 deletions(-) diff --git a/src/Avalonia.Themes.Fluent2/Controls/ToggleSwitch.xaml b/src/Avalonia.Themes.Fluent2/Controls/ToggleSwitch.xaml index 3e9f45bd91..4955e44624 100644 --- a/src/Avalonia.Themes.Fluent2/Controls/ToggleSwitch.xaml +++ b/src/Avalonia.Themes.Fluent2/Controls/ToggleSwitch.xaml @@ -1,7 +1,7 @@ + xmlns="https://github.com/avaloniaui" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + x:ClassModifier="internal"> @@ -19,72 +19,77 @@ 0,0,0,4 10 10 - 0 12 14 17 14 - + 154 0,0,0,1 + Track is 40x20 with a 10px corner radius; off = 1px strong stroke over a subtle alt fill, + on = accent fill with zero stroke. The 12px knob grows to 14px on hover and stretches to a + 17x14 pill anchored to the near track edge while pressed; knob size and slide changes use a + 167ms fast-out-slow-in spline. --> + - - + + - - - + + - - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + @@ -208,7 +214,7 @@ + track (WinUI Pressed state setters). Each knob is only visible in its own state. -->