changeset 2809:7ec04fb5211c

Tooltips for bookmarks and shortcuts The tooltip shows the path for bookmarks and shortcuts
author Colin Clark <colin.clark@cclark.uk>
date Sat, 04 Aug 2018 19:57:56 +0100
parents 1d43d9582f36
children 8438d30abd31 5ed1842634a6
files src/ui_bookmark.c
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui_bookmark.c	Thu Aug 02 20:15:36 2018 +0100
+++ b/src/ui_bookmark.c	Sat Aug 04 19:57:56 2018 +0100
@@ -541,6 +541,17 @@
 	g_object_unref(pixbuf);
 }
 
+static gboolean bookmark_path_tooltip_cb(GtkWidget *button, gpointer data)
+{
+	BookMarkData *bm = data;
+	BookButtonData *b;
+
+	b = g_object_get_data(G_OBJECT(button), "bookbuttondata");
+	gtk_widget_set_tooltip_text(GTK_WIDGET(button), b->path);
+
+	return FALSE;
+}
+
 static void bookmark_populate(BookMarkData *bm)
 {
 	GtkBox *box;
@@ -691,6 +702,9 @@
 					 G_CALLBACK(bookmark_drag_set_data), bm);
 			g_signal_connect(G_OBJECT(b->button), "drag_begin",
 					 G_CALLBACK(bookmark_drag_begin), bm);
+
+			gtk_widget_set_has_tooltip(GTK_WIDGET(b->button), TRUE);
+			g_signal_connect(G_OBJECT(b->button), "query_tooltip", G_CALLBACK(bookmark_path_tooltip_cb), bm);
 			}
 
 		work = work->prev;