oxiced 0.5.1

An iced themeing library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::cell::Cell;

use crate::widgets::oxi_svg::{SvgStyleVariant, svg_from_path};

pub const ICONPATH: Cell<&'static str> = Cell::new("./assets/{}.svg");

fn path<I: ToString>(icon: I) -> String {
    ICONPATH.get().replace("{}", &icon.to_string())
}

pub fn icon_widget<'a, I: ToString>(icon: I) -> iced::widget::Svg<'a> {
    svg_from_path(SvgStyleVariant::Primary, path(icon))
}

pub fn icon_widget_from_plain_path<'a>(plain_path: impl Into<String>) -> iced::widget::Svg<'a> {
    svg_from_path(SvgStyleVariant::Primary, plain_path.into())
}