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]) 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, }