feat: add speech component

This commit is contained in:
2026-11-10 20:14:26 +07:00
parent 67f34ead74
commit 2aa2d7034f
8 changed files with 1553 additions and 0 deletions
+11
View File
@@ -37,6 +37,8 @@ pub enum IconRole {
WindowMaximize,
WindowRestore,
Loader,
Microphone,
Stop,
}
impl IconRole {
@@ -63,6 +65,8 @@ impl IconRole {
Self::WindowMaximize,
Self::WindowRestore,
Self::Loader,
Self::Microphone,
Self::Stop,
]
}
@@ -89,6 +93,8 @@ impl IconRole {
Self::WindowMaximize => "icons/square.svg",
Self::WindowRestore => "icons/copy.svg",
Self::Loader => "icons/loader.svg",
Self::Microphone => "icons/mic.svg",
Self::Stop => "icons/square.svg",
}
}
@@ -116,6 +122,8 @@ impl IconRole {
Self::WindowMaximize => "window-maximize",
Self::WindowRestore => "window-restore",
Self::Loader => "loader",
Self::Microphone => "microphone",
Self::Stop => "stop",
}
}
@@ -192,6 +200,8 @@ impl IconRole {
Self::WindowMaximize => &["window-maximize-symbolic", "window-maximize"],
Self::WindowRestore => &["window-restore-symbolic", "window-restore"],
Self::Loader => &["process-working-symbolic", "process-working"],
Self::Microphone => &["audio-input-microphone-symbolic", "audio-input-microphone"],
Self::Stop => &["process-stop-symbolic", "process-stop"],
}
}
}
@@ -387,6 +397,7 @@ fn asset_bytes(path: &str) -> Option<&'static [u8]> {
"icons/panel-left.svg" => Some(include_bytes!("../assets/panel-left.svg")),
"icons/panel-right.svg" => Some(include_bytes!("../assets/panel-right.svg")),
"icons/loader.svg" => Some(include_bytes!("../assets/loader.svg")),
"icons/mic.svg" => Some(include_bytes!("../assets/mic.svg")),
_ => None,
}
}
+2
View File
@@ -26,6 +26,8 @@ pub(crate) fn glyph(role: IconRole) -> Option<&'static str> {
IconRole::WindowMinimize => "\u{E921}", // ChromeMinimize
IconRole::WindowMaximize => "\u{E922}", // ChromeMaximize
IconRole::WindowRestore => "\u{E923}", // ChromeRestore
IconRole::Microphone => "\u{E720}", // Microphone
IconRole::Stop => "\u{E71A}", // Stop
// No Segoe spinner glyph, the icon falls back to the bundled SVG.
IconRole::Loader => return None,
};