This commit is contained in:
guinux 2016-11-02 12:48:44 +01:00
parent 06c7ead4f4
commit 1315bb265e
2 changed files with 32 additions and 0 deletions

View File

@ -376,6 +376,7 @@
<object class="GtkTreeView" id="packages_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_tooltip">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="search_column">1</property>
@ -383,6 +384,7 @@
<property name="show_expanders">False</property>
<property name="rubber_banding">True</property>
<signal name="button-press-event" handler="on_packages_treeview_button_press_event" swapped="no"/>
<signal name="query-tooltip" handler="on_packages_treeview_query_tooltip" swapped="no"/>
<signal name="row-activated" handler="on_packages_treeview_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection" id="packages_treeview_selection">
@ -492,6 +494,7 @@
<object class="GtkTreeView" id="aur_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_tooltip">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="search_column">1</property>
@ -499,6 +502,7 @@
<property name="show_expanders">False</property>
<property name="rubber_banding">True</property>
<signal name="button-press-event" handler="on_aur_treeview_button_press_event" swapped="no"/>
<signal name="query-tooltip" handler="on_aur_treeview_query_tooltip" swapped="no"/>
<signal name="row-activated" handler="on_aur_treeview_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection" id="aur_treeview_selection">

View File

@ -1183,6 +1183,20 @@ namespace Pamac {
return false;
}
[GtkCallback]
bool on_packages_treeview_query_tooltip (int x, int y, bool keyboard_tooltip, Gtk.Tooltip tooltip) {
Gtk.TreePath path;
Gtk.TreeIter iter;
if (packages_treeview.get_tooltip_context (ref x, ref y, keyboard_tooltip, null, out path, out iter)) {
string desc;
packages_list.get (iter, 2, out desc);
tooltip.set_markup (desc);
packages_treeview.set_tooltip_row (tooltip, path);
return true;
}
return false;
}
[GtkCallback]
bool on_aur_treeview_button_press_event (Gdk.EventButton event) {
aur_treeview.grab_focus ();
@ -1240,6 +1254,20 @@ namespace Pamac {
return false;
}
[GtkCallback]
bool on_aur_treeview_query_tooltip (int x, int y, bool keyboard_tooltip, Gtk.Tooltip tooltip) {
Gtk.TreePath path;
Gtk.TreeIter iter;
if (aur_treeview.get_tooltip_context (ref x, ref y, keyboard_tooltip, null, out path, out iter)) {
string desc;
aur_list.get (iter, 2, out desc);
tooltip.set_markup (desc);
aur_treeview.set_tooltip_row (tooltip, path);
return true;
}
return false;
}
[GtkCallback]
void on_search_entry_activate () {
string search_string = search_entry.get_text ().strip ();