summaryrefslogtreecommitdiffstats
path: root/widget/src/checkbox.rs
diff options
context:
space:
mode:
Diffstat (limited to 'widget/src/checkbox.rs')
-rw-r--r--widget/src/checkbox.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/widget/src/checkbox.rs b/widget/src/checkbox.rs
index d7fdf339..0353b3ad 100644
--- a/widget/src/checkbox.rs
+++ b/widget/src/checkbox.rs
@@ -174,12 +174,11 @@ where
tree::State::new(widget::text::State::<Renderer::Paragraph>::default())
}
- fn width(&self) -> Length {
- self.width
- }
-
- fn height(&self) -> Length {
- Length::Shrink
+ fn size(&self) -> Size<Length> {
+ Size {
+ width: self.width,
+ height: Length::Shrink,
+ }
}
fn layout(
@@ -266,7 +265,7 @@ where
style: &renderer::Style,
layout: Layout<'_>,
cursor: mouse::Cursor,
- _viewport: &Rectangle,
+ viewport: &Rectangle,
) {
let is_mouse_over = cursor.is_over(layout.bounds());
@@ -315,6 +314,7 @@ where
},
bounds.center(),
custom_style.icon_color,
+ *viewport,
);
}
}
@@ -330,6 +330,7 @@ where
crate::text::Appearance {
color: custom_style.text_color,
},
+ viewport,
);
}
}