elementary / switchboard-plug-applications

Switchboard Applications Plug
https://elementary.io
GNU General Public License v3.0
14 stars 12 forks source link

Permissions: Make applist searchable #206

Closed leolost2605 closed 1 year ago

leolost2605 commented 1 year ago

Fixes #146

Screenshot: image

leolost2605 commented 1 year ago

Yeah that's definitely not how it should be. May I ask how you are testing this?

lenemter commented 1 year ago

@leolost2605 I just remove the line app_list.add (app_entry); (src/Permissions/PermissionsPlug.vala line 90) and then it will show placeholder because the app_list is empty.

If you're asking about this:

Add placeholder_stack.set_visible_child (placeholder); in the end of construct block

leolost2605 commented 1 year ago

@leolost2605 I just remove the line app_list.add (app_entry); (src/Permissions/PermissionsPlug.vala line 90) and then it will show placeholder because the app_list is empty.

Oh ok that makes sense then and is actually correct/IMO wanted behavior: Whether the placeholder is shown with this PR is bound to the number of actual applications found by the AppManager and not the number of visible children in app_list. That's because otherwise it would be shown when searching for an app that isn't installed/not found because of a typo or whatever. Currently nothing is shown when this is the case (it's done this way when searching for apps while adding a startup app too so i mimicked this behavior here). Maybe we should still show a placeholder like "No app matching $search_term was found"?

lenemter commented 1 year ago

@leolost2605 makes sense, thanks for clarification!

I think such placeholder is a great idea! Please do it :)

leolost2605 commented 1 year ago

@lenemter done. Also when the currently selected row gets hidden it now gets unselected.

lenemter commented 1 year ago

What about using a Granite.Widgets.AlertView for the "No Flatpak apps installed" placeholder?

image

leolost2605 commented 1 year ago

@lenemter done: Screenshot from 2023-07-06 16 49 00

danirabbit commented 1 year ago

Works for me! Nice job :)