aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-06-28 21:46:08 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-06-28 21:46:08 +0000
commite7e3fd768230b9009f661a5b6cf0ea3c9a81ff17 (patch)
tree17c8ea80b5098b7de9ad7c1d93bb754509c7136c /gtk
parent19568c09017895a4dfc2aa022dd037826b93b016 (diff)
From Ian Schorr, limit the size of the (INFO) columns to prevent it from becoming
thousands of pixels wide. Temporary fix until someone perhaps gets rid of the autoresize of columns completely. svn path=/trunk/; revision=7947
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkclist.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c
index 1875c1ad6e..154e27e493 100644
--- a/gtk/gtkclist.c
+++ b/gtk/gtkclist.c
@@ -2,7 +2,7 @@
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball, Josh MacDonald,
* Copyright (C) 1997-1998 Jay Painter <jpaint@serv.net><jpaint@gimp.org>
*
- * $Id: gtkclist.c,v 1.13 2002/09/09 20:32:30 jmayer Exp $
+ * $Id: gtkclist.c,v 1.14 2003/06/28 21:46:08 sahlberg Exp $
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -27,6 +27,11 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+/* TODO:
+ * get rid of autoresize of the columns completely and just use some
+ * sane default widths instead
+ */
+
#include "config.h"
#include <stdlib.h>
#include <string.h>
@@ -147,6 +152,9 @@ LIST_WIDTH (GtkCList * clist)
} G_STMT_END
+/* maximum size in pxels that columns will be autosized to */
+#define MAX_COLUMN_AUTOSIZE_WIDTH 600
+
/* Signals */
enum {
SELECT_ROW,
@@ -1665,7 +1673,8 @@ gtk_clist_set_column_auto_resize (GtkCList *clist,
{
gint width;
- width = gtk_clist_optimal_column_width (clist, column);
+ /* cap the auto-rezised width to something reasonable */
+ width = MIN(gtk_clist_optimal_column_width (clist, column), MAX_COLUMN_AUTOSIZE_WIDTH);
gtk_clist_set_column_width (clist, column, width);
}
}