improv: make entire length of radio items clickable
This commit is contained in:
parent
a5744e8bdb
commit
4db59de205
4 changed files with 12 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
cosmic_config::{self, ConfigGet, ConfigSet},
|
cosmic_config::{self, ConfigGet, ConfigSet},
|
||||||
|
iced::Length,
|
||||||
widget::{radio, settings, text},
|
widget::{radio, settings, text},
|
||||||
Apply, Element,
|
Apply, Element,
|
||||||
};
|
};
|
||||||
|
|
@ -140,6 +141,7 @@ fn multi_behavior() -> Section<crate::pages::Message> {
|
||||||
Some(page.comp_workspace_config.workspace_mode),
|
Some(page.comp_workspace_config.workspace_mode),
|
||||||
Message::SetWorkspaceMode,
|
Message::SetWorkspaceMode,
|
||||||
)
|
)
|
||||||
|
.width(Length::Fill)
|
||||||
.into()]))
|
.into()]))
|
||||||
.add(settings::item_row(vec![radio(
|
.add(settings::item_row(vec![radio(
|
||||||
text::body(&descriptions[separate]),
|
text::body(&descriptions[separate]),
|
||||||
|
|
@ -147,6 +149,7 @@ fn multi_behavior() -> Section<crate::pages::Message> {
|
||||||
Some(page.comp_workspace_config.workspace_mode),
|
Some(page.comp_workspace_config.workspace_mode),
|
||||||
Message::SetWorkspaceMode,
|
Message::SetWorkspaceMode,
|
||||||
)
|
)
|
||||||
|
.width(Length::Fill)
|
||||||
.into()]))
|
.into()]))
|
||||||
.apply(Element::from)
|
.apply(Element::from)
|
||||||
.map(crate::pages::Message::DesktopWorkspaces)
|
.map(crate::pages::Message::DesktopWorkspaces)
|
||||||
|
|
@ -171,6 +174,7 @@ fn workspace_orientation() -> Section<crate::pages::Message> {
|
||||||
Some(page.comp_workspace_config.workspace_layout),
|
Some(page.comp_workspace_config.workspace_layout),
|
||||||
Message::SetWorkspaceLayout,
|
Message::SetWorkspaceLayout,
|
||||||
)
|
)
|
||||||
|
.width(Length::Fill)
|
||||||
.into()]))
|
.into()]))
|
||||||
.add(settings::item_row(vec![radio(
|
.add(settings::item_row(vec![radio(
|
||||||
text::body(&descriptions[horizontal]),
|
text::body(&descriptions[horizontal]),
|
||||||
|
|
@ -178,6 +182,7 @@ fn workspace_orientation() -> Section<crate::pages::Message> {
|
||||||
Some(page.comp_workspace_config.workspace_layout),
|
Some(page.comp_workspace_config.workspace_layout),
|
||||||
Message::SetWorkspaceLayout,
|
Message::SetWorkspaceLayout,
|
||||||
)
|
)
|
||||||
|
.width(Length::Fill)
|
||||||
.into()]))
|
.into()]))
|
||||||
.apply(Element::from)
|
.apply(Element::from)
|
||||||
.map(crate::pages::Message::DesktopWorkspaces)
|
.map(crate::pages::Message::DesktopWorkspaces)
|
||||||
|
|
|
||||||
|
|
@ -230,6 +230,7 @@ fn special_char_radio_row<'a>(
|
||||||
settings::item_row(vec![radio(desc, value, Some(current_value), |_| {
|
settings::item_row(vec![radio(desc, value, Some(current_value), |_| {
|
||||||
Message::SpecialCharacterSelect(value)
|
Message::SpecialCharacterSelect(value)
|
||||||
})
|
})
|
||||||
|
.width(Length::Fill)
|
||||||
.into()])
|
.into()])
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,7 @@ fn click_behavior() -> Section<crate::pages::Message> {
|
||||||
page.input_touchpad.click_method,
|
page.input_touchpad.click_method,
|
||||||
|option| Message::SetSecondaryClickBehavior(Some(option), true),
|
|option| Message::SetSecondaryClickBehavior(Some(option), true),
|
||||||
)
|
)
|
||||||
|
.width(Length::Fill)
|
||||||
.into()]))
|
.into()]))
|
||||||
// Secondary and middle-click via button areas.
|
// Secondary and middle-click via button areas.
|
||||||
.add(settings::item_row(vec![widget::radio(
|
.add(settings::item_row(vec![widget::radio(
|
||||||
|
|
@ -164,6 +165,7 @@ fn click_behavior() -> Section<crate::pages::Message> {
|
||||||
page.input_touchpad.click_method,
|
page.input_touchpad.click_method,
|
||||||
|option| Message::SetSecondaryClickBehavior(Some(option), true),
|
|option| Message::SetSecondaryClickBehavior(Some(option), true),
|
||||||
)
|
)
|
||||||
|
.width(Length::Fill)
|
||||||
.into()]))
|
.into()]))
|
||||||
.add(
|
.add(
|
||||||
settings::item::builder(&descriptions[tap_to_click]).toggler(
|
settings::item::builder(&descriptions[tap_to_click]).toggler(
|
||||||
|
|
@ -209,6 +211,7 @@ fn scrolling() -> Section<crate::pages::Message> {
|
||||||
.and_then(|x| x.method),
|
.and_then(|x| x.method),
|
||||||
|option| Message::SetScrollMethod(Some(option), true),
|
|option| Message::SetScrollMethod(Some(option), true),
|
||||||
)
|
)
|
||||||
|
.width(Length::Fill)
|
||||||
.into()]))
|
.into()]))
|
||||||
// Edge scrolling toggle
|
// Edge scrolling toggle
|
||||||
.add(settings::item_row(vec![widget::radio(
|
.add(settings::item_row(vec![widget::radio(
|
||||||
|
|
@ -220,6 +223,7 @@ fn scrolling() -> Section<crate::pages::Message> {
|
||||||
.and_then(|x| x.method),
|
.and_then(|x| x.method),
|
||||||
|option| Message::SetScrollMethod(Some(option), true),
|
|option| Message::SetScrollMethod(Some(option), true),
|
||||||
)
|
)
|
||||||
|
.width(Length::Fill)
|
||||||
.into()]))
|
.into()]))
|
||||||
// Scroll speed slider
|
// Scroll speed slider
|
||||||
.add(settings::item(&descriptions[scroll_speed], {
|
.add(settings::item(&descriptions[scroll_speed], {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ use self::backend::{GetCurrentPowerProfile, SetPowerProfile};
|
||||||
use backend::{Battery, PowerProfile};
|
use backend::{Battery, PowerProfile};
|
||||||
|
|
||||||
use chrono::TimeDelta;
|
use chrono::TimeDelta;
|
||||||
|
use cosmic::iced::Length;
|
||||||
use cosmic::iced_widget::row;
|
use cosmic::iced_widget::row;
|
||||||
use cosmic::widget::{self, column, radio, settings, text};
|
use cosmic::widget::{self, column, radio, settings, text};
|
||||||
use cosmic::Apply;
|
use cosmic::Apply;
|
||||||
|
|
@ -125,6 +126,7 @@ fn profiles() -> Section<crate::pages::Message> {
|
||||||
Some(current_profile),
|
Some(current_profile),
|
||||||
Message::PowerProfileChange,
|
Message::PowerProfileChange,
|
||||||
)
|
)
|
||||||
|
.width(Length::Fill)
|
||||||
.into()])
|
.into()])
|
||||||
})
|
})
|
||||||
.fold(section, settings::Section::add);
|
.fold(section, settings::Section::add);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue