From 71d454d87cbeee644a1f332ed7fc92f95f907374 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sat, 25 Mar 2023 13:34:54 +0200 Subject: [PATCH] feat(ui): small ui fixes --- .gitmodules | 0 src/ui/main/mod.rs | 11 ++++------- src/ui/preferences/general.rs | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29..0000000 diff --git a/src/ui/main/mod.rs b/src/ui/main/mod.rs index 174090d..3fbf1e5 100644 --- a/src/ui/main/mod.rs +++ b/src/ui/main/mod.rs @@ -387,7 +387,7 @@ impl SimpleComponent for App { }, #[watch] - set_sensitive: match model.state.as_ref() { + set_sensitive: !model.disabled_buttons && match &model.state { Some(LauncherState::GameOutdated { .. }) | Some(LauncherState::VoiceOutdated(_)) => false, @@ -407,7 +407,7 @@ impl SimpleComponent for App { }, #[watch] - set_css_classes: match model.state.as_ref() { + set_css_classes: match &model.state { Some(LauncherState::GameOutdated { .. }) | Some(LauncherState::VoiceOutdated(_)) => &["warning"], @@ -427,7 +427,7 @@ impl SimpleComponent for App { }, #[watch] - set_tooltip_text: Some(&match model.state.as_ref() { + set_tooltip_text: Some(&match &model.state { Some(LauncherState::GameOutdated { .. }) | Some(LauncherState::VoiceOutdated(_)) => tr("main-window--version-outdated-tooltip"), @@ -444,9 +444,6 @@ impl SimpleComponent for App { _ => String::new() }), - #[watch] - set_sensitive: !model.disabled_buttons, - set_hexpand: false, set_width_request: 200, @@ -668,7 +665,7 @@ impl SimpleComponent for App { sender.input(AppMsg::SetLoadingStatus(Some(Some(tr("downloading-background-picture"))))); if let Err(err) = crate::background::download_background() { - tracing::error!("Failed to download background picture"); + tracing::error!("Failed to download background picture: {err}"); sender.input(AppMsg::Toast { title: tr("background-downloading-failed"), diff --git a/src/ui/preferences/general.rs b/src/ui/preferences/general.rs index 79b0cce..c44e97c 100644 --- a/src/ui/preferences/general.rs +++ b/src/ui/preferences/general.rs @@ -346,7 +346,7 @@ impl SimpleAsyncComponent for GeneralApp { VersionDiff::NotInstalled { .. } => &[] } - None => &["success"] + None => &[] }, #[watch]