diff options
| author | Polesznyák Márk <contact@pml68.dev> | 2025-11-14 13:16:22 +0100 |
|---|---|---|
| committer | Polesznyák Márk <contact@pml68.dev> | 2025-11-14 13:16:22 +0100 |
| commit | f987fc87b906d22e668f636d73c24aa42780b38d (patch) | |
| tree | 868b949c3cac2a177569341d76ce73ef5b0d0828 /src/icon.rs | |
| parent | chore: update deps (diff) | |
| download | iced-builder-f987fc87b906d22e668f636d73c24aa42780b38d.tar.gz | |
chore: update deps
Diffstat (limited to '')
| -rw-r--r-- | src/icon.rs | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/icon.rs b/src/icon.rs index 32aa92b..e51ab90 100644 --- a/src/icon.rs +++ b/src/icon.rs @@ -2,20 +2,31 @@ // Do not edit manually. Source: ../fonts/icons.toml // 0a164ed48e8a0ef9ffb68cfe442a0cabc6c251beb644b51d01da8e5b7fdbd34e use iced::Font; -use iced::widget::text; - -use crate::widget::Text; +use iced::advanced::text::Renderer as TextRenderer; +use iced::widget::{Text, text}; pub const FONT: &[u8] = include_bytes!("../fonts/icons.ttf"); -pub fn copy<'a>() -> Text<'a> { +pub fn copy<'a, Theme, Renderer>() -> Text<'a, Theme, Renderer> +where + Theme: text::Catalog + 'a, + Renderer: TextRenderer<Font = Font> +{ icon("\u{F1C9}") } -pub fn switch<'a>() -> Text<'a> { +pub fn switch<'a, Theme, Renderer>() -> Text<'a, Theme, Renderer> +where + Theme: text::Catalog + 'a, + Renderer: TextRenderer<Font = Font> +{ icon("\u{21C6}") } -fn icon(codepoint: &str) -> Text<'_> { +fn icon<'a, Theme, Renderer>(codepoint: &'a str) -> Text<'a, Theme, Renderer> +where + Theme: text::Catalog + 'a, + Renderer: TextRenderer<Font = Font> +{ text(codepoint).font(Font::with_name("icons")) } |
