summaryrefslogtreecommitdiffstats
path: root/wgpu/src/renderer
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2019-11-14 06:48:32 +0100
committerLibravatar GitHub <noreply@github.com>2019-11-14 06:48:32 +0100
commitc8d4774704f970bb26eb5d9903b7a741b1c225e3 (patch)
tree1ceabb28d98c4f4cc9a556d2a5328ce8b7163130 /wgpu/src/renderer
parentaf5ec4941270c832557994d9b4cc70ce5feac911 (diff)
parent2c8ba652a7929ac6c2af28ac60a8bd4b8e8e2f10 (diff)
downloadiced-c8d4774704f970bb26eb5d9903b7a741b1c225e3.tar.gz
iced-c8d4774704f970bb26eb5d9903b7a741b1c225e3.tar.bz2
iced-c8d4774704f970bb26eb5d9903b7a741b1c225e3.zip
Merge pull request #56 from hecrj/example/filter-todos
Draw checkmark icon and filter todos
Diffstat (limited to 'wgpu/src/renderer')
-rw-r--r--wgpu/src/renderer/widget/checkbox.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/wgpu/src/renderer/widget/checkbox.rs b/wgpu/src/renderer/widget/checkbox.rs
index c2d7911c..aedb821c 100644
--- a/wgpu/src/renderer/widget/checkbox.rs
+++ b/wgpu/src/renderer/widget/checkbox.rs
@@ -74,14 +74,15 @@ impl checkbox::Renderer for Renderer {
(
Primitive::Group {
primitives: if checkbox.is_checked {
- // TODO: Draw an actual icon
- let (check, _) = text::Renderer::draw(
- self,
- &Text::new("X")
- .horizontal_alignment(HorizontalAlignment::Center)
- .vertical_alignment(VerticalAlignment::Center),
- checkbox_layout,
- );
+ let check = Primitive::Text {
+ content: crate::text::CHECKMARK_ICON.to_string(),
+ font: crate::text::BUILTIN_ICONS,
+ size: checkbox_bounds.height * 0.7,
+ bounds: checkbox_bounds,
+ color: [0.3, 0.3, 0.3].into(),
+ horizontal_alignment: HorizontalAlignment::Center,
+ vertical_alignment: VerticalAlignment::Center,
+ };
vec![checkbox_border, checkbox_box, check, label]
} else {