diff options
author | Colin Reeder <colin@vpzom.click> | 2020-08-08 16:32:21 -0600 |
---|---|---|
committer | Colin Reeder <colin@vpzom.click> | 2020-08-08 16:32:21 -0600 |
commit | 649d33ca68889669d62817765bf8d6a3441b6949 (patch) | |
tree | 2c6ef5db952b3a08112a3e62320ad502324250b3 /icons | |
parent | 643eb3ca33122b094c30d4503b20e8e4d7069345 (diff) |
Use SVG icons instead of emoji
Diffstat (limited to 'icons')
-rw-r--r-- | icons/Cargo.toml | 10 | ||||
-rw-r--r-- | icons/res/notifications-some.svg | 7 | ||||
-rw-r--r-- | icons/res/notifications.svg | 5 | ||||
-rw-r--r-- | icons/res/person.svg | 4 | ||||
-rw-r--r-- | icons/src/lib.rs | 49 |
5 files changed, 75 insertions, 0 deletions
diff --git a/icons/Cargo.toml b/icons/Cargo.toml new file mode 100644 index 0000000..48bb80b --- /dev/null +++ b/icons/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "hitide_icons" +version = "0.1.0" +authors = ["Colin Reeder <colin@vpzom.click>"] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +phf = { version = "0.8.0", features = ["macros"] } diff --git a/icons/res/notifications-some.svg b/icons/res/notifications-some.svg new file mode 100644 index 0000000..5eef1fa --- /dev/null +++ b/icons/res/notifications-some.svg @@ -0,0 +1,7 @@ +<?xml version="1.0"?> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#FF8F00" stroke="#FF8F00"> + <path d="M 14 20 q -2 4 -4 0" /> + <path d="M 14 4 q 2 0 3 2 c 1 1 0 10 5 14 l -20 0 c 5 -4 4 -8 5 -14 q 1 -2 3 -2 c 1 -3 3 -3 4 0 z" stroke-linejoin="round" /> + <line x1="12" y1="7" x2="12" y2="12" stroke-linecap="round" stroke-width="3" stroke="white" /> + <circle cx="12" cy="16.5" r="1.5" stroke="none" fill="white" /> +</svg> diff --git a/icons/res/notifications.svg b/icons/res/notifications.svg new file mode 100644 index 0000000..45a55d1 --- /dev/null +++ b/icons/res/notifications.svg @@ -0,0 +1,5 @@ +<?xml version="1.0"?> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" stroke="black"> + <path d="M 14 4 q 2 0 3 2 c 1 1 0 10 5 14 l -20 0 c 5 -4 4 -8 5 -14 q 1 -2 3 -2 c 1 -3 3 -3 4 0 z" stroke-linejoin="round" /> + <path d="M 14 20 q -2 4 -4 0" /> +</svg> diff --git a/icons/res/person.svg b/icons/res/person.svg new file mode 100644 index 0000000..78d7385 --- /dev/null +++ b/icons/res/person.svg @@ -0,0 +1,4 @@ +<?xml version="1.0"?> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" xmlns:xlink="http://www.w3.org/1999/xlink"> + <path stroke="black" stroke-linejoin="round" d="M 2 21 q 1 -6 9 -8 c -4 -2 -4 -10 1 -10 c 5 0 5 8 1 10 q 8 2 9 8 z" /> +</svg> diff --git a/icons/src/lib.rs b/icons/src/lib.rs new file mode 100644 index 0000000..355e674 --- /dev/null +++ b/icons/src/lib.rs @@ -0,0 +1,49 @@ +pub struct Icon { + pub path: &'static str, + pub content: &'static str, +} + +macro_rules! icons_consts { + ($i:ident => $p:expr) => { + pub const $i: Icon = Icon { + path: $p, + content: include_str!(concat!("../res/", $p)), + }; + }; + ($i1:ident => $p1:expr, $($i2:ident => $p2:expr),+) => { + icons_consts! { $i1 => $p1 } + icons_consts! { $($i2 => $p2),+ } + } +} + +macro_rules! icons_map { + ($($i:ident => $p:expr),+) => { + pub const ICONS_MAP: phf::Map<&'static str, &'static Icon> = phf::phf_map! { + $($p => &icons::$i),+ + }; + } +} + +macro_rules! icons { + ($($i:ident => $p:expr),+) => { + pub mod icons { + use super::Icon; + + icons_consts! { + $($i => $p),+ + } + } + + icons_map! { + $($i => $p),+ + } + } +} + +icons! { + NOTIFICATIONS => "notifications.svg", + NOTIFICATIONS_SOME => "notifications-some.svg", + PERSON => "person.svg" +} + +pub use icons::*; |