Uno.Themes icon indicating copy to clipboard operation
Uno.Themes copied to clipboard

Add Material 3 ToggleSwitch Styles

Open kazo0 opened this issue 2 years ago • 1 comments

image

https://m3.material.io/components/switch/overview

kazo0 avatar Jun 06 '22 13:06 kazo0

Waiting for proper final specs and guidelines as of now until I can start creating the new styles (cc @kazo0, @NVLudwig)

agneszitte avatar Sep 09 '22 16:09 agneszitte

Checking with @NVLudwig and @kazo0 if there is still some work to do for this item

agneszitte avatar Jan 26 '23 22:01 agneszitte

I don't think any work has been started on the Themes side of things for M3 switches, unless I am forgetting about it

kazo0 avatar Jan 26 '23 23:01 kazo0

@NVLudwig is there a branch of the Figma file that has the new ToggleSwitch styles?

kazo0 avatar May 26 '23 13:05 kazo0

I sent you this rebuild one to review a few months back. It doesn't have labels or headers (what are your thoughts about that?

https://www.figma.com/file/trM3i5qUPmFBcnxWXXmnuF/branch/ncHDud1NhKKKmDZtGg8Ryj/Uno-Platform-Material-Toolkit?type=design&node-id=3036%3A47488&t=q0x6WsPkl1AnEoF6-1

NVLudwig avatar May 26 '23 13:05 NVLudwig

Should we create a new ToggleSwitchExtensions to handle the Icons with DP?

image

It should have OnIcon and OffIcon. Maybe OnIconVisible and OffIconVisible DPs to handle icons visibility?

@kazo0 @agneszitte @Xiaoy312

eriklimakc avatar Jun 08 '23 13:06 eriklimakc

We already ghave an Icon in ControlExtensions... And this is lower priority for me unless Steve thinks we should tackle it now.

francoistanguay avatar Jun 08 '23 17:06 francoistanguay

Would be good to get this unblocked so we can close out M3 ToggleSwitches

@eriklimakc Perhaps we can just use the OnContent and OffContent from the WinUI ToggleSwitch API for this purpose. Instead of it showing as a label next to the switch, you can set it as content that will display within the thumb for the Material style.

Would be odd looking if someone tried to set it to text but we can document the difference in suggested usage

Thoughts @agneszitte / @Xiaoy312?

If we can't decide on something now that wouldn't require more work then let's just not deal with icons until another time

kazo0 avatar Jun 12 '23 22:06 kazo0

It works in my tests, but when OnContent and/or OffContent are not set, the default values are 'On' and 'Off' respectively. To avoid displaying 'On' and 'Off' in the thumb, we may need a converter.

https://github.com/unoplatform/Uno.Themes/assets/114886335/0af0d424-f7e8-4ce1-95c7-ec200b19263e

@kazo0 @agneszitte @Xiaoy312

eriklimakc avatar Jun 13 '23 14:06 eriklimakc

if you are deciding to use On/OffContent properties to let users customize the icons within the toggle, then the base style for this "icon" ToggleButton, should have setters for these 2 properties as null by default (or, set to a generic icon that would result in the "Without icons" visual) there shouldnt be any need of converter here

Xiaoy312 avatar Jun 13 '23 18:06 Xiaoy312

as for replacing the original functionality... it wasnt particularly useful to have "on" and "off" text beside the toggle not denying it is use, but it is not something hard to do with binding+converter on the users side plus they would have more control that ways for the text placement + font, and all.

Xiaoy312 avatar Jun 13 '23 18:06 Xiaoy312