--- gnome-panel-2.4.1/applets/wncklet/window-list.c	2003-07-02 19:58:45.000000000 -0400
+++ gnome-panel-2.4.1-del1/applets/wncklet/window-list.c	2003-10-26 09:22:38.000000000 -0500
@@ -32,6 +32,7 @@
 
 #include "egg-screen-help.h"
 
+
 typedef struct {
 	GtkWidget *applet;
 	GtkWidget *tasklist;
@@ -39,6 +40,7 @@
 	WnckScreen *screen;
 
 	gboolean include_all_workspaces;
+	gboolean window_list_or_buttons_size;
 	WnckTasklistGroupingType grouping;
 	gboolean move_unminimized_windows;
   
@@ -57,13 +59,17 @@
 	GtkWidget *always_group_radio;
 	GtkWidget *move_minimized_radio;
 	GtkWidget *change_workspace_radio;
+	GtkWidget *window_list_size_radio;
+	GtkWidget *buttons_size_radio;
 
 	GtkWidget *minimum_size_spin;
 	GtkWidget *maximum_size_spin;
+	GtkWidget *minimum_buttons_size_spin;
+	GtkWidget *maximum_buttons_size_spin;
 	GtkWidget *about;
 
 	/* gconf listeners id */
-	guint listeners [5];
+	guint listeners [8];
 } TasklistData;
 
 static void display_properties_dialog (BonoboUIComponent *uic,
@@ -75,6 +81,8 @@
 static void display_about_dialog      (BonoboUIComponent *uic,
 				       TasklistData      *tasklist,
 				       const gchar       *verbname);
+static void 
+tasklist_properties_update_size_radio (TasklistData *tasklist);
 
 static void
 tasklist_update (TasklistData *tasklist)
@@ -82,9 +90,11 @@
 	if (tasklist->orientation == GTK_ORIENTATION_HORIZONTAL) {
 		gtk_widget_set_size_request (GTK_WIDGET (tasklist->tasklist),
 					     -1, tasklist->size);
+		wnck_tasklist_set_minimum_height (WNCK_TASKLIST (tasklist->tasklist), tasklist->size);
 	} else {
 		gtk_widget_set_size_request (GTK_WIDGET (tasklist->tasklist),
 					     tasklist->size, -1);
+		wnck_tasklist_set_minimum_width (WNCK_TASKLIST (tasklist->tasklist), tasklist->size);
 	}
 
 	wnck_tasklist_set_grouping (WNCK_TASKLIST (tasklist->tasklist),
@@ -93,6 +103,8 @@
 						  tasklist->include_all_workspaces);
 	wnck_tasklist_set_switch_workspace_on_unminimize (WNCK_TASKLIST (tasklist->tasklist),
 							  tasklist->move_unminimized_windows);
+	wnck_tasklist_set_window_list_or_buttons_size (WNCK_TASKLIST (tasklist->tasklist),
+						       tasklist->window_list_or_buttons_size);
 }
 
 static void
@@ -167,11 +179,21 @@
 	case PANEL_APPLET_ORIENT_LEFT:
 	case PANEL_APPLET_ORIENT_RIGHT:
 		new_orient = GTK_ORIENTATION_VERTICAL;
+//disable button max size mode
+		tasklist->window_list_or_buttons_size = TRUE;
+		gtk_widget_set_sensitive(GTK_WIDGET(tasklist->buttons_size_radio), FALSE);
+		gtk_widget_set_sensitive(GTK_WIDGET(tasklist->maximum_buttons_size_spin), FALSE);
+		tasklist_update (tasklist);
+		tasklist_properties_update_size_radio (tasklist);
 		break;
 	case PANEL_APPLET_ORIENT_UP:
 	case PANEL_APPLET_ORIENT_DOWN:
 	default:
 		new_orient = GTK_ORIENTATION_HORIZONTAL;
+//enable button max size mode
+		gtk_widget_set_sensitive(GTK_WIDGET(tasklist->buttons_size_radio), TRUE);
+		gtk_widget_set_sensitive(GTK_WIDGET(tasklist->maximum_buttons_size_spin), TRUE);
+
 		break;
 	}
 	
@@ -231,7 +253,9 @@
 		return;
 
 	tasklist->size = size;
-	
+	if (tasklist->orientation == GTK_ORIENTATION_HORIZONTAL) {
+                wnck_tasklist_set_minimum_height (WNCK_TASKLIST (tasklist->tasklist), tasklist->size);
+        }
 	tasklist_update (tasklist);
 }
 
@@ -248,6 +272,9 @@
 	gconf_client_notify_remove (client, tasklist->listeners[2]);
 	gconf_client_notify_remove (client, tasklist->listeners[3]);
 	gconf_client_notify_remove (client, tasklist->listeners[4]);
+	gconf_client_notify_remove (client, tasklist->listeners[5]);
+	gconf_client_notify_remove (client, tasklist->listeners[6]);
+	gconf_client_notify_remove (client, tasklist->listeners[7]);
 
 	g_object_unref (G_OBJECT (client));
 	
@@ -256,6 +283,9 @@
 	tasklist->listeners[2] = 0;
 	tasklist->listeners[3] = 0;
 	tasklist->listeners[4] = 0;
+	tasklist->listeners[5] = 0;
+	tasklist->listeners[6] = 0;
+	tasklist->listeners[7] = 0;
 
 	if (tasklist->properties_dialog)
 		gtk_widget_destroy (tasklist->properties_dialog);
@@ -292,6 +322,24 @@
 }
 
 static void
+tasklist_properties_update_size_radio (TasklistData *tasklist)
+{
+	GtkWidget *button;
+
+	if (tasklist->buttons_size_radio == NULL)
+		return;
+
+	if (tasklist->window_list_or_buttons_size) {
+		button = tasklist->window_list_size_radio;
+	} else {
+		button = tasklist->buttons_size_radio;
+	}
+
+	if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
+}
+
+static void
 display_all_workspaces_changed (GConfClient  *client,
 				guint         cnxn_id,
 				GConfEntry   *entry,
@@ -310,6 +358,24 @@
 	tasklist_properties_update_content_radio (tasklist);
 }
 
+static void
+window_list_or_buttons_size_changed (GConfClient  *client,
+				      guint         cnxn_id,
+				      GConfEntry   *entry,
+				      TasklistData *tasklist)
+{
+	gboolean value;
+	if (!entry->value || entry->value->type != GCONF_VALUE_BOOL)
+		return;
+
+	value = gconf_value_get_bool (entry->value);
+
+	tasklist->window_list_or_buttons_size = (value != 0);
+	tasklist_update (tasklist);
+
+	tasklist_properties_update_size_radio (tasklist);
+}
+
 static WnckTasklistGroupingType
 get_grouping_type (GConfValue *value)
 {
@@ -469,7 +535,57 @@
 	tasklist->maximum_size = value;
         gtk_widget_queue_resize (GTK_WIDGET (tasklist->applet));
 }
-    
+
+/* GConf callback for changes in minimum_buttons_size */
+static void
+minimum_buttons_size_changed (GConfClient *client, guint cnxn_id,
+		      GConfEntry *entry, TasklistData *tasklist)
+{
+    	WnckTasklist *wncktl = WNCK_TASKLIST (tasklist->tasklist);
+	gint value;
+	GtkSpinButton *button;
+
+	if (!tasklist->minimum_buttons_size_spin)
+		return;
+
+	button = GTK_SPIN_BUTTON (tasklist->minimum_buttons_size_spin);
+
+	if (!entry->value || entry->value->type != GCONF_VALUE_INT)
+		return;
+	
+	value = gconf_value_get_int (entry->value);
+	
+	gtk_spin_button_set_value (button, value);
+	if (tasklist->orientation == GTK_ORIENTATION_HORIZONTAL)
+		wnck_tasklist_set_minimum_buttons_width (wncktl, value);
+	else
+		wnck_tasklist_set_minimum_buttons_height (wncktl, value);
+}
+
+/* GConf callback for changes in maximum_buttons_size */
+static void
+maximum_buttons_size_changed (GConfClient  *client, guint cnxn_id,
+                      GConfEntry   *entry, TasklistData *tasklist)
+{
+	WnckTasklist *wncktl = WNCK_TASKLIST (tasklist->tasklist);
+	gint value;
+	GtkSpinButton *button;
+
+	if (!tasklist->maximum_buttons_size_spin)
+		return;
+
+	button = GTK_SPIN_BUTTON (tasklist->maximum_buttons_size_spin);
+	if (!entry->value || entry->value->type != GCONF_VALUE_INT)
+		return;
+	
+	value = gconf_value_get_int (entry->value);
+
+	gtk_spin_button_set_value (button, value);
+	if (tasklist->orientation == GTK_ORIENTATION_HORIZONTAL)
+		wnck_tasklist_set_maximum_buttons_width (wncktl, value);
+	else
+		wnck_tasklist_set_maximum_buttons_height (wncktl, value);
+}   
 static void
 setup_gconf (TasklistData *tasklist)
 {
@@ -516,6 +632,24 @@
 				tasklist,
 				NULL, NULL);
 	g_free (key);
