Convert Renderer::Theme to generic Widget type

This commit is contained in:
Héctor Ramón Jiménez 2024-01-21 17:56:01 +01:00
parent 545cc909c9
commit 7a50e9e8fb
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
88 changed files with 1219 additions and 1153 deletions

View file

@ -5,7 +5,7 @@ use iced::widget::{
scrollable, slider, text, text_input, toggler, vertical_space,
};
use iced::widget::{Button, Column, Container, Slider};
use iced::{Color, Element, Font, Length, Pixels, Renderer, Sandbox, Settings};
use iced::{Color, Element, Font, Length, Pixels, Sandbox, Settings};
pub fn main() -> iced::Result {
#[cfg(target_arch = "wasm32")]
@ -697,7 +697,7 @@ fn button<'a, Message: Clone>(label: &str) -> Button<'a, Message> {
fn color_slider<'a>(
component: f32,
update: impl Fn(f32) -> Color + 'a,
) -> Slider<'a, f64, StepMessage, Renderer> {
) -> Slider<'a, f64, StepMessage> {
slider(0.0..=1.0, f64::from(component), move |c| {
StepMessage::TextColorChanged(update(c as f32))
})