use iced::widget::Text;
use crate::StyleType;
use crate::gui::styles::style_constants::ICONS;
pub enum Icon {
ArrowBack,
ArrowLeft,
ArrowRight,
ArrowsDown,
AudioHigh,
AudioMute,
Bin,
Book,
BytesThreshold,
Clock,
Copy,
Generals,
Error,
Feedback,
File,
Forbidden,
Funnel,
FunnelX,
FunnelStar,
GitHub,
HalfSun,
Hourglass1,
Hourglass2,
Hourglass3,
Inspect,
Lightning,
Moon,
NewerVersion,
News,
Notification,
OpenLink,
Overview,
PacketsThreshold,
Roadmap,
Settings,
Sniffnet,
Sniffnet1,
Sniffnet2,
Sniffnet3,
Sniffnet4,
SortAscending,
SortDescending,
SortNeutral,
StarEmpty,
StarFull,
Sun,
ThumbnailOpen,
ThumbnailClose,
Warning,
Waves,
Pause,
Resume,
}
impl Icon {
pub fn codepoint(&self) -> char {
match self {
Icon::ArrowBack => 'C',
Icon::ArrowLeft => 'i',
Icon::ArrowRight => 'j',
Icon::ArrowsDown => ':',
Icon::AudioHigh => 'Z',
Icon::AudioMute => 'Y',
Icon::Bin => 'h',
Icon::BytesThreshold => '[',
Icon::Clock => '9',
Icon::Generals => 'Q',
Icon::Error => 'U',
Icon::Feedback => '=',
Icon::File => '8',
Icon::Forbidden => 'x',
Icon::Funnel => 'V',
Icon::FunnelX => ';',
Icon::FunnelStar => '6',
Icon::GitHub => 'H',
Icon::HalfSun => 'K',
Icon::Hourglass1 => '1',
Icon::Hourglass2 => '2',
Icon::Hourglass3 => '3',
Icon::Inspect => '5',
Icon::Lightning => 'z',
Icon::Moon => 'G',
Icon::Notification => '7',
Icon::Overview => 'd',
Icon::PacketsThreshold => '\\',
Icon::Settings => 'a',
Icon::Sniffnet => 'A',
Icon::Sniffnet1 => '!',
Icon::Sniffnet2 => '"',
Icon::Sniffnet3 => '#',
Icon::Sniffnet4 => '$',
Icon::StarEmpty => 'g',
Icon::StarFull => 'X',
Icon::Warning => 'T',
Icon::Waves => 'y',
Icon::Copy => 'u',
Icon::SortAscending => 'm',
Icon::SortDescending => 'l',
Icon::SortNeutral => 'n',
Icon::Sun => 'F',
Icon::OpenLink => 'o',
Icon::ThumbnailOpen => 's',
Icon::ThumbnailClose => 'r',
Icon::Book => 'B',
Icon::Roadmap => '?',
Icon::News => '>',
Icon::NewerVersion => '(',
Icon::Pause => '-',
Icon::Resume => '+',
}
}
pub fn to_text<'a>(&self) -> Text<'a, StyleType> {
Text::new(self.codepoint().to_string()).font(ICONS)
}
pub fn get_hourglass<'a>(num: usize) -> Text<'a, StyleType> {
match num {
2 => Icon::Hourglass2.to_text(),
3 => Icon::Hourglass3.to_text(),
_ => Icon::Hourglass1.to_text(),
}
}
}