From 7dd81a8be7745d0748f066eef36064ed02c0df52 Mon Sep 17 00:00:00 2001 From: guinux <nuxgui@gmail.com> Date: Thu, 20 Jun 2019 11:56:18 +0200 Subject: [PATCH] search lists fix --- src/manager_window.vala | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/manager_window.vala b/src/manager_window.vala index 00429f42..ace7f08f 100644 --- a/src/manager_window.vala +++ b/src/manager_window.vala @@ -2189,12 +2189,18 @@ namespace Pamac { } else { populate_packages_list ((owned) pkgs); database.search_repos_pkgs_async.begin (search_string, (obj, res) => { + unowned Gtk.ListBoxRow repos_row = search_listbox.get_row_at_index (1); if (database.search_repos_pkgs_async.end (res).length () > 0) { - unowned Gtk.ListBoxRow repos_row = search_listbox.get_row_at_index (1); repos_row.activatable = true; repos_row.selectable = true; repos_row.can_focus = true; repos_row.get_child ().sensitive = true; + } else { + repos_row.activatable = false; + repos_row.selectable = false; + repos_row.has_focus = false; + repos_row.can_focus = false; + repos_row.get_child ().sensitive = false; } }); } @@ -2260,12 +2266,18 @@ namespace Pamac { } else { populate_packages_list ((owned) pkgs); database.search_installed_pkgs_async.begin (search_string, (obj, res) => { + unowned Gtk.ListBoxRow installed_row = search_listbox.get_row_at_index (0); if (database.search_installed_pkgs_async.end (res).length () > 0) { - unowned Gtk.ListBoxRow installed_row = search_listbox.get_row_at_index (0); installed_row.activatable = true; installed_row.selectable = true; installed_row.can_focus = true; installed_row.get_child ().sensitive = true; + } else { + installed_row.activatable = false; + installed_row.selectable = false; + installed_row.has_focus = false; + installed_row.can_focus = false; + installed_row.get_child ().sensitive = false; } }); } -- GitLab