ghostscope_ui/ui/
symbols.rs1pub struct UISymbols;
3
4impl UISymbols {
5 pub const FILE_FOLDER: &'static str = "π";
7 pub const FILE_FOLDER_ASCII: &'static str = "[DIR]";
8
9 pub const FILE_PACKAGE: &'static str = "π¦";
10 pub const FILE_PACKAGE_ASCII: &'static str = "[PKG]";
11
12 pub const FILE_HEADER: &'static str = "π";
13 pub const FILE_HEADER_ASCII: &'static str = "[H]";
14
15 pub const FILE_SOURCE: &'static str = "π";
16 pub const FILE_SOURCE_ASCII: &'static str = "[C]";
17
18 pub const FILE_RUST: &'static str = "π¦";
19 pub const FILE_RUST_ASCII: &'static str = "[RS]";
20
21 pub const FILE_ASM: &'static str = "π οΈ";
22 pub const FILE_ASM_ASCII: &'static str = "[ASM]";
23
24 pub const FILE_GENERIC: &'static str = "π";
25 pub const FILE_GENERIC_ASCII: &'static str = "[FILE]";
26
27 pub const STATUS_ACTIVE: &'static str = "β
";
29 pub const STATUS_ACTIVE_ASCII: &'static str = "[ON]";
30
31 pub const STATUS_DISABLED: &'static str = "βΈοΈ";
32 pub const STATUS_DISABLED_ASCII: &'static str = "[OFF]";
33
34 pub const STATUS_FAILED: &'static str = "β";
35 pub const STATUS_FAILED_ASCII: &'static str = "[FAIL]";
36
37 pub const STATUS_YES: &'static str = "β
Yes";
38 pub const STATUS_YES_ASCII: &'static str = "[YES]";
39
40 pub const STATUS_NO: &'static str = "β No ";
41 pub const STATUS_NO_ASCII: &'static str = "[NO]";
42
43 pub const NAV_TREE_BRANCH: &'static str = "ββ";
45 pub const NAV_TREE_BRANCH_ASCII: &'static str = "+-";
46
47 pub const NAV_TREE_LAST: &'static str = "ββ";
48 pub const NAV_TREE_LAST_ASCII: &'static str = "\\-";
49
50 pub const NAV_TREE_VERTICAL: &'static str = "β";
51 pub const NAV_TREE_VERTICAL_ASCII: &'static str = "|";
52
53 pub const NAV_TREE_SPACE: &'static str = " ";
54
55 pub const BORDER_HORIZONTAL: &'static str = "β";
57 pub const BORDER_HORIZONTAL_ASCII: &'static str = "-";
58
59 pub const STATS_ICON: &'static str = "π";
61 pub const STATS_ICON_ASCII: &'static str = "[STATS]";
62
63 pub const LIBRARY_ICON: &'static str = "π";
64 pub const LIBRARY_ICON_ASCII: &'static str = "[LIBS]";
65
66 pub fn get_file_icon(extension: &str, use_ascii: bool) -> &'static str {
68 if use_ascii {
69 match extension {
70 "h" | "hpp" | "hh" | "hxx" => Self::FILE_HEADER_ASCII,
71 "c" | "cc" | "cpp" | "cxx" => Self::FILE_SOURCE_ASCII,
72 "rs" => Self::FILE_RUST_ASCII,
73 "s" | "asm" => Self::FILE_ASM_ASCII,
74 _ => Self::FILE_GENERIC_ASCII,
75 }
76 } else {
77 match extension {
78 "h" | "hpp" | "hh" | "hxx" => Self::FILE_HEADER,
79 "c" | "cc" | "cpp" | "cxx" => Self::FILE_SOURCE,
80 "rs" => Self::FILE_RUST,
81 "s" | "asm" => Self::FILE_ASM,
82 _ => Self::FILE_GENERIC,
83 }
84 }
85 }
86
87 pub fn get_status_icon(active: bool, use_ascii: bool) -> &'static str {
88 if use_ascii {
89 if active {
90 Self::STATUS_ACTIVE_ASCII
91 } else {
92 Self::STATUS_DISABLED_ASCII
93 }
94 } else if active {
95 Self::STATUS_ACTIVE
96 } else {
97 Self::STATUS_DISABLED
98 }
99 }
100
101 pub fn get_yes_no_icon(yes: bool, use_ascii: bool) -> &'static str {
102 if use_ascii {
103 if yes {
104 Self::STATUS_YES_ASCII
105 } else {
106 Self::STATUS_NO_ASCII
107 }
108 } else if yes {
109 Self::STATUS_YES
110 } else {
111 Self::STATUS_NO
112 }
113 }
114}