fix(keyboard): extra padding in special character and numlock drawers

Also adds a (slightly modified for better flow) description for the Compose key from designs.
This commit is contained in:
Vukašin Vojinović 2025-11-06 12:24:08 +01:00 • committed by Michael Murphy
parent 41e90bde33
commit 6b8485e676
4 changed files with 17 additions and 7 deletions

View file

@ -602,10 +602,13 @@ impl Page {
}
fn special_character_key_view(&self, special_key: SpecialKey) -> cosmic::Element<'_, Message> {
let options = match special_key {
SpecialKey::Compose => COMPOSE_OPTIONS,
SpecialKey::AlternateCharacters => ALTERNATE_CHARACTER_OPTIONS,
SpecialKey::CapsLock => CAPS_LOCK_OPTIONS,
let (options, description) = match special_key {
SpecialKey::Compose => (
COMPOSE_OPTIONS,
Some(fl!("keyboard-special-char", "compose-desc")),
),
SpecialKey::AlternateCharacters => (ALTERNATE_CHARACTER_OPTIONS, None),
SpecialKey::CapsLock => (CAPS_LOCK_OPTIONS, None),
};
let prefix = special_key.prefix();
let current = self
@ -615,7 +618,7 @@ impl Page {
.flat_map(|x| x.split(','))
.find(|x| x.starts_with(prefix));
// TODO description, layout default
// TODO layout default
let mut list = cosmic::widget::list_column();
@ -630,7 +633,11 @@ impl Page {
.map(|(desc, id)| special_char_radio_row(desc, Some(id), current))
.fold(list, ListColumn::add);
cosmic::widget::container(list).padding(24).into()
widget::column::with_capacity(2)
.spacing(theme::spacing().space_m)
.push_maybe(description.map(widget::text::body))
.push(list)
.into()
}
fn numlock_state_view(&self) -> cosmic::Element<'_, Message> {
@ -658,7 +665,7 @@ impl Page {
]));
}
cosmic::widget::container(list).padding(24).into()
list.into()
}
fn update_xkb_config(&mut self) {