+	key = panel_applet_gconf_get_full_key (PANEL_APPLET (tasklist->applet),
+					       "window_list_or_buttons_size");
+	tasklist->listeners[5] = gconf_client_notify_add(client, key,
+				 (GConfClientNotifyFunc)window_list_or_buttons_size_changed,
+				 tasklist,
+				 NULL, NULL);
+	key = panel_applet_gconf_get_full_key (PANEL_APPLET (tasklist->applet),
+					       "maximum_buttons_size");
+	tasklist->listeners[6] = gconf_client_notify_add(client, key,
+				 (GConfClientNotifyFunc)maximum_buttons_size_changed,
+				 tasklist,
+				 NULL, NULL);
+	key = panel_applet_gconf_get_full_key (PANEL_APPLET (tasklist->applet),
+					       "minimum_buttons_size");
+	tasklist->listeners[7] = gconf_client_notify_add(client, key,
+				 (GConfClientNotifyFunc)minimum_buttons_size_changed,
+				 tasklist,
+				 NULL, NULL);
 
 	g_object_unref (G_OBJECT (client));
 }
@@ -627,6 +761,13 @@
 	}
 
 	error = NULL;
+	tasklist->window_list_or_buttons_size = panel_applet_gconf_get_bool (applet, "window_list_or_buttons_size", &error);
+	if (error) {
+		g_error_free (error);
+		tasklist->window_list_or_buttons_size = FALSE; /* Default value */
+	}
+
+	error = NULL;
 	tasklist->grouping = -1;
 	value = panel_applet_gconf_get_value (applet, "group_windows", &error);
 	if (error) {
@@ -692,6 +833,31 @@
 
 	tasklist->maximum_size = sizepref;
 
+	/* get buttons size preference */
+	error = NULL;
+	sizepref = panel_applet_gconf_get_int (applet, "minimum_buttons_size", &error);
+	if (error) {
+		sizepref = 10; /* Default value */
+		g_error_free (error);
+	}
+
+	if (tasklist->orientation == GTK_ORIENTATION_HORIZONTAL)
+		wnck_tasklist_set_minimum_buttons_width (WNCK_TASKLIST (tasklist->tasklist), sizepref);	  
+	else
+		wnck_tasklist_set_minimum_buttons_height (WNCK_TASKLIST (tasklist->tasklist), sizepref);	  
+
+	error = NULL;
+	sizepref = panel_applet_gconf_get_int (applet, "maximum_buttons_size", &error);
+	if (error) {
+		sizepref = 150; /* Default value */
+		g_error_free (error);
+	}
+	if (tasklist->orientation == GTK_ORIENTATION_HORIZONTAL)
+		wnck_tasklist_set_maximum_buttons_width (WNCK_TASKLIST (tasklist->tasklist), sizepref);	  
+	else
+		wnck_tasklist_set_maximum_buttons_height (WNCK_TASKLIST (tasklist->tasklist), sizepref);	  
+
+
 	g_signal_connect (G_OBJECT (tasklist->tasklist), "destroy",
 			  G_CALLBACK (destroy_tasklist),
 			  tasklist);
@@ -850,7 +1016,15 @@
 				     gtk_toggle_button_get_active (button),
 				     NULL);
 }
-
+static void
+window_list_or_buttons_size_toggled (GtkToggleButton *button,
+				TasklistData    *tasklist)
+{
+	panel_applet_gconf_set_bool (PANEL_APPLET (tasklist->applet),
+				     "window_list_or_buttons_size",
+				     gtk_toggle_button_get_active (button),
+				     NULL);
+}
 /* called when minimum width spin button is changed
  * check if it exceeds max width
  * saves numeric GConf preference values
@@ -889,6 +1063,44 @@
 	panel_applet_gconf_set_int (applet, "maximum_size", prop_value, NULL);
 }
 
+/* called when minimum buttons size spin button is changed
+ * check if it exceeds max width
+ * saves numeric GConf preference values
+ */
+static void
+spin_minimum_buttons_size_changed (GtkSpinButton *button, TasklistData *tasklist)
+{
+	GtkSpinButton *max_b = GTK_SPIN_BUTTON (tasklist->maximum_buttons_size_spin);
+	PanelApplet *applet = PANEL_APPLET (tasklist->applet);
+	gint prop_value = gtk_spin_button_get_value (button);
+	gint max_size = gtk_spin_button_get_value (max_b);
+	
+	/* check if we exceed max width */
+	if (prop_value > max_size)
+	        panel_applet_gconf_set_int (applet, "maximum_buttons_size", 
+			                    prop_value, NULL);
+	panel_applet_gconf_set_int (applet, "minimum_buttons_size", prop_value, NULL);
+}
+
+/* called when maximum buttons size spin button is changed
+ * check if we drop below min width
+ * saves numeric GConf preference values
+ */
+static void
+spin_maximum_buttons_size_changed (GtkSpinButton *button, TasklistData *tasklist)
+{
+	GtkSpinButton *min_b = GTK_SPIN_BUTTON (tasklist->minimum_buttons_size_spin);
+	PanelApplet *applet = PANEL_APPLET (tasklist->applet);
+	gint prop_value = gtk_spin_button_get_value (button);
+	gint min_size = gtk_spin_button_get_value (min_b);
+
+	/* check if we drop below min width */
+	if (prop_value < min_size)
+		panel_applet_gconf_set_int (applet, "minimum_buttons_size", 
+					    prop_value, NULL);
+	panel_applet_gconf_set_int (applet, "maximum_buttons_size", prop_value, NULL);
+}
+
 static void
 setup_sensitivity (TasklistData *tasklist,
 		   GConfClient *client,
@@ -949,6 +1161,16 @@
 			   NULL,
 			   "display_all_workspaces" /* key */);
 
