Skip to content

Commit

Permalink
SearchView: only invalidate when search isn't empty (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
alainm23 authored Oct 22, 2024
1 parent be7f38a commit 161154a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions data/settings.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<li>Updated translations</li>
</ul>
</description>
<issues>
<issue url="https://github.com/elementary/switchboard/issues/182">Search returns alphabetically sorted list after clicking on a search result</issue>
</issues>
</release>

<release version="8.0.0" date="2024-05-21" urgency="medium">
Expand Down
10 changes: 7 additions & 3 deletions src/SearchView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,20 @@ public class Switchboard.SearchView : Gtk.Box {

search_entry.search_changed.connect (() => {
alert_view.title = _("No Results for “%s").printf (search_entry.text);
listbox.invalidate_filter ();
listbox.invalidate_sort ();
listbox.select_row (null);

if (search_entry.text.length > 0) {
listbox.invalidate_filter ();
listbox.invalidate_sort ();
listbox.select_row (null);
}
});

listbox.row_activated.connect ((row) => {
app.load_setting_path (
((SearchRow) row).uri.replace ("settings://", ""),
Switchboard.PlugsManager.get_default ()
);

search_entry.text = "";
});
}
Expand Down

0 comments on commit 161154a

Please sign in to comment.