changeset 274:2710d14f6a28

Fix the "continuous display" of tooltips in the collection view (before the tooltip delay occured once, then changing icon to icon never hide the tooltip again, now the tip is displayed shortly after the cursor moved on the icon, but disappears when moving cursor to another icon). Display the full path to the file when Show filename text is on (before nothing was displayed). When Show filename text is off, behavior is unchanged, the (short) filename is displayed.
author zas_
date Tue, 08 Apr 2008 21:33:29 +0000
parents e0e2c2b72c5a
children dc69ea2dcf76
files src/collect-table.c
diffstat 1 files changed, 6 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/collect-table.c	Tue Apr 08 20:56:50 2008 +0000
+++ b/src/collect-table.c	Tue Apr 08 21:33:29 2008 +0000
@@ -46,6 +46,7 @@
 #define THUMB_BORDER_PADDING 2
 
 #define COLLECT_TABLE_TIP_DELAY 500
+#define COLLECT_TABLE_TIP_DELAY_PATH (COLLECT_TABLE_TIP_DELAY * 1.7)
 
 
 enum {
@@ -448,7 +449,7 @@
 	gtk_window_set_resizable(GTK_WINDOW(ct->tip_window), FALSE);
 	gtk_container_set_border_width(GTK_CONTAINER(ct->tip_window), 2);
 
-	label = gtk_label_new(ct->tip_info->fd->name);
+	label = gtk_label_new(ct->show_text ? ct->tip_info->fd->path : ct->tip_info->fd->name);
 
 	g_object_set_data(G_OBJECT(ct->tip_window), "tip_label", label);
 	gtk_container_add(GTK_CONTAINER(ct->tip_window), label);
@@ -489,10 +490,7 @@
 		ct->tip_delay_id = -1;
 		}
 
-	if (!ct->show_text)
-		{
-		ct->tip_delay_id = g_timeout_add(COLLECT_TABLE_TIP_DELAY, tip_schedule_cb, ct);
-		}
+	ct->tip_delay_id = g_timeout_add(ct->show_text ? COLLECT_TABLE_TIP_DELAY_PATH : COLLECT_TABLE_TIP_DELAY, tip_schedule_cb, ct);
 }
 
 static void tip_unschedule(CollectTable *ct)
@@ -505,6 +503,8 @@
 
 static void tip_update(CollectTable *ct, CollectInfo *info)
 {
+	tip_schedule(ct);
+
 	if (ct->tip_window)
 		{
 		gint x, y;
@@ -520,19 +520,13 @@
 
 			if (!ct->tip_info)
 				{
-				tip_hide(ct);
-				tip_schedule(ct);
 				return;
 				}
 
 			label = g_object_get_data(G_OBJECT(ct->tip_window), "tip_label");
-			gtk_label_set_text(GTK_LABEL(label), ct->tip_info->fd->name);
+			gtk_label_set_text(GTK_LABEL(label), ct->show_text ? ct->tip_info->fd->path : ct->tip_info->fd->name);
 			}
 		}
-	else
-		{
-		tip_schedule(ct);
-		}
 }
 
 /*