Commit 67ee237b authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

added a GtkSizeGroup member and put all labels into the group.

2005-11-02  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpsizebox.[ch]: added a GtkSizeGroup member and put
	all labels into the group.

	* app/dialogs/scale-dialog.c: put the "Interpolation:" label into
	the same size box.
parent 9c94f603
2005-11-02 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpsizebox.[ch]: added a GtkSizeGroup member and put
all labels into the group.
* app/dialogs/scale-dialog.c: put the "Interpolation:" label into
the same size box.
2005-11-02 Michael Natterer <mitch@gimp.org> 2005-11-02 Michael Natterer <mitch@gimp.org>
* libgimp/gimpprocbrowserdialog.c (browser_search): added comment * libgimp/gimpprocbrowserdialog.c (browser_search): added comment
......
...@@ -185,6 +185,8 @@ scale_dialog_new (GimpViewable *viewable, ...@@ -185,6 +185,8 @@ scale_dialog_new (GimpViewable *viewable,
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label); gtk_widget_show (label);
gtk_size_group_add_widget (GIMP_SIZE_BOX (private->box)->size_group, label);
private->combo = gimp_enum_combo_box_new (GIMP_TYPE_INTERPOLATION_TYPE); private->combo = gimp_enum_combo_box_new (GIMP_TYPE_INTERPOLATION_TYPE);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), private->combo); gtk_label_set_mnemonic_widget (GTK_LABEL (label), private->combo);
gtk_box_pack_start (GTK_BOX (hbox), private->combo, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), private->combo, TRUE, TRUE, 0);
......
...@@ -82,6 +82,8 @@ static void gimp_size_box_get_property (GObject *object, ...@@ -82,6 +82,8 @@ static void gimp_size_box_get_property (GObject *object,
GValue *value, GValue *value,
GParamSpec *pspec); GParamSpec *pspec);
static void gimp_size_box_destroy (GtkObject *object);
static void gimp_size_box_update_size (GimpSizeBox *box); static void gimp_size_box_update_size (GimpSizeBox *box);
static void gimp_size_box_update_resolution (GimpSizeBox *box); static void gimp_size_box_update_resolution (GimpSizeBox *box);
...@@ -120,7 +122,8 @@ gimp_size_box_get_type (void) ...@@ -120,7 +122,8 @@ gimp_size_box_get_type (void)
static void static void
gimp_size_box_class_init (GimpSizeBoxClass *klass) gimp_size_box_class_init (GimpSizeBoxClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
...@@ -128,6 +131,8 @@ gimp_size_box_class_init (GimpSizeBoxClass *klass) ...@@ -128,6 +131,8 @@ gimp_size_box_class_init (GimpSizeBoxClass *klass)
object_class->set_property = gimp_size_box_set_property; object_class->set_property = gimp_size_box_set_property;
object_class->get_property = gimp_size_box_get_property; object_class->get_property = gimp_size_box_get_property;
gtk_object_class->destroy = gimp_size_box_destroy;
g_type_class_add_private (object_class, sizeof (GimpSizeBoxPrivate)); g_type_class_add_private (object_class, sizeof (GimpSizeBoxPrivate));
g_object_class_install_property (object_class, PROP_WIDTH, g_object_class_install_property (object_class, PROP_WIDTH,
...@@ -190,6 +195,8 @@ static void ...@@ -190,6 +195,8 @@ static void
gimp_size_box_init (GimpSizeBox *box) gimp_size_box_init (GimpSizeBox *box)
{ {
gtk_box_set_spacing (GTK_BOX (box), 6); gtk_box_set_spacing (GTK_BOX (box), 6);
box->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
} }
static GObject * static GObject *
...@@ -199,11 +206,13 @@ gimp_size_box_constructor (GType type, ...@@ -199,11 +206,13 @@ gimp_size_box_constructor (GType type,
{ {
GObject *object; GObject *object;
GimpSizeBox *box; GimpSizeBox *box;
GimpSizeBoxPrivate *priv;
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *entry; GtkWidget *entry;
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *label; GtkWidget *label;
GimpSizeBoxPrivate *priv; GList *children;
GList *list;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params); object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
...@@ -247,6 +256,12 @@ gimp_size_box_constructor (GType type, ...@@ -247,6 +256,12 @@ gimp_size_box_constructor (GType type,
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
gtk_widget_show (entry); gtk_widget_show (entry);
children = gtk_container_get_children (GTK_CONTAINER (entry));
for (list = children; list; list = g_list_next (list))
if (GTK_IS_LABEL (list->data))
gtk_size_group_add_widget (box->size_group, list->data);
g_list_free (children);
vbox = gtk_vbox_new (2, FALSE); vbox = gtk_vbox_new (2, FALSE);
gtk_table_attach_defaults (GTK_TABLE (entry), vbox, 1, 3, 2, 3); gtk_table_attach_defaults (GTK_TABLE (entry), vbox, 1, 3, 2, 3);
gtk_widget_show (vbox); gtk_widget_show (vbox);
...@@ -282,6 +297,12 @@ gimp_size_box_constructor (GType type, ...@@ -282,6 +297,12 @@ gimp_size_box_constructor (GType type,
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
gtk_widget_show (entry); gtk_widget_show (entry);
children = gtk_container_get_children (GTK_CONTAINER (entry));
for (list = children; list; list = g_list_next (list))
if (GTK_IS_LABEL (list->data))
gtk_size_group_add_widget (box->size_group, list->data);
g_list_free (children);
gimp_prop_coordinates_connect (G_OBJECT (box), gimp_prop_coordinates_connect (G_OBJECT (box),
"xresolution", "yresolution", "xresolution", "yresolution",
"resolution-unit", "resolution-unit",
...@@ -418,6 +439,20 @@ gimp_size_box_get_property (GObject *object, ...@@ -418,6 +439,20 @@ gimp_size_box_get_property (GObject *object,
} }
} }
static void
gimp_size_box_destroy (GtkObject *object)
{
GimpSizeBox *box = GIMP_SIZE_BOX (object);
if (box->size_group)
{
g_object_unref (box->size_group);
box->size_group = NULL;
}
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void static void
gimp_size_box_update_size (GimpSizeBox *box) gimp_size_box_update_size (GimpSizeBox *box)
{ {
......
...@@ -39,6 +39,8 @@ struct _GimpSizeBox ...@@ -39,6 +39,8 @@ struct _GimpSizeBox
{ {
GtkVBox parent_instance; GtkVBox parent_instance;
GtkSizeGroup *size_group;
gint width; gint width;
gint height; gint height;
GimpUnit unit; GimpUnit unit;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment