mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Use newer function for setting the width of a GtkSpinButton.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12318 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
2006-01-10 David Hampton <hampton@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
|
||||
|
||||
@@ -1769,7 +1769,6 @@ gnc_option_set_ui_widget_number_range (GNCOption *option, GtkBox *page_box,
|
||||
gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(value), TRUE);
|
||||
|
||||
{
|
||||
GtkStyle *style;
|
||||
gdouble biggest;
|
||||
gint num_digits;
|
||||
|
||||
@@ -1786,26 +1785,9 @@ gnc_option_set_ui_widget_number_range (GNCOption *option, GtkBox *page_box,
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user