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
+16
View File
@@ -0,0 +1,16 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M9.88 9.88a3 3 0 1 0 4.24 4.24" />
<path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" />
<path d="M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" />
<line x1="2" x2="22" y1="2" y2="22" />
</svg>

After

Width:  |  Height:  |  Size: 473 B

+14
View File
@@ -0,0 +1,14 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" />
<circle cx="12" cy="12" r="3" />
</svg>

After

Width:  |  Height:  |  Size: 303 B

+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)
}