Index: src/cpufreq-applet.c
===================================================================
RCS file: /cvs/gnome/gnome-applets/cpufreq/src/cpufreq-applet.c,v
retrieving revision 1.24
diff -u -p -r1.24 cpufreq-applet.c
--- src/cpufreq-applet.c	3 Oct 2006 16:18:22 -0000	1.24
+++ src/cpufreq-applet.c	19 Nov 2006 03:28:56 -0000
@@ -662,6 +662,7 @@ cpufreq_applet_update (CPUFreqApplet *ap
         gchar          *freq_label, *unit_label;
         gint            freq;
         gint            perc;
+        gint            width;
         guint           cpu;
         gchar          *governor;
 
@@ -675,18 +676,26 @@ cpufreq_applet_update (CPUFreqApplet *ap
         
         if (applet->show_freq) {
                 gtk_label_set_text (GTK_LABEL (applet->label), freq_label);
+                width = cpufreq_utils_get_max_frequency_label_width(monitor);
+                gtk_widget_set_size_request (GTK_WIDGET (applet->label), width, -1); 
         }
 
         if (applet->show_perc) {
                 gchar *text_perc;
 
                 text_perc = g_strdup_printf ("%d%%", perc);
                 gtk_label_set_text (GTK_LABEL (applet->label), text_perc);
+                width = cpufreq_utils_get_max_percentage_label_width();
+                gtk_widget_set_size_request (GTK_WIDGET (applet->label), width, -1);
+
                 g_free (text_perc);
         }
 
         if (applet->show_unit) {
                 gtk_label_set_text (GTK_LABEL (applet->unit_label), unit_label);
+                width = cpufreq_utils_get_max_unit_label_width(monitor);
+                gtk_widget_set_size_request (GTK_WIDGET (applet->unit_label), width, -1);
         }
 
         if (applet->show_icon) {
Index: src/cpufreq-utils.c
===================================================================
RCS file: /cvs/gnome/gnome-applets/cpufreq/src/cpufreq-utils.c,v
retrieving revision 1.2
diff -u -p -r1.2 cpufreq-utils.c
--- src/cpufreq-utils.c	9 Aug 2006 12:37:28 -0000	1.2
+++ src/cpufreq-utils.c	19 Nov 2006 03:28:56 -0000
@@ -21,6 +21,7 @@
 
 #include <glib.h>
 #include <gtk/gtkmessagedialog.h>
+#include <gtk/gtklabel.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -29,6 +30,7 @@
 #include <errno.h>
 
 #include "cpufreq-utils.h"
+#include "cpufreq-monitor.h"
 
 guint
 cpufreq_utils_get_n_cpus (void)
@@ -145,6 +147,50 @@ cpufreq_utils_get_frequency_label (guint
 		return g_strdup_printf ("%3.2f", ((gfloat)freq / divisor));
 }
 
+gint
+cpufreq_utils_get_max_frequency_label_width(CPUFreqMonitor *monitor)
+{
+    static gboolean maximum_obtained = FALSE;
+    static gint     width;
+
+    if (maximum_obtained)
+        return width;
+
+    /* get maximum label width of all frequency labels */
+    gint            current, max = 0;
+    GList          *available_freqs;
+    GtkWidget      *label;
+    GtkRequisition *requisition = g_malloc (sizeof (GtkRequisition));
+
+    const gchar *text;
+    gchar       *freq_text;
+    gint         freq;
+
+    available_freqs = cpufreq_monitor_get_available_frequencies (monitor);
+	
+    while (available_freqs) {
+        text = (const gchar *) available_freqs->data;
+        freq = atoi (text);
+        freq_text = cpufreq_utils_get_frequency_label (freq);
+
+        label = gtk_label_new (freq_text);
+        gtk_widget_size_request (GTK_WIDGET (label), requisition);
+        current = requisition->width;
+
+        if(current > width)
+            width = current;
+		
+        g_free (freq_text);
+        gtk_widget_destroy (GTK_WIDGET(label));
+		
+        available_freqs = g_list_next (available_freqs);
+    }
+
+    g_free (requisition);
+    maximum_obtained = TRUE;
+    return width;
+}
+
 gchar *
 cpufreq_utils_get_frequency_unit (guint freq)
 {
@@ -152,6 +198,64 @@ cpufreq_utils_get_frequency_unit (guint 
 		return g_strdup ("GHz");
 	else
 		return g_strdup ("MHz");
+}
+
+gint
+cpufreq_utils_get_max_unit_label_width (CPUFreqMonitor *monitor)
+{
+    static gboolean maximum_obtained = FALSE;
+    static gint     width;
+
+    if (maximum_obtained)
+        return width;
+
+    /* calculate maximum width of all unit labels */
+    GtkRequisition *requisition = g_malloc (sizeof (GtkRequisition));
+    gint            w1, w2;
+    GtkWidget      *label;
+
+    label = gtk_label_new (NULL);
+
+    gtk_label_set_text (GTK_LABEL (label), "GHz");
+    gtk_widget_size_request (GTK_WIDGET (label), requisition);
+    w1 = requisition->width;
+
+    gtk_label_set_text (GTK_LABEL (label), "MHz");
+    gtk_widget_size_request (GTK_WIDGET (label), requisition);
+    w2 = requisition->width;
+
+    gtk_widget_destroy (GTK_WIDGET (label));
+
+    if (w1 > w2)
+        width = w1;
+    else
+        width = w2;
+
+    g_free(requisition);
+    maximum_obtained = TRUE;
+    return width;
+}
+
+gint
+cpufreq_utils_get_max_percentage_label_width (void)
+{
+    static gboolean maximum_obtained = FALSE;
+    static gint     width;
+
+    if (maximum_obtained)
+        return width;
+
+    GtkRequisition *req = g_malloc (sizeof (GtkRequisition));
+    GtkWidget      *label;
+
+    /* actually no percentage string is wider than "100%" */
+    label = gtk_label_new ("100%");
+    gtk_widget_size_request (GTK_WIDGET (label), req);
+    width = req->width;
+
+    g_free (req);
+    maximum_obtained = TRUE;
+    return width;
 }
 
 gboolean
