Esc closes the config window; a removed empty workspace closes up during the switch

Hyprland drops an empty workspace the moment it's left, so its number vanished
and the row jumped before the disc slid. Its slot now stays for the slide,
shrinking and fading, and the pill narrows with it.
This commit is contained in:
server2
2026-10-15 02:55:30 +02:00
parent 4fbfad3ce3
commit 3b9929aff4
2 changed files with 54 additions and 15 deletions
+7 -1
View File
@@ -3,7 +3,7 @@ use std::collections::HashMap;
use std::process::Command;
use amane::{
Center, Color, Column, Cursor, End, Full, Padding, Rectangle, Row, ScrollArea, Service, SpaceBetween, Stack, Start, Text, TextInput, Weight, Widget, Window, children, close_window, open_window, window_size,
Center, Color, Column, Cursor, End, Full, Key, Padding, Rectangle, Row, ScrollArea, Service, SpaceBetween, Stack, Start, Text, TextInput, Weight, Widget, Window, children, close_window, open_window, window_size,
};
use crate::config::{self, Kind, Opt};
@@ -283,6 +283,12 @@ pub fn view() -> Window {
.title(TITLE)
.size(1100.0, 760.0)
.resizable(true)
// Escape closes it, also from a field (a typed value only applies on Enter)
.on_key(|key| {
if key == Key::Escape {
close_window(NAME);
}
})
.child(
Rectangle::new()
.width(width)