Skip to content

Commit

Permalink
fix: set default value for disable-while-typing when unset
Browse files Browse the repository at this point in the history
  • Loading branch information
mkljczk authored Jan 6, 2025
1 parent 66d96de commit e4b69cd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cosmic-settings/src/pages/input/touchpad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use cosmic::widget::{self, row, settings, text};
use cosmic::{Apply, Element};
use cosmic_comp_config::input::{AccelProfile, ClickMethod, ScrollMethod};
use cosmic_comp_config::workspace::{WorkspaceConfig, WorkspaceLayout};
use cosmic_comp_config::CosmicCompConfig;
use cosmic_settings_page::Section;
use cosmic_settings_page::{self as page, section};
use slab::Slab;
Expand Down Expand Up @@ -126,7 +127,11 @@ fn touchpad() -> Section<crate::pages::Message> {
)
.add(
settings::item::builder(&descriptions[disable_while_typing]).toggler(
input.input_touchpad.disable_while_typing.unwrap_or(false),
input.input_touchpad.disable_while_typing.unwrap_or(
CosmicCompConfig::default()
.input_touchpad
.disable_while_typing,

This comment has been minimized.

Copy link
@mmstick

mmstick Jan 6, 2025

Member

This returns Option<bool>, and should be in a unwrap_or_else scope.

),
|enabled| Message::DisableWhileTyping(enabled, true),
),
)
Expand Down

0 comments on commit e4b69cd

Please sign in to comment.