mirror of
https://github.com/an-anime-team/sleepy-launcher.git
synced 2024-11-24 05:38:30 +03:00
fix(ui): further GtkSwitch UI state fixes
This commit is contained in:
parent
bd439cc941
commit
0f1f7b8a4a
4 changed files with 14 additions and 14 deletions
|
@ -51,7 +51,7 @@ impl SimpleAsyncComponent for SelectVoiceoversApp {
|
|||
#[local_ref]
|
||||
add_suffix = english -> gtk::Switch {
|
||||
set_valign: gtk::Align::Center,
|
||||
set_state: true
|
||||
set_active: true
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -135,12 +135,12 @@ impl SimpleAsyncComponent for SandboxPage {
|
|||
add_suffix = >k::Switch {
|
||||
set_valign: gtk::Align::Center,
|
||||
|
||||
set_state: CONFIG.sandbox.enabled,
|
||||
set_active: CONFIG.sandbox.enabled,
|
||||
|
||||
connect_state_notify => |switch| {
|
||||
if is_ready() {
|
||||
if let Ok(mut config) = Config::get() {
|
||||
config.sandbox.enabled = switch.state();
|
||||
config.sandbox.enabled = switch.is_active();
|
||||
|
||||
Config::update(config);
|
||||
}
|
||||
|
@ -156,12 +156,12 @@ impl SimpleAsyncComponent for SandboxPage {
|
|||
add_suffix = >k::Switch {
|
||||
set_valign: gtk::Align::Center,
|
||||
|
||||
set_state: CONFIG.sandbox.isolate_home,
|
||||
set_active: CONFIG.sandbox.isolate_home,
|
||||
|
||||
connect_state_notify => |switch| {
|
||||
if is_ready() {
|
||||
if let Ok(mut config) = Config::get() {
|
||||
config.sandbox.isolate_home = switch.state();
|
||||
config.sandbox.isolate_home = switch.is_active();
|
||||
|
||||
Config::update(config);
|
||||
}
|
||||
|
|
|
@ -109,11 +109,11 @@ impl SimpleAsyncComponent for ComponentsPage {
|
|||
set_valign: gtk::Align::Center,
|
||||
|
||||
#[block_signal(wine_recommended_notify)]
|
||||
set_state: true,
|
||||
set_active: true,
|
||||
|
||||
connect_state_notify[sender] => move |switch| {
|
||||
if is_ready() {
|
||||
sender.input(ComponentsPageMsg::WineRecommendedOnly(switch.state()));
|
||||
sender.input(ComponentsPageMsg::WineRecommendedOnly(switch.is_active()));
|
||||
}
|
||||
} @wine_recommended_notify
|
||||
}
|
||||
|
@ -135,12 +135,12 @@ impl SimpleAsyncComponent for ComponentsPage {
|
|||
set_valign: gtk::Align::Center,
|
||||
|
||||
#[block_signal(wine_shared_libraries_notify)]
|
||||
set_state: CONFIG.game.wine.shared_libraries.wine,
|
||||
set_active: CONFIG.game.wine.shared_libraries.wine,
|
||||
|
||||
connect_state_notify => |switch| {
|
||||
if is_ready() {
|
||||
if let Ok(mut config) = Config::get() {
|
||||
config.game.wine.shared_libraries.wine = switch.state();
|
||||
config.game.wine.shared_libraries.wine = switch.is_active();
|
||||
|
||||
Config::update(config);
|
||||
}
|
||||
|
@ -157,12 +157,12 @@ impl SimpleAsyncComponent for ComponentsPage {
|
|||
set_valign: gtk::Align::Center,
|
||||
|
||||
#[block_signal(gstreamer_shared_libraries_notify)]
|
||||
set_state: CONFIG.game.wine.shared_libraries.gstreamer,
|
||||
set_active: CONFIG.game.wine.shared_libraries.gstreamer,
|
||||
|
||||
connect_state_notify => |switch| {
|
||||
if is_ready() {
|
||||
if let Ok(mut config) = Config::get() {
|
||||
config.game.wine.shared_libraries.gstreamer = switch.state();
|
||||
config.game.wine.shared_libraries.gstreamer = switch.is_active();
|
||||
|
||||
Config::update(config);
|
||||
}
|
||||
|
@ -221,11 +221,11 @@ impl SimpleAsyncComponent for ComponentsPage {
|
|||
set_valign: gtk::Align::Center,
|
||||
|
||||
#[block_signal(dxvk_recommended_notify)]
|
||||
set_state: true,
|
||||
set_active: true,
|
||||
|
||||
connect_state_notify[sender] => move |switch| {
|
||||
if is_ready() {
|
||||
sender.input(ComponentsPageMsg::DxvkRecommendedOnly(switch.state()));
|
||||
sender.input(ComponentsPageMsg::DxvkRecommendedOnly(switch.is_active()));
|
||||
}
|
||||
} @dxvk_recommended_notify
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ impl SimpleAsyncComponent for GeneralApp {
|
|||
|
||||
connect_state_notify => |switch| {
|
||||
#[allow(unused_must_use)]
|
||||
if switch.state() {
|
||||
if switch.is_active() {
|
||||
std::fs::remove_file(KEEP_BACKGROUND_FILE.as_path());
|
||||
} else {
|
||||
std::fs::write(KEEP_BACKGROUND_FILE.as_path(), "");
|
||||
|
|
Loading…
Reference in a new issue