B0ney
B0ney
If I recall, this was probably done because `web-sys` had a breaking change in one of its patch releases a few months back.
Rust's `bool` has a `then_some`/`then` method. This can be used with `on_press_maybe` to achieve the same thing: ```rust let enabled = false; button("hi").on_press_maybe(enabled.then_some(Message::Hi)); ```
Ah I see. While you can use variables to help reduce cognitive load in the latter example: ```rust let password_entered = !password.is_empty(); button("Login") .on_press_maybe(password_entered.then_some(Message::Login)) ``` I do think your proposed...
> > I do think your proposed method would definitely improve developer experience. Actually, I really like the explicit separation: > > > > ```rust > > button("Login") > >...
> This might not be the best solution because we would have to clone the option `self.on_press.clone()` every time we wanted to check if it was disabled or not. But...
> I think it's as simple as making `disabled_if` set `on_press` to `None` and the `is_disabled` flag to `true`, then ignore any future `on_press` calls if `is_disabled` is set. Yeah,...
Interesting. Technically, the exported `.it` version has the correct sample rate. It's just that the frequency for exported `.mod` files are always doubled. I did this because samples from `mod`...
Looks like I discovered a transparency bug in `tiny-skia`:  `wgpu`:  sscce: ```rust use iced::widget::container; use iced::widget::progress_bar::Style; use iced::widget::progress_bar; use iced::{Border, Color, Element, Length}; pub...
Does `rustup update` solve the issue?
I don't think this is an optimal fix. Since now the software renderer would redraw everything every update, leading to much higher CPU usage.