From 1397be38ca2caaf5c49ca51e164a28b63f9e461b Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 21 Oct 2021 19:06:22 +0700 Subject: Implement `Widget::draw` for `Checkbox` --- native/src/renderer/null.rs | 4 ++++ native/src/renderer/text.rs | 13 +++++++++++++ 2 files changed, 17 insertions(+) (limited to 'native/src/renderer') diff --git a/native/src/renderer/null.rs b/native/src/renderer/null.rs index 010305a2..351f6233 100644 --- a/native/src/renderer/null.rs +++ b/native/src/renderer/null.rs @@ -35,6 +35,10 @@ impl Renderer for Null { impl renderer::Text for Null { type Font = Font; + const ICON_FONT: Font = Font::Default; + const CHECKMARK_ICON: char = '0'; + const ARROW_DOWN_ICON: char = '0'; + fn default_size(&self) -> u16 { 20 } diff --git a/native/src/renderer/text.rs b/native/src/renderer/text.rs index 80769b62..fbf116a1 100644 --- a/native/src/renderer/text.rs +++ b/native/src/renderer/text.rs @@ -7,6 +7,19 @@ pub trait Text: Renderer { /// The font type used. type Font: Default + Copy; + /// The icon font of the backend. + const ICON_FONT: Self::Font; + + /// The `char` representing a ✔ icon in the [`ICON_FONT`]. + /// + /// [`ICON_FONT`]: Self::ICON_FONT + const CHECKMARK_ICON: char; + + /// The `char` representing a ▼ icon in the built-in [`ICON_FONT`]. + /// + /// [`ICON_FONT`]: Self::ICON_FONT + const ARROW_DOWN_ICON: char; + /// Returns the default size of [`Text`]. fn default_size(&self) -> u16; -- cgit