improv: enable sliders to scale with single column view

Closes #374
This commit is contained in:
Michael Aaron Murphy 2024-07-11 08:38:21 +02:00
parent c3dbba8d85
commit 26ab69c7ab
No known key found for this signature in database
GPG key ID: B2732D4240C9212C
3 changed files with 26 additions and 14 deletions

View file

@ -675,9 +675,11 @@ fn keyboard_typing_assist() -> Section<crate::pages::Message> {
page.xkb.repeat_delay, page.xkb.repeat_delay,
Message::SetRepeatKeysDelay, Message::SetRepeatKeysDelay,
) )
.width(250.0) .width(Length::Fill)
.breakpoints(&[KB_REPEAT_DELAY_DEFAULT]) .breakpoints(&[KB_REPEAT_DELAY_DEFAULT])
.step(50_u32); .step(50_u32)
.apply(widget::container)
.max_width(250);
row::with_capacity(3) row::with_capacity(3)
.align_items(iced::Alignment::Center) .align_items(iced::Alignment::Center)
@ -693,9 +695,11 @@ fn keyboard_typing_assist() -> Section<crate::pages::Message> {
page.xkb.repeat_rate, page.xkb.repeat_rate,
Message::SetRepeatKeysRate, Message::SetRepeatKeysRate,
) )
.width(250.0) .width(Length::Fill)
.breakpoints(&[KB_REPEAT_RATE_DEFAULT]) .breakpoints(&[KB_REPEAT_RATE_DEFAULT])
.step(5_u32); .step(5_u32)
.apply(widget::container)
.max_width(250);
row::with_capacity(3) row::with_capacity(3)
.align_items(iced::Alignment::Center) .align_items(iced::Alignment::Center)

View file

@ -1,4 +1,4 @@
use cosmic::iced::Alignment; use cosmic::iced::{Alignment, Length};
use cosmic::widget::{self, row, settings, text}; use cosmic::widget::{self, row, settings, text};
use cosmic::{Apply, Element}; use cosmic::{Apply, Element};
use cosmic_comp_config::input::AccelProfile; use cosmic_comp_config::input::AccelProfile;
@ -73,8 +73,10 @@ fn mouse() -> Section<crate::pages::Message> {
let slider = widget::slider(0.0..=100.0, value, |value| { let slider = widget::slider(0.0..=100.0, value, |value| {
Message::SetMouseSpeed((value / 70.71) - 0.81, false) Message::SetMouseSpeed((value / 70.71) - 0.81, false)
}) })
.width(250.0) .width(Length::Fill)
.breakpoints(&[50.0]); .breakpoints(&[50.0])
.apply(widget::container)
.max_width(250);
row::with_capacity(2) row::with_capacity(2)
.align_items(Alignment::Center) .align_items(Alignment::Center)
@ -130,8 +132,10 @@ fn scrolling() -> Section<crate::pages::Message> {
let slider = widget::slider(1.0..=100.0, value, |value| { let slider = widget::slider(1.0..=100.0, value, |value| {
Message::SetScrollFactor(2f64.powf((value - 50.0) / 10.0), false) Message::SetScrollFactor(2f64.powf((value - 50.0) / 10.0), false)
}) })
.width(250.0) .width(Length::Fill)
.breakpoints(&[50.0]); .breakpoints(&[50.0])
.apply(widget::container)
.max_width(250);
row::with_capacity(2) row::with_capacity(2)
.align_items(Alignment::Center) .align_items(Alignment::Center)

View file

@ -1,4 +1,4 @@
use cosmic::iced::Alignment; use cosmic::iced::{Alignment, Length};
use cosmic::widget::{self, row, settings, text}; use cosmic::widget::{self, row, settings, text};
use cosmic::{Apply, Element}; use cosmic::{Apply, Element};
use cosmic_comp_config::input::{AccelProfile, ClickMethod, ScrollMethod}; use cosmic_comp_config::input::{AccelProfile, ClickMethod, ScrollMethod};
@ -70,8 +70,10 @@ fn touchpad() -> Section<crate::pages::Message> {
let slider = widget::slider(1.0..=100.0, value, |value| { let slider = widget::slider(1.0..=100.0, value, |value| {
Message::SetMouseSpeed((value / 70.71) - 0.81, true) Message::SetMouseSpeed((value / 70.71) - 0.81, true)
}) })
.width(250.0) .width(Length::Fill)
.breakpoints(&[50.0]); .breakpoints(&[50.0])
.apply(widget::container)
.max_width(250);
row::with_capacity(2) row::with_capacity(2)
.align_items(Alignment::Center) .align_items(Alignment::Center)
@ -208,8 +210,10 @@ fn scrolling() -> Section<crate::pages::Message> {
let slider = widget::slider(1.0..=100.0, value, |value| { let slider = widget::slider(1.0..=100.0, value, |value| {
Message::SetScrollFactor(2f64.powf((value - 50.0) / 10.0), true) Message::SetScrollFactor(2f64.powf((value - 50.0) / 10.0), true)
}) })
.width(250.0) .width(Length::Fill)
.breakpoints(&[50.0]); .breakpoints(&[50.0])
.apply(widget::container)
.max_width(250);
row::with_capacity(2) row::with_capacity(2)
.align_items(Alignment::Center) .align_items(Alignment::Center)