Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
alainm23 committed Oct 22, 2024
1 parent 812af82 commit 175fdf9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions data/settings.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
</ul>
</description>
<issues>
<issue url="https://github.com/elementary/switchboard/issues/182">Reset search after displaying the result</issue>
<issue url="https://github.com/elementary/switchboard/issues/224">Port System Settings to GTK4</issue>
<issue url="https://github.com/elementary/switchboard/issues/232">preferences-desktop dark variant</issue>
<issue url="https://github.com/elementary/switchboard/issues/247">It's possible to open two plugs at the same time</issue>
Expand Down
6 changes: 0 additions & 6 deletions src/CategoryView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,6 @@ public class Switchboard.CategoryView : Adw.NavigationPage {
searchview.activate_first_item ();
});

searchview.clear_search.connect (() => {
GLib.Timeout.add_once (stack.transition_duration, () => {
search_box.text = "";
});
});

search_box_eventcontrollerkey.key_released.connect ((keyval, keycode, state) => {
switch (keyval) {
case Gdk.Key.Down:
Expand Down
13 changes: 7 additions & 6 deletions src/SearchView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public class Switchboard.SearchView : Gtk.Box {
public Gtk.SearchEntry search_entry { get; construct; }
private Gtk.ListBox listbox;

public signal void clear_search ();

public SearchView (Gtk.SearchEntry search_entry) {
Object (search_entry: search_entry);
}
Expand Down Expand Up @@ -50,9 +48,12 @@ 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) => {
Expand All @@ -61,7 +62,7 @@ public class Switchboard.SearchView : Gtk.Box {
Switchboard.PlugsManager.get_default ()
);

clear_search ();
search_entry.text = "";
});
}

Expand Down

0 comments on commit 175fdf9

Please sign in to comment.