add password field

This commit is contained in:
2026-11-01 17:26:30 +07:00
parent b2ce60f0e6
commit acf907461b
9 changed files with 430 additions and 56 deletions
+18 -5
View File
@@ -1,10 +1,5 @@
//! System icons for GPUI: components and apps reference semantic roles,
//! and the crate resolves each role to a glyph for the current platform.
//!
//! Resolver cascade (plan §4.4): Segoe Fluent Icons (Windows), freedesktop
//! icon themes (Linux/Omarchy), and the bundled Lucide subset everywhere
//! else — macOS rides the Lucide fallback until SF Symbols shows it matters.
//! A missing glyph falls back silently; nothing ever fails to paint.
use gpui::prelude::FluentBuilder as _;
use gpui::{
@@ -32,6 +27,8 @@ pub enum IconRole {
Folder,
Warning,
Info,
Eye,
EyeOff,
}
impl IconRole {
@@ -49,6 +46,8 @@ impl IconRole {
Self::Folder,
Self::Warning,
Self::Info,
Self::Eye,
Self::EyeOff,
]
}
@@ -66,6 +65,8 @@ impl IconRole {
Self::Folder => "icons/folder.svg",
Self::Warning => "icons/triangle-alert.svg",
Self::Info => "icons/info.svg",
Self::Eye => "icons/eye.svg",
Self::EyeOff => "icons/eye-off.svg",
}
}
@@ -83,6 +84,8 @@ impl IconRole {
Self::Folder => "folder",
Self::Warning => "warning",
Self::Info => "info",
Self::Eye => "eye",
Self::EyeOff => "eye-off",
}
}
@@ -133,6 +136,14 @@ impl IconRole {
Self::Folder => &["folder-symbolic", "folder"],
Self::Warning => &["dialog-warning-symbolic", "dialog-warning", "warning"],
Self::Info => &["dialog-information-symbolic", "dialog-information", "info"],
Self::Eye => &["view-visible-symbolic", "view-visible", "visibility", "eye"],
Self::EyeOff => &[
"view-conceal-symbolic",
"view-hide-symbolic",
"view-hide",
"visibility-off",
"eye-off",
],
}
}
}
@@ -241,6 +252,8 @@ fn asset_bytes(path: &str) -> Option<&'static [u8]> {
"icons/folder.svg" => Some(include_bytes!("../assets/folder.svg")),
"icons/triangle-alert.svg" => Some(include_bytes!("../assets/triangle-alert.svg")),
"icons/info.svg" => Some(include_bytes!("../assets/info.svg")),
"icons/eye.svg" => Some(include_bytes!("../assets/eye.svg")),
"icons/eye-off.svg" => Some(include_bytes!("../assets/eye-off.svg")),
_ => None,
}
}
+2
View File
@@ -18,6 +18,8 @@ pub(crate) fn glyph(role: IconRole) -> Option<char> {
IconRole::Folder => 0xE8B7, // Folder
IconRole::Warning => 0xE7BA, // Warning
IconRole::Info => 0xE946, // Info
IconRole::Eye => 0xE7B3, // RedEye
IconRole::EyeOff => 0xED1A, // Hide
};
char::from_u32(codepoint)
}