pop-os / libcosmic

WIP library for COSMIC applications
https://pop-os.github.io/libcosmic/cosmic/
Mozilla Public License 2.0
473 stars 49 forks source link

Toggler can't be in disabled state #640

Closed bhh32 closed 1 month ago

bhh32 commented 1 month ago

A button is in a disabled state if you do not add the on_press() function when building it. I've used this quite a lot in a couple of projects I'm working on. However, I ran into a situation where I needed to do something similar with a toggler and cannot put the toggler in a disabled state. When creating the toggler the message (for the Fn Message parameter) is required, and so there is no way to put it in a disabled state if it's needed.

wiiznokes commented 1 month ago

This is implemented in upstream Iced + the api got better :) https://github.com/iced-rs/iced/blob/master/widget/src/toggler.rs

git-f0x commented 1 month ago

This can possibly be closed now, since libcosmic was rebased to latest iced.