diff options
author | Havoc Pennington <hp@redhat.com> | 2001-04-28 00:12:47 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2001-04-28 00:12:47 +0000 |
commit | 7e9b154f0c73563c4f6a1ce681b78f508d88317c (patch) | |
tree | 3888c389efc586044b95640a31bd02d21423497f /gtk/gtkbbox.c | |
parent | 8ff2bf3b6efe288b29b2f406909ae635c9a84a71 (diff) | |
download | gtk+-7e9b154f0c73563c4f6a1ce681b78f508d88317c.tar.gz |
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
Diffstat (limited to 'gtk/gtkbbox.c')
-rw-r--r-- | gtk/gtkbbox.c | 60 |
1 files changed, 50 insertions, 10 deletions
diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c index 45fe3d3453..720248e95f 100644 --- a/gtk/gtkbbox.c +++ b/gtk/gtkbbox.c @@ -25,17 +25,16 @@ */ #include "gtkbbox.h" +#include "gtkintl.h" static void gtk_button_box_class_init (GtkButtonBoxClass *klass); static void gtk_button_box_init (GtkButtonBox *box); - -static gint default_child_min_width = 85; -static gint default_child_min_height = 27; -static gint default_child_ipad_x = 7; -static gint default_child_ipad_y = 0; - +#define DEFAULT_CHILD_MIN_WIDTH 85 +#define DEFAULT_CHILD_MIN_HEIGHT 27 +#define DEFAULT_CHILD_IPAD_X 7 +#define DEFAULT_CHILD_IPAD_Y 0 GtkType gtk_button_box_get_type (void) @@ -72,6 +71,42 @@ gtk_button_box_class_init (GtkButtonBoxClass *class) /* FIXME we need to override the "spacing" property on GtkBox once * libgobject allows that. */ + + gtk_widget_class_install_style_property (widget_class, + g_param_spec_int ("child_min_width", + _("Minimum child width"), + _("Minimum width of buttons inside the box"), + 0, + G_MAXINT, + DEFAULT_CHILD_MIN_WIDTH, + G_PARAM_READABLE)); + + gtk_widget_class_install_style_property (widget_class, + g_param_spec_int ("child_min_height", + _("Minimum child height"), + _("Minimum height of buttons inside the box"), + 0, + G_MAXINT, + DEFAULT_CHILD_MIN_HEIGHT, + G_PARAM_READABLE)); + + gtk_widget_class_install_style_property (widget_class, + g_param_spec_int ("child_internal_pad_x", + _("Child internal width padding"), + _("Amount to increase child's size on either side"), + 0, + G_MAXINT, + DEFAULT_CHILD_IPAD_X, + G_PARAM_READABLE)); + + gtk_widget_class_install_style_property (widget_class, + g_param_spec_int ("child_internal_pad_y", + _("Child internal height padding"), + _("Amount to increase child's size on the top and bottom"), + 0, + G_MAXINT, + DEFAULT_CHILD_IPAD_Y, + G_PARAM_READABLE)); } static void @@ -166,10 +201,15 @@ _gtk_button_box_child_requisition (GtkWidget *widget, bbox = GTK_BUTTON_BOX (widget); - width_default = default_child_min_width; - height_default = default_child_min_height; - ipad_x_default = default_child_ipad_x; - ipad_y_default = default_child_ipad_y; + gtk_widget_style_get (widget, + "child_min_width", + &width_default, + "child_min_height", + &height_default, + "child_internal_pad_x", + &ipad_x_default, + "child_internal_pad_y", + &ipad_y_default, NULL); child_min_width = bbox->child_min_width != GTK_BUTTONBOX_DEFAULT ? bbox->child_min_width : width_default; |