From a58f920d3b9ad8c00e68c6e15375c648f8d90c09 Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Sat, 9 Sep 2023 17:41:07 +0200 Subject: [PATCH] fix: unexpected behavior on gpu profile refresh button --- src/ui/main_view.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ui/main_view.rs b/src/ui/main_view.rs index adeb24f..41ffb19 100644 --- a/src/ui/main_view.rs +++ b/src/ui/main_view.rs @@ -30,6 +30,7 @@ pub struct MainView { xrservice_active: bool, enable_debug_view: bool, profiles: Vec, + #[no_eq] selected_profile: Profile, #[tracker::do_not_track] profiles_dropdown: Option, @@ -60,7 +61,6 @@ pub enum MainViewMsg { SetSelectedProfile(u32), ProfileSelected(u32), UpdateSelectedProfile(Profile), - MarkChanged, EditProfile, CreateProfile, DeleteProfile, @@ -384,8 +384,8 @@ impl SimpleComponent for MainView { set_margin_end: 12, set_halign: gtk::Align::Start, set_label: "Refresh", - connect_clicked[sender] => move |_| { - sender.input(Self::Input::MarkChanged); + connect_clicked[sender, profiles_dropdown] => move |_| { + sender.input(Self::Input::SetSelectedProfile(profiles_dropdown.selected())); } }, }, @@ -562,9 +562,6 @@ impl SimpleComponent for MainView { .sender() .emit(InstallWivrnBoxMsg::UpdateSelectedProfile(prof.clone())); } - Self::Input::MarkChanged => { - self.mark_all_changed(); - } Self::Input::UpdateProfiles(profiles, config) => { self.set_profiles(profiles); // why send another message to set the dropdown selection?