[Gnucash-changes] r12318 - gnucash/trunk - Use newer function for setting the width of a GtkSpinButton.

David Hampton hampton at cvs.gnucash.org
Tue Jan 10 23:25:37 EST 2006


Author: hampton
Date: 2006-01-10 23:25:36 -0500 (Tue, 10 Jan 2006)
New Revision: 12318
Trac: http://svn.gnucash.org/trac/changeset/12318

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/gnome-utils/dialog-options.c
Log:
Use newer function for setting the width of a GtkSpinButton.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-01-11 03:08:25 UTC (rev 12317)
+++ gnucash/trunk/ChangeLog	2006-01-11 04:25:36 UTC (rev 12318)
@@ -1,5 +1,8 @@
 2006-01-10  David Hampton  <hampton at employees.org>
 
+	* src/gnome-utils/dialog-options.c: Use newer function for setting
+	the width of a GtkSpinButton.
+
 	* src/network-utils/Makefile.am:
 	* src/gnome-utils/gnc-html.c:
 	* src/gnome/top-level.c: The gnucash gpg networking code isn't

Modified: gnucash/trunk/src/gnome-utils/dialog-options.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-options.c	2006-01-11 03:08:25 UTC (rev 12317)
+++ gnucash/trunk/src/gnome-utils/dialog-options.c	2006-01-11 04:25:36 UTC (rev 12318)
@@ -1769,7 +1769,6 @@
   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(value), TRUE);
 
   {
-    GtkStyle *style;
     gdouble biggest;
     gint num_digits;
 
@@ -1786,26 +1785,9 @@
     if (num_digits == 0)
       num_digits = 1;
 
-    num_digits += num_decimals + 1;
+    num_digits += num_decimals;
 
-    style = gtk_widget_get_style(value);
-    if (style != NULL)
-    {
-      gchar *string;
-      gint width;
-
-      string = g_strnfill(num_digits, '8');
-      
-      width = gdk_text_measure(gdk_font_from_description (style->font_desc), 
-                 string, num_digits);
-
-      /* sync with gtkspinbutton.c. why doesn't it do this itself? */
-      width += 11 + (2 * style->xthickness);
-
-      g_free(string);
-
-      gtk_widget_set_size_request(value, width, -1);
-    }
+    gtk_entry_set_width_chars(GTK_ENTRY(value), num_digits);
   }
 
   gnc_option_set_widget (option, value);



More information about the gnucash-changes mailing list