Re: [evolution-patches] A patch for calendar based on trunk



JP Rosevear wrote:

On Mon, 2004-03-01 at 02:12, Kidd Wang wrote:
Hi,

This patch is aimed for trunk. We have found a bug in calendar which can be reproduced as follows:
1. Invoke evolution on Japanese locales.
2. Choose [File] -> [New] -> [Appointment].
3. Select [Appointment] tab.
4. Choose an arrow button in "Start time" or "End time".

Then Japanese "01:00 AM" is longer than the text box, so the string is shifted left.

Enclosed is the snapshot and a patch to fix that. Would you like to spend a little time to review it?

I suspect hardcoding a larger value is not the way to fix this.  IIRC
this hard code is there because ages ago gtk did not properly size
allocate the combo box based on the child size.  The hard coded size may
not even be necessary now, the other option would be to calculate the
size of the time strings and then set the size request to the maximal
size plus some padding.

-JP
Before I sent you the patch yesterday, I did have tried your second option to call some pango functions, such as pango_layout_get_pixel_size, to calculate the accurate size of the box, but unfortunely it seems that these functions can only give me
an approximate value which is almost always much less than the text appears.
Enclosed is a patch conforming to your first option and snapshots are also given below.
Does it look OK?
Index: widgets/misc/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/widgets/misc/ChangeLog,v
retrieving revision 1.275
diff -u -r1.275 ChangeLog
--- widgets/misc/ChangeLog	26 Feb 2004 22:20:15 -0000	1.275
+++ widgets/misc/ChangeLog	2 Mar 2004 06:49:14 -0000
@@ -1,3 +1,8 @@
+2004-03-02  Kidd Wang  <kidd wang sun com>
+
+	* e-dateedit.c: (create_children): remove the hard coded size of the
+	combo box.
+
 2004-02-26  Rodney Dawes  <dobey ximian com>
 
 	* e-cell-renderer-combo.c (ecrc_get_size):
Index: widgets/misc/e-dateedit.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/misc/e-dateedit.c,v
retrieving revision 1.39
diff -u -r1.39 e-dateedit.c
--- widgets/misc/e-dateedit.c	26 Feb 2004 22:20:15 -0000	1.39
+++ widgets/misc/e-dateedit.c	2 Mar 2004 06:49:15 -0000
@@ -322,7 +322,6 @@
 	priv = dedit->priv;
 
 	priv->date_entry  = gtk_entry_new ();
-	gtk_widget_set_size_request (priv->date_entry, 90, -1);
 	gtk_box_pack_start (GTK_BOX (dedit), priv->date_entry, FALSE, TRUE, 0);
 	
 	g_signal_connect (priv->date_entry, "key_press_event",
@@ -354,7 +353,6 @@
 
 
 	priv->time_combo = gtk_combo_new ();
-	gtk_widget_set_size_request (GTK_COMBO (priv->time_combo)->entry, 90, -1);
 	gtk_box_pack_start (GTK_BOX (dedit), priv->time_combo, FALSE, TRUE, 0);
 	rebuild_time_popup (dedit);
 

PNG image

PNG image



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