fix #181
This commit is contained in:
parent
c7f42208c0
commit
06c7ead4f4
@ -842,6 +842,7 @@ namespace Pamac {
|
|||||||
on_search_treeview_selection_changed ();
|
on_search_treeview_selection_changed ();
|
||||||
} else {
|
} else {
|
||||||
show_default_pkgs ();
|
show_default_pkgs ();
|
||||||
|
search_entry.grab_focus ();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "groups":
|
case "groups":
|
||||||
@ -1241,7 +1242,7 @@ namespace Pamac {
|
|||||||
|
|
||||||
[GtkCallback]
|
[GtkCallback]
|
||||||
void on_search_entry_activate () {
|
void on_search_entry_activate () {
|
||||||
unowned string search_string = search_entry.get_text ();
|
string search_string = search_entry.get_text ().strip ();
|
||||||
if (search_string != "") {
|
if (search_string != "") {
|
||||||
this.get_window ().set_cursor (new Gdk.Cursor.for_display (Gdk.Display.get_default (), Gdk.CursorType.WATCH));
|
this.get_window ().set_cursor (new Gdk.Cursor.for_display (Gdk.Display.get_default (), Gdk.CursorType.WATCH));
|
||||||
Gtk.TreeModel model;
|
Gtk.TreeModel model;
|
||||||
@ -1289,7 +1290,7 @@ namespace Pamac {
|
|||||||
|
|
||||||
[GtkCallback]
|
[GtkCallback]
|
||||||
void on_search_entry_changed () {
|
void on_search_entry_changed () {
|
||||||
if (search_entry.get_text () != "") {
|
if (search_entry.get_text ().strip () != "") {
|
||||||
if (search_entry_timeout_id != 0) {
|
if (search_entry_timeout_id != 0) {
|
||||||
Source.remove (search_entry_timeout_id);
|
Source.remove (search_entry_timeout_id);
|
||||||
}
|
}
|
||||||
@ -1305,6 +1306,15 @@ namespace Pamac {
|
|||||||
this.get_window ().set_cursor (new Gdk.Cursor.for_display (Gdk.Display.get_default (), Gdk.CursorType.WATCH));
|
this.get_window ().set_cursor (new Gdk.Cursor.for_display (Gdk.Display.get_default (), Gdk.CursorType.WATCH));
|
||||||
string search_string;
|
string search_string;
|
||||||
search_list.get (iter, 0, out search_string);
|
search_list.get (iter, 0, out search_string);
|
||||||
|
// change search entry text to the selected one
|
||||||
|
search_entry.changed.disconnect (on_search_entry_changed);
|
||||||
|
search_entry.set_text (search_string);
|
||||||
|
search_entry.changed.connect (on_search_entry_changed);
|
||||||
|
Timeout.add (200, () => {
|
||||||
|
search_entry.grab_focus_without_selecting ();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
search_entry.set_position (-1);
|
||||||
switch (packages_stack.visible_child_name) {
|
switch (packages_stack.visible_child_name) {
|
||||||
case "repos":
|
case "repos":
|
||||||
transaction.search_pkgs.begin (search_string, (obj, res) => {
|
transaction.search_pkgs.begin (search_string, (obj, res) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user