Index: applets/clock/clock.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/applets/clock/clock.c,v
retrieving revision 1.151
diff -u -r1.151 clock.c
--- applets/clock/clock.c	27 Sep 2004 16:17:18 -0000	1.151
+++ applets/clock/clock.c	13 Oct 2004 21:36:50 -0000
@@ -262,13 +262,6 @@
 static void
 update_timeformat (ClockData *cd)
 {
- /* Show date in another line if panel is vertical, or
-  * horizontal but large enough to hold two lines of text
-  */
-#define USE_TWO_LINE_FORMAT(cd) ((cd)->orient == PANEL_APPLET_ORIENT_LEFT  || \
-                                 (cd)->orient == PANEL_APPLET_ORIENT_RIGHT || \
-                                 (cd)->size >= GNOME_Vertigo_PANEL_MEDIUM)
-
 	const char *time_format;
 	const char *date_format;
 	char       *clock_format;
@@ -287,22 +280,27 @@
 		 *              should begin with a 0 in your locale (e.g. "May
 		 *              01" instead of "May  1").
 		 */
-		date_format = _("%a %b %e");
+		date_format = _("%a,%b %e");
+
+                /* Spread the clock on two or three lines depending on the panel orientation and size */
+                if (cd->orient == PANEL_APPLET_ORIENT_UP || cd->orient == PANEL_APPLET_ORIENT_DOWN) {
+                        if (cd->size > GNOME_Vertigo_PANEL_SMALL)
+                                g_strdelimit (clock_format, ",", '\n');
+                        if (cd->size > GNOME_Vertigo_PANEL_MEDIUM)
+                                g_strdelimit (clock_format, ";", '\n');
+                } else {
+                        g_strdelimit (clock_format, ",", '\n');
+                        if (cd->size < GNOME_Vertigo_PANEL_X_LARGE)
+                                g_strdelimit (clock_format, ";", '\n');
+                }
+
+                g_strdelimit (clock_format, ";,", ' ');
+                /* translators: reverse the order of these arguments
+                 *              if the time should come before the
+                 *              date on a clock in your locale.
+                 */
+                clock_format = g_strdup_printf (_("%1$s,%2$s"), date_format, time_format);
 
-		if (USE_TWO_LINE_FORMAT (cd))
-			/* translators: reverse the order of these arguments
-			 *              if the time should come before the
-			 *              date on a clock in your locale.
-			 */
-			clock_format = g_strdup_printf (_("%1$s\n%2$s"),
-							date_format, time_format);
-		else
-			/* translators: reverse the order of these arguments
-			 *              if the time should come before the
-			 *              date on a clock in your locale.
-			 */
-			clock_format = g_strdup_printf (_("%1$s, %2$s"),
-							date_format, time_format);
 	}
 
 	g_free (cd->timeformat);
@@ -313,7 +311,6 @@
 
 	g_free (clock_format);
 
-#undef USE_TWO_LINE_FORMAT
 }
 
 /* sets accessible name and description for the widget */
@@ -1633,11 +1630,19 @@
 
 /* this is when the panel size changes */
 static void
-applet_change_pixel_size (PanelApplet *applet,
-			  gint         size,
-			  ClockData   *cd)
-{
-	cd->size = size;
+applet_size_allocate (PanelApplet   *applet,
+			  GtkAllocation *allocation,
+			  ClockData     *cd)
+{
+        if (cd->orient == PANEL_APPLET_ORIENT_UP || cd->orient == PANEL_APPLET_ORIENT_DOWN) {
+                if (cd->size == allocation->height)
+                        return;
+                cd->size = allocation->height;
+        } else {
+                if (cd->size == allocation->width)
+                        return;
+                cd->size = allocation->width;
+        }
 
         unfix_size (cd);
 	update_timeformat (cd);
@@ -2102,8 +2107,8 @@
 
 	/* similiar to the above in semantics*/
 	g_signal_connect (G_OBJECT (cd->applet),
-			  "change_size",
-			  G_CALLBACK (applet_change_pixel_size),
+			  "size_allocate",
+			  G_CALLBACK (applet_size_allocate),
 			  cd);
 
 	/* FIXME: initial background, this needs some panel-applet voodoo */
