layout: make strips the titlebar with window controls

This commit is contained in:
2026-11-02 19:04:13 +07:00
parent f295b25366
commit a6014b4ff3
13 changed files with 603 additions and 62 deletions
+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"
>
<rect width="14" height="14" x="8" y="8" rx="2" ry="2" />
<path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />
</svg>

After

Width:  |  Height:  |  Size: 339 B

+13
View File
@@ -0,0 +1,13 @@
<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"
>
<rect width="18" height="18" x="3" y="3" rx="2" />
</svg>

After

Width:  |  Height:  |  Size: 261 B

+17
View File
@@ -31,6 +31,9 @@ pub enum IconRole {
EyeOff,
PanelLeft,
PanelRight,
WindowMinimize,
WindowMaximize,
WindowRestore,
}
impl IconRole {
@@ -52,6 +55,9 @@ impl IconRole {
Self::EyeOff,
Self::PanelLeft,
Self::PanelRight,
Self::WindowMinimize,
Self::WindowMaximize,
Self::WindowRestore,
]
}
@@ -73,6 +79,9 @@ impl IconRole {
Self::EyeOff => "icons/eye-off.svg",
Self::PanelLeft => "icons/panel-left.svg",
Self::PanelRight => "icons/panel-right.svg",
Self::WindowMinimize => "icons/minus.svg",
Self::WindowMaximize => "icons/square.svg",
Self::WindowRestore => "icons/copy.svg",
}
}
@@ -94,6 +103,9 @@ impl IconRole {
Self::EyeOff => "eye-off",
Self::PanelLeft => "panel-left",
Self::PanelRight => "panel-right",
Self::WindowMinimize => "window-minimize",
Self::WindowMaximize => "window-maximize",
Self::WindowRestore => "window-restore",
}
}
@@ -165,6 +177,9 @@ impl IconRole {
"panel-right",
"sidebar-right",
],
Self::WindowMinimize => &["window-minimize-symbolic", "window-minimize"],
Self::WindowMaximize => &["window-maximize-symbolic", "window-maximize"],
Self::WindowRestore => &["window-restore-symbolic", "window-restore"],
}
}
}
@@ -263,6 +278,8 @@ fn asset_bytes(path: &str) -> Option<&'static [u8]> {
match path {
"icons/check.svg" => Some(include_bytes!("../assets/check.svg")),
"icons/x.svg" => Some(include_bytes!("../assets/x.svg")),
"icons/square.svg" => Some(include_bytes!("../assets/square.svg")),
"icons/copy.svg" => Some(include_bytes!("../assets/copy.svg")),
"icons/chevron-down.svg" => Some(include_bytes!("../assets/chevron-down.svg")),
"icons/chevron-left.svg" => Some(include_bytes!("../assets/chevron-left.svg")),
"icons/chevron-right.svg" => Some(include_bytes!("../assets/chevron-right.svg")),
+19 -16
View File
@@ -6,22 +6,25 @@ use crate::IconRole;
/// The Segoe Fluent Icons codepoint for the role.
pub(crate) fn glyph(role: IconRole) -> Option<char> {
let codepoint = match role {
IconRole::Check => 0xE73E, // CheckMark
IconRole::Close => 0xE8BB, // ChromeClose
IconRole::ChevronDown => 0xE70D, // ChevronDown
IconRole::ChevronLeft => 0xE76B, // ChevronLeft
IconRole::ChevronRight => 0xE76C, // ChevronRight
IconRole::ChevronUp => 0xE70E, // ChevronUp
IconRole::Plus => 0xE710, // Add
IconRole::Minus => 0xE738, // Remove
IconRole::Search => 0xE721, // Search
IconRole::Folder => 0xE8B7, // Folder
IconRole::Warning => 0xE7BA, // Warning
IconRole::Info => 0xE946, // Info
IconRole::Eye => 0xE7B3, // RedEye
IconRole::EyeOff => 0xED1A, // Hide
IconRole::PanelLeft => 0xE90C, // DockLeft
IconRole::PanelRight => 0xE90D, // DockRight
IconRole::Check => 0xE73E, // CheckMark
IconRole::Close => 0xE8BB, // ChromeClose
IconRole::ChevronDown => 0xE70D, // ChevronDown
IconRole::ChevronLeft => 0xE76B, // ChevronLeft
IconRole::ChevronRight => 0xE76C, // ChevronRight
IconRole::ChevronUp => 0xE70E, // ChevronUp
IconRole::Plus => 0xE710, // Add
IconRole::Minus => 0xE738, // Remove
IconRole::Search => 0xE721, // Search
IconRole::Folder => 0xE8B7, // Folder
IconRole::Warning => 0xE7BA, // Warning
IconRole::Info => 0xE946, // Info
IconRole::Eye => 0xE7B3, // RedEye
IconRole::EyeOff => 0xED1A, // Hide
IconRole::PanelLeft => 0xE90C, // DockLeft
IconRole::PanelRight => 0xE90D, // DockRight
IconRole::WindowMinimize => 0xE921, // ChromeMinimize
IconRole::WindowMaximize => 0xE922, // ChromeMaximize
IconRole::WindowRestore => 0xE923, // ChromeRestore
};
char::from_u32(codepoint)
}