[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] faster tab scrolling for large number of channel tabs



Hi,

I submitted this little patch for 2.0.2 and received no responses so I'm
submitting it again for 2.0.3 with [PATCH] in the subject this time...


I use xchat 2.0.2 on linux and have up to 40 channels open.
Whether I have the tabs at the top or at the left, selecting the first
tab if you're currently on the last one requires something like 10
clicks on the up-arrow to shift the tabs downwards one-by-one.

This is very slow, cumbersome and unergonomic. What is the point in making
the tabs scroll smoothly and slowly one-by-one instead of scrolling in
screenfuls or at least half-screenfuls?

I made the simple patch below which simply makes the arrows scroll to the
beginning or to the end of the tab list. This has the problem that you
would skip over tabs in the middle if you have more than 2 whole
screenfuls. I would suggest that the developers dump the current arrow
behaviour and make the tab list scroll instantly in screenfuls, rather
than slowly box-by-box. Alternatively, make it possible to display more
than one row of tabs at a time.

poing


diff -ruN xchat-2.0.3/src/fe-gtk/tabs.c xchat-2.0.3-patched/src/fe-gtk/tabs.c
--- xchat-2.0.3/src/fe-gtk/tabs.c	Wed May 28 18:02:43 2003
+++ xchat-2.0.3/src/fe-gtk/tabs.c	Wed Jul  2 02:01:54 2003
@@ -125,17 +125,19 @@
 		gdk_window_get_geometry (inner->parent->window, 0, 0, &viewport_size, 0, 0);
 	}

-	new_value = tab_search_offset (inner, adj->value, 0, vertical);
+/*	new_value = tab_search_offset (inner, adj->value, 0, vertical);

 	if (new_value + viewport_size > adj->upper)
-		new_value = adj->upper - viewport_size;
+		new_value = adj->upper - viewport_size; */
+
+	new_value = 0;

-	for (i = adj->value; i > new_value; i -= 0.1)
+/*	for (i = adj->value; i > new_value; i -= 0.1)
 	{
 		gtk_adjustment_set_value (adj, i);
 		while (g_main_pending ())
 			g_main_iteration (TRUE);
-	}
+	} */

 	gtk_adjustment_set_value (adj, new_value);
 }
@@ -162,18 +164,18 @@
 		adj = gtk_viewport_get_hadjustment (GTK_VIEWPORT (inner->parent));
 		gdk_window_get_geometry (inner->parent->window, 0, 0, &viewport_size, 0, 0);
 	}
-
+/*
 	new_value = tab_search_offset (inner, adj->value, 1, vertical);

-	if (new_value == 0 || new_value + viewport_size > adj->upper)
+	if (new_value == 0 || new_value + viewport_size > adj->upper) */
 		new_value = adj->upper - viewport_size;

-	for (i = adj->value; i < new_value; i += 0.1)
+/*	for (i = adj->value; i < new_value; i += 0.1)
 	{
 		gtk_adjustment_set_value (adj, i);
 		while (g_main_pending ())
 			g_main_iteration (TRUE);
-	}
+	} */

 	gtk_adjustment_set_value (adj, new_value);
 }

--
XChat-discuss: mailing list for XChat users
Archive:       http://mail.nl.linux.org/xchat-discuss/