add app layout shell to the layout crate

This commit is contained in:
2026-11-02 08:53:18 +07:00
parent 3e03137d1c
commit aa40003a37
15 changed files with 697 additions and 11 deletions
+23
View File
@@ -29,6 +29,8 @@ pub enum IconRole {
Info,
Eye,
EyeOff,
PanelLeft,
PanelRight,
}
impl IconRole {
@@ -48,6 +50,8 @@ impl IconRole {
Self::Info,
Self::Eye,
Self::EyeOff,
Self::PanelLeft,
Self::PanelRight,
]
}
@@ -67,6 +71,8 @@ impl IconRole {
Self::Info => "icons/info.svg",
Self::Eye => "icons/eye.svg",
Self::EyeOff => "icons/eye-off.svg",
Self::PanelLeft => "icons/panel-left.svg",
Self::PanelRight => "icons/panel-right.svg",
}
}
@@ -86,6 +92,8 @@ impl IconRole {
Self::Info => "info",
Self::Eye => "eye",
Self::EyeOff => "eye-off",
Self::PanelLeft => "panel-left",
Self::PanelRight => "panel-right",
}
}
@@ -144,6 +152,19 @@ impl IconRole {
"visibility-off",
"eye-off",
],
Self::PanelLeft => &[
"sidebar-expand-left",
"sidebar-show-symbolic",
"panel-left",
"sidebar-left",
],
Self::PanelRight => &[
"sidebar-expand-right",
"sidebar-show-right-symbolic",
"sidebar-show-symbolic",
"panel-right",
"sidebar-right",
],
}
}
}
@@ -254,6 +275,8 @@ fn asset_bytes(path: &str) -> Option<&'static [u8]> {
"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")),
"icons/panel-left.svg" => Some(include_bytes!("../assets/panel-left.svg")),
"icons/panel-right.svg" => Some(include_bytes!("../assets/panel-right.svg")),
_ => None,
}
}
+2
View File
@@ -20,6 +20,8 @@ pub(crate) fn glyph(role: IconRole) -> Option<char> {
IconRole::Info => 0xE946, // Info
IconRole::Eye => 0xE7B3, // RedEye
IconRole::EyeOff => 0xED1A, // Hide
IconRole::PanelLeft => 0xE90C, // DockLeft
IconRole::PanelRight => 0xE90D, // DockRight
};
char::from_u32(codepoint)
}