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) {

View file

@ -574,6 +574,7 @@ keyboard-sources = Input Sources
keyboard-special-char = Special Character Entry
.alternate = Alternate characters key
.compose = Compose key
.compose-desc = The compose key allows a wide variety of characters to be entered. To use it, press compose and then a sequence of characters. For example, compose key followed by C and o will enter ©, while compose key followed by a and will enter á.
.caps = Caps Lock key
keyboard-typing-assist = Typing

View file

@ -513,6 +513,7 @@ keyboard-sources = Језик уноса
keyboard-special-char = Уношење специјалних знакова
.alternate = Тастер за алтернативне знакове
.compose = Compose тастер
.compose-desc = Compose тастер омогућава унос широког спектра знакова. Да бисте га користили, притисните Compose, а затим секвенцу знакова. На пример, Compose тастер праћен тастерима C и o уноси ©, док праћен тастерима а и уноси á.
.caps = Caps Lock тастер
keyboard-typing-assist = Куцање
.repeat-rate = Стопа понављања

View file

@ -513,6 +513,7 @@ keyboard-sources = Jezik unosa
keyboard-special-char = Unošenje specijalnih znakova
.alternate = Taster za alternativne znakove
.compose = Compose taster
.compose-desc = Compose taster omogućava unos širokog spektra znakova. Da biste ga koristili, pritisnite Compose, a zatim sekvencu znakova. Na primer, Compose taster praćen tasterima C i o unosi ©, dok praćen tasterima a i unosi á.
.caps = Caps Lock taster
keyboard-typing-assist = Kucanje
.repeat-rate = Stopa ponavljanja