1use crate::gui::TEXT_SIZE_ICON;
2use eframe::egui::{FontFamily, FontId, RichText, WidgetText};
3
4pub const VERSION: &str = env!("CARGO_PKG_VERSION");
5
6pub const IMAGE_FIXATION: &[u8] = include_bytes!("images/fixation.svg");
7pub const IMAGE_RUSTACEAN: &[u8] = include_bytes!("images/rustacean.svg");
8
9pub const FONT_ICONS_BRANDS: &[u8] = include_bytes!("fonts/fa-6-brands-regular-400.otf");
10pub const FONT_ICONS_REGULAR: &[u8] = include_bytes!("fonts/fa-6-free-regular-400.otf");
11pub const FONT_ICONS_SOLID: &[u8] = include_bytes!("fonts/fa-6-free-solid-900.otf");
12
13pub enum Icon {
14 Help,
15 SystemInfo,
16 Clipboard,
17 Close,
18 Folder,
19 FolderTree,
20 MagnifyingGlass,
21}
22impl Icon {
23 pub fn size(self, size: f32) -> RichText {
24 RichText::from(self).size(size)
25 }
26}
27impl From<Icon> for RichText {
28 fn from(icon: Icon) -> Self {
29 RichText::new(match icon {
30 Icon::Help => "\u{f059}",
31 Icon::SystemInfo => "\u{f05a}",
32 Icon::Clipboard => "\u{f328}",
33 Icon::Close => "\u{f00d}",
34 Icon::Folder => "\u{f07b}",
35 Icon::FolderTree => "\u{f802}",
36 Icon::MagnifyingGlass => "\u{f002}",
37 })
38 .font(FontId::new(
39 TEXT_SIZE_ICON,
40 FontFamily::Name("fa_free".into()),
41 ))
42 }
43}
44impl From<Icon> for WidgetText {
45 fn from(icon: Icon) -> Self {
46 RichText::from(icon).into()
47 }
48}