fix: set default value for disable-while-typing when unset

This commit is contained in:
mkljczk 2025-01-06 18:27:14 +01:00 committed by GitHub
parent 66d96de181
commit e4b69cd9c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
@ -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,
),
|enabled| Message::DisableWhileTyping(enabled, true),
),
)