Skip to content

Commit

Permalink
Collections mouse hover
Browse files Browse the repository at this point in the history
Partial solution to #396
#396

When the mouse is hovered over a thumbnail in a collections window, the
tooltip (the filename and path) is in the correct position.

Not a good solution, but there will be more problems with GTK 3.20
  • Loading branch information
Colin Clark committed May 23, 2016
1 parent 8a0b1ce commit 1bfcecb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/collect-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ static void tip_show(CollectTable *ct)
{
GtkWidget *label;
gint x, y;
gint x_win = 0, y_win = 0;

if (ct->tip_window) return;

Expand All @@ -537,10 +538,14 @@ static void tip_show(CollectTable *ct)
gtk_container_add(GTK_CONTAINER(ct->tip_window), label);
gtk_widget_show(label);

#if GTK_CHECK_VERSION(3,0,0)
gdk_window_get_origin(gtk_widget_get_window(ct->listview), &x_win, &y_win);
#else
gdk_window_get_pointer(NULL, &x, &y, NULL);
#endif

if (!gtk_widget_get_realized(ct->tip_window)) gtk_widget_realize(ct->tip_window);
gtk_window_move(GTK_WINDOW(ct->tip_window), x + 16, y + 16);
gtk_window_move(GTK_WINDOW(ct->tip_window), x_win + x + 16, y_win + y + 16);
gtk_widget_show(ct->tip_window);
}

Expand Down

0 comments on commit 1bfcecb

Please sign in to comment.