Skip to content

Commit 3db0076

Browse files
committed
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.
1 parent 2c147b8 commit 3db0076

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

cosmic-settings/src/pages/input/keyboard/mod.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -602,10 +602,13 @@ impl Page {
602602
}
603603

604604
fn special_character_key_view(&self, special_key: SpecialKey) -> cosmic::Element<'_, Message> {
605-
let options = match special_key {
606-
SpecialKey::Compose => COMPOSE_OPTIONS,
607-
SpecialKey::AlternateCharacters => ALTERNATE_CHARACTER_OPTIONS,
608-
SpecialKey::CapsLock => CAPS_LOCK_OPTIONS,
605+
let (options, description) = match special_key {
606+
SpecialKey::Compose => (
607+
COMPOSE_OPTIONS,
608+
Some(fl!("keyboard-special-char", "compose-desc")),
609+
),
610+
SpecialKey::AlternateCharacters => (ALTERNATE_CHARACTER_OPTIONS, None),
611+
SpecialKey::CapsLock => (CAPS_LOCK_OPTIONS, None),
609612
};
610613
let prefix = special_key.prefix();
611614
let current = self
@@ -615,7 +618,7 @@ impl Page {
615618
.flat_map(|x| x.split(','))
616619
.find(|x| x.starts_with(prefix));
617620

618-
// TODO description, layout default
621+
// TODO layout default
619622

620623
let mut list = cosmic::widget::list_column();
621624

@@ -630,7 +633,11 @@ impl Page {
630633
.map(|(desc, id)| special_char_radio_row(desc, Some(id), current))
631634
.fold(list, ListColumn::add);
632635

633-
cosmic::widget::container(list).padding(24).into()
636+
widget::column::with_capacity(2)
637+
.spacing(theme::spacing().space_m)
638+
.push_maybe(description.map(widget::text::body))
639+
.push(list)
640+
.into()
634641
}
635642

636643
fn numlock_state_view(&self) -> cosmic::Element<'_, Message> {
@@ -658,7 +665,7 @@ impl Page {
658665
]));
659666
}
660667

661-
cosmic::widget::container(list).padding(24).into()
668+
list.into()
662669
}
663670

664671
fn update_xkb_config(&mut self) {

i18n/en/cosmic_settings.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ keyboard-sources = Input Sources
570570
keyboard-special-char = Special Character Entry
571571
.alternate = Alternate characters key
572572
.compose = Compose key
573+
.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 á.
573574
.caps = Caps Lock key
574575
575576
keyboard-typing-assist = Typing

i18n/sr-Cyrl/cosmic_settings.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ keyboard-sources = Језик уноса
513513
keyboard-special-char = Уношење специјалних знакова
514514
.alternate = Тастер за алтернативне знакове
515515
.compose = Compose тастер
516+
.compose-desc = Compose тастер омогућава унос широког спектра знакова. Да бисте га користили, притисните Compose, а затим секвенцу знакова. На пример, Compose тастер праћен тастерима C и o уноси ©, док праћен тастерима а и ‘ уноси á.
516517
.caps = Caps Lock тастер
517518
keyboard-typing-assist = Куцање
518519
.repeat-rate = Стопа понављања

i18n/sr-Latn/cosmic_settings.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ keyboard-sources = Jezik unosa
513513
keyboard-special-char = Unošenje specijalnih znakova
514514
.alternate = Taster za alternativne znakove
515515
.compose = Compose taster
516+
.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 á.
516517
.caps = Caps Lock taster
517518
keyboard-typing-assist = Kucanje
518519
.repeat-rate = Stopa ponavljanja

0 commit comments

Comments
 (0)