From 483a9093aa5ec4ed87514a704c64fea58c68d39e Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:18:22 +0800 Subject: [PATCH] feat: add new Theme - ThemeToggleSwitch. (cherry picked from commit cc001e951e7858372288f91b1fe54a8225974cdc) --- .../Pages/PaletteDemo.axaml | 6 +- .../Pages/SplitViewDemo.axaml | 6 +- .../Themes/ToggleButton.axaml | 37 ---------- .../Themes/ToggleSwitch.axaml | 67 +++++++++++++++++++ demo/Semi.Avalonia.Demo/Views/MainView.axaml | 20 +++--- 5 files changed, 81 insertions(+), 55 deletions(-) delete mode 100644 demo/Semi.Avalonia.Demo/Themes/ToggleButton.axaml create mode 100644 demo/Semi.Avalonia.Demo/Themes/ToggleSwitch.axaml diff --git a/demo/Semi.Avalonia.Demo/Pages/PaletteDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/PaletteDemo.axaml index 64fdd52..ceab5fa 100644 --- a/demo/Semi.Avalonia.Demo/Pages/PaletteDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/PaletteDemo.axaml @@ -17,7 +17,7 @@ - + @@ -34,11 +34,11 @@ PanePlacement="Right"> - + Theme="{DynamicResource SplitViewToggleSwitch}" /> - - + diff --git a/demo/Semi.Avalonia.Demo/Themes/ToggleButton.axaml b/demo/Semi.Avalonia.Demo/Themes/ToggleButton.axaml deleted file mode 100644 index 654cc32..0000000 --- a/demo/Semi.Avalonia.Demo/Themes/ToggleButton.axaml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Themes/ToggleSwitch.axaml b/demo/Semi.Avalonia.Demo/Themes/ToggleSwitch.axaml new file mode 100644 index 0000000..98e1ce6 --- /dev/null +++ b/demo/Semi.Avalonia.Demo/Themes/ToggleSwitch.axaml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Views/MainView.axaml b/demo/Semi.Avalonia.Demo/Views/MainView.axaml index 7dbb6d8..de2b2f5 100644 --- a/demo/Semi.Avalonia.Demo/Views/MainView.axaml +++ b/demo/Semi.Avalonia.Demo/Views/MainView.axaml @@ -15,7 +15,7 @@ - + M12 21.5C10.65 20.65 8.2 20 6.5 20C4.85 20 3.15 20.3 1.75 21.05C1.65 21.1 1.6 21.1 1.5 21.1C1.25 21.1 1 20.85 1 20.6V6C1.6 5.55 2.25 5.25 3 5C4.11 4.65 5.33 4.5 6.5 4.5C8.45 4.5 10.55 4.9 12 6C13.45 4.9 15.55 4.5 17.5 4.5C18.67 4.5 19.89 4.65 21 5C21.75 5.25 22.4 5.55 23 6V20.6C23 20.85 22.75 21.1 22.5 21.1C22.4 21.1 22.35 21.1 22.25 21.05C20.85 20.3 19.15 20 17.5 20C15.8 20 13.35 20.65 12 21.5M12 8V19.5C13.35 18.65 15.8 18 17.5 18C18.7 18 19.9 18.15 21 18.5V7C19.9 6.65 18.7 6.5 17.5 6.5C15.8 6.5 13.35 7.15 12 8M13 11.5C14.11 10.82 15.6 10.5 17.5 10.5C18.41 10.5 19.26 10.59 20 10.78V9.23C19.13 9.08 18.29 9 17.5 9C15.73 9 14.23 9.28 13 9.84V11.5M17.5 11.67C15.79 11.67 14.29 11.93 13 12.46V14.15C14.11 13.5 15.6 13.16 17.5 13.16C18.54 13.16 19.38 13.24 20 13.4V11.9C19.13 11.74 18.29 11.67 17.5 11.67M20 14.57C19.13 14.41 18.29 14.33 17.5 14.33C15.67 14.33 14.17 14.6 13 15.13V16.82C14.11 16.16 15.6 15.83 17.5 15.83C18.54 15.83 19.38 15.91 20 16.07V14.57Z M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z @@ -32,9 +32,9 @@ Theme="{DynamicResource CardBorder}"> - + Theme="{DynamicResource SplitViewToggleSwitch}" />