+	tasklist->window_list_size_radio = WID ("window_list_size_radio");
+	tasklist->buttons_size_radio = WID ("buttons_size_radio");
+
+	setup_sensitivity (tasklist, client, xml,
+			   "window_list_size_radio",
+			   "buttons_size_radio",
+			   NULL,
+			   "window_list_or_buttons_size");
+
+
 	tasklist->never_group_radio = WID ("never_group_radio");
 	tasklist->auto_group_radio = WID ("auto_group_radio");
 	tasklist->always_group_radio = WID ("always_group_radio");
@@ -982,6 +1204,38 @@
 			   "maximum_size_post_label",
 			   "maximum_size" /* key */);
 
+	tasklist->minimum_buttons_size_spin = WID ("minimum_buttons_size");
+//	setup_sensitivity (tasklist, client, xml,
+//			   "minimum_buttons_size",
+//			   "minimum_buttons_size_label",
+//			   "minimum_buttons_size_post_label",
+//			   "minimum_buttons_size" /* key */);
+	tasklist->maximum_buttons_size_spin = WID ("maximum_buttons_size");
+	setup_sensitivity (tasklist, client, xml,
+			   "maximum_buttons_size",
+			   "maximum_buttons_size_label",
+			   "maximum_buttons_size_post_label",
+			   "maximum_buttons_size" /* key */);
+
+	if (tasklist->orientation == GTK_ORIENTATION_HORIZONTAL)
+	{
+//enable button max size mode
+		gtk_widget_set_sensitive(GTK_WIDGET(tasklist->buttons_size_radio), TRUE);
+		gtk_widget_set_sensitive(GTK_WIDGET(tasklist->maximum_buttons_size_spin), TRUE);
+	}
+	else
+	{
+//disable button max size mode
+		tasklist->window_list_or_buttons_size = TRUE;
+		gtk_widget_set_sensitive(GTK_WIDGET(tasklist->buttons_size_radio), FALSE);
+		gtk_widget_set_sensitive(GTK_WIDGET(tasklist->maximum_buttons_size_spin), FALSE);
+		tasklist_update (tasklist);
+		tasklist_properties_update_size_radio (tasklist);
+	}
+
+
+
+
 	/* Window grouping: */
 	button = get_grouping_button (tasklist, tasklist->grouping);
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
@@ -1000,6 +1254,13 @@
 	    				       "maximum_size", NULL);
 	gtk_spin_button_set_value (GTK_SPIN_BUTTON (tasklist->maximum_size_spin), sizepref);
 
+	sizepref = panel_applet_gconf_get_int (PANEL_APPLET (tasklist->applet),
+					       "minimum_buttons_size", NULL);
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (tasklist->minimum_buttons_size_spin), sizepref);
+	sizepref = panel_applet_gconf_get_int (PANEL_APPLET (tasklist->applet),
+					       "maximum_buttons_size", NULL);
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (tasklist->maximum_buttons_size_spin), sizepref);
+
 	g_signal_connect (G_OBJECT (tasklist->never_group_radio), "toggled",
 			  (GCallback) group_windows_toggled, tasklist);
 	g_signal_connect (G_OBJECT (tasklist->auto_group_radio), "toggled",
@@ -1025,6 +1286,24 @@
 		          "value_changed", 
 			  (GCallback) spin_maximum_size_changed,
 			  tasklist);
+
+	tasklist_properties_update_size_radio (tasklist);
+	g_signal_connect (G_OBJECT (tasklist->window_list_size_radio), "toggled",
+			  (GCallback) window_list_or_buttons_size_toggled, tasklist);
+
+	g_signal_connect (G_OBJECT (tasklist->minimum_buttons_size_spin),
+			  "value_changed",
+			  (GCallback) spin_minimum_buttons_size_changed,
+			  tasklist);
+
+	g_signal_connect (G_OBJECT (tasklist->maximum_buttons_size_spin),
+			  "value_changed",
+			  (GCallback) spin_maximum_buttons_size_changed,
+			  tasklist);
+
+
+
+
 	g_signal_connect_swapped (WID ("done_button"), "clicked",
 				  (GCallback) gtk_widget_hide, 
 				  tasklist->properties_dialog);
