From 524a5b09154207531e5b65dae09fac5df3040833 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Tue, 20 Feb 2024 15:22:52 -0500 Subject: [PATCH 1/2] fix: hide remove button on home --- src/app.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app.rs b/src/app.rs index db92065..ac2620d 100644 --- a/src/app.rs +++ b/src/app.rs @@ -681,12 +681,13 @@ impl cosmic::Application for CosmicAppLibrary { } list_column.push(menu_divider(spacing).into()); } - - list_column.push( - menu_button(text(REMOVE.clone())) - .on_press(Message::SelectAction(MenuAction::Remove)) - .into(), - ); + if self.cur_group > 0 { + list_column.push( + menu_button(text(REMOVE.clone())) + .on_press(Message::SelectAction(MenuAction::Remove)) + .into(), + ); + } return container(scrollable(Column::with_children(list_column))) .padding([8, 0]) From 18424c55b8ae8243621dad83733ec53de68238dc Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Tue, 20 Feb 2024 15:23:34 -0500 Subject: [PATCH 2/2] fix: check excludes for the filter type groups --- src/app_group.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app_group.rs b/src/app_group.rs index f87a8b2..1d229ab 100644 --- a/src/app_group.rs +++ b/src/app_group.rs @@ -53,8 +53,8 @@ impl AppGroup { pub fn filtered( &self, input_value: &str, - exceptions: &Vec, - all_entries: &Vec>, + exceptions: &[Self], + all_entries: &[Arc], ) -> Vec> { all_entries .iter() @@ -81,6 +81,7 @@ impl AppGroup { FilterType::Categories { categories, include, + exclude, .. } => { categories.iter().any(|cat| { @@ -88,7 +89,8 @@ impl AppGroup { .categories .to_lowercase() .contains(&cat.to_lowercase()) - }) || include.iter().any(|id| id == &entry.id) + }) && exclude.iter().all(|id| id != &entry.id) + || include.iter().any(|id| id == &entry.id) } FilterType::None => true, }