fix: keyboard repeat delay and rate sliders
This commit is contained in:
parent
cf7fc32adf
commit
5c20aa9a75
1 changed files with 42 additions and 40 deletions
|
|
@ -802,50 +802,52 @@ fn keyboard_typing_assist() -> Section<crate::pages::Message> {
|
|||
settings::section()
|
||||
.title(§ion.title)
|
||||
.add(
|
||||
settings::flex_item(&descriptions[repeat_delay], {
|
||||
// Delay
|
||||
let delay_slider = cosmic::widget::slider(
|
||||
KB_REPEAT_DELAY_MIN..=KB_REPEAT_DELAY_MAX,
|
||||
page.xkb.repeat_delay,
|
||||
Message::SetRepeatKeysDelay,
|
||||
)
|
||||
.width(Length::Fill)
|
||||
.breakpoints(&[KB_REPEAT_DELAY_DEFAULT])
|
||||
.step(50_u32)
|
||||
.apply(widget::container)
|
||||
.max_width(250);
|
||||
settings::item::builder(&descriptions[repeat_delay])
|
||||
.flex_control({
|
||||
// Delay
|
||||
let delay_slider = cosmic::widget::slider(
|
||||
KB_REPEAT_DELAY_MIN..=KB_REPEAT_DELAY_MAX,
|
||||
page.xkb.repeat_delay,
|
||||
Message::SetRepeatKeysDelay,
|
||||
)
|
||||
.width(Length::Fill)
|
||||
.breakpoints(&[KB_REPEAT_DELAY_DEFAULT])
|
||||
.step(50_u32)
|
||||
.apply(widget::container)
|
||||
.max_width(250);
|
||||
|
||||
row::with_capacity(3)
|
||||
.align_y(Alignment::Center)
|
||||
.spacing(theme::spacing().space_s)
|
||||
.push(widget::text::body(&descriptions[short]))
|
||||
.push(delay_slider)
|
||||
.push(widget::text::body(&descriptions[long]))
|
||||
})
|
||||
.align_items(Alignment::Center),
|
||||
row::with_capacity(3)
|
||||
.align_y(Alignment::Center)
|
||||
.spacing(theme::spacing().space_s)
|
||||
.push(widget::text::body(&descriptions[short]))
|
||||
.push(delay_slider)
|
||||
.push(widget::text::body(&descriptions[long]))
|
||||
})
|
||||
.align_items(Alignment::Center),
|
||||
)
|
||||
.add(
|
||||
settings::flex_item(&descriptions[repeat_rate], {
|
||||
// Repeat rate
|
||||
let rate_slider = cosmic::widget::slider(
|
||||
KB_REPEAT_RATE_MIN..=KB_REPEAT_RATE_MAX,
|
||||
page.xkb.repeat_rate,
|
||||
Message::SetRepeatKeysRate,
|
||||
)
|
||||
.width(Length::Fill)
|
||||
.breakpoints(&[KB_REPEAT_RATE_DEFAULT])
|
||||
.step(5_u32)
|
||||
.apply(widget::container)
|
||||
.max_width(250);
|
||||
settings::item::builder(&descriptions[repeat_rate])
|
||||
.flex_control({
|
||||
// Repeat rate
|
||||
let rate_slider = cosmic::widget::slider(
|
||||
KB_REPEAT_RATE_MIN..=KB_REPEAT_RATE_MAX,
|
||||
page.xkb.repeat_rate,
|
||||
Message::SetRepeatKeysRate,
|
||||
)
|
||||
.width(Length::Fill)
|
||||
.breakpoints(&[KB_REPEAT_RATE_DEFAULT])
|
||||
.step(5_u32)
|
||||
.apply(widget::container)
|
||||
.max_width(250);
|
||||
|
||||
row::with_capacity(3)
|
||||
.align_y(Alignment::Center)
|
||||
.spacing(theme::spacing().space_s)
|
||||
.push(widget::text::body(&descriptions[slow]))
|
||||
.push(rate_slider)
|
||||
.push(widget::text::body(&descriptions[fast]))
|
||||
})
|
||||
.align_items(Alignment::Center),
|
||||
row::with_capacity(3)
|
||||
.align_y(Alignment::Center)
|
||||
.spacing(theme::spacing().space_s)
|
||||
.push(widget::text::body(&descriptions[slow]))
|
||||
.push(rate_slider)
|
||||
.push(widget::text::body(&descriptions[fast]))
|
||||
})
|
||||
.align_items(Alignment::Center),
|
||||
)
|
||||
.apply(cosmic::Element::from)
|
||||
.map(crate::pages::Message::Keyboard)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue