gimp r27450 - in trunk: . app/dialogs app/tools app/widgets
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27450 - in trunk: . app/dialogs app/tools app/widgets
- Date: Tue, 28 Oct 2008 17:40:32 +0000 (UTC)
Author: mitch
Date: Tue Oct 28 17:40:32 2008
New Revision: 27450
URL: http://svn.gnome.org/viewvc/gimp?rev=27450&view=rev
Log:
2008-10-28 Michael Natterer <mitch gimp org>
* app/widgets/gimpwidgets-utils.[ch]: added "gboolean below" to
gimp_enum_radio_frame_add() and gimp_enum_radio_box_add() and
place the widget right of the radio button unless "below" is TRUE.
* app/dialogs/convert-dialog.c
* app/dialogs/layer-add-mask-dialog.c
* app/tools/gimpbucketfilloptions.c
* app/tools/gimpclonetool.c
* app/tools/gimpperspectiveclonetool.c
* app/widgets/gimpfilleditor.c: pass TRUE so everything stays as-is.
Modified:
trunk/ChangeLog
trunk/app/dialogs/convert-dialog.c
trunk/app/dialogs/layer-add-mask-dialog.c
trunk/app/tools/gimpbucketfilloptions.c
trunk/app/tools/gimpclonetool.c
trunk/app/tools/gimpperspectiveclonetool.c
trunk/app/widgets/gimpfilleditor.c
trunk/app/widgets/gimpwidgets-utils.c
trunk/app/widgets/gimpwidgets-utils.h
Modified: trunk/app/dialogs/convert-dialog.c
==============================================================================
--- trunk/app/dialogs/convert-dialog.c (original)
+++ trunk/app/dialogs/convert-dialog.c Tue Oct 28 17:40:32 2008
@@ -184,7 +184,8 @@
/* max n_colors */
hbox = gtk_hbox_new (FALSE, 6);
- gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox, GIMP_MAKE_PALETTE);
+ gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox,
+ GIMP_MAKE_PALETTE, TRUE);
gtk_widget_show (hbox);
label = gtk_label_new_with_mnemonic (_("_Maximum number of colors:"));
@@ -207,8 +208,8 @@
/* custom palette */
if (palette_box)
{
- gimp_enum_radio_frame_add (GTK_FRAME (frame),
- palette_box, GIMP_CUSTOM_PALETTE);
+ gimp_enum_radio_frame_add (GTK_FRAME (frame), palette_box,
+ GIMP_CUSTOM_PALETTE, TRUE);
gtk_widget_show (palette_box);
}
Modified: trunk/app/dialogs/layer-add-mask-dialog.c
==============================================================================
--- trunk/app/dialogs/layer-add-mask-dialog.c (original)
+++ trunk/app/dialogs/layer-add-mask-dialog.c Tue Oct 28 17:40:32 2008
@@ -121,7 +121,8 @@
combo = gimp_container_combo_box_new (GIMP_ITEM (layer)->image->channels,
context,
GIMP_VIEW_SIZE_SMALL, 1);
- gimp_enum_radio_frame_add (GTK_FRAME (frame), combo, GIMP_ADD_CHANNEL_MASK);
+ gimp_enum_radio_frame_add (GTK_FRAME (frame), combo,
+ GIMP_ADD_CHANNEL_MASK, TRUE);
gtk_widget_show (combo);
g_signal_connect (combo, "select-item",
Modified: trunk/app/tools/gimpbucketfilloptions.c
==============================================================================
--- trunk/app/tools/gimpbucketfilloptions.c (original)
+++ trunk/app/tools/gimpbucketfilloptions.c Tue Oct 28 17:40:32 2008
@@ -233,7 +233,8 @@
hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options), 2,
"pattern-view-type", "pattern-view-size");
- gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox, GIMP_PATTERN_BUCKET_FILL);
+ gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox,
+ GIMP_PATTERN_BUCKET_FILL, TRUE);
/* fill selection */
str = g_strdup_printf (_("Affected Area (%s)"),
Modified: trunk/app/tools/gimpclonetool.c
==============================================================================
--- trunk/app/tools/gimpclonetool.c (original)
+++ trunk/app/tools/gimpclonetool.c Tue Oct 28 17:40:32 2008
@@ -112,11 +112,13 @@
button = gimp_prop_check_button_new (config, "sample-merged",
_("Sample merged"));
- gimp_enum_radio_frame_add (GTK_FRAME (frame), button, GIMP_IMAGE_CLONE);
+ gimp_enum_radio_frame_add (GTK_FRAME (frame), button,
+ GIMP_IMAGE_CLONE, TRUE);
hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options), 2,
"pattern-view-type", "pattern-view-size");
- gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox, GIMP_PATTERN_CLONE);
+ gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox,
+ GIMP_PATTERN_CLONE, TRUE);
table = gtk_table_new (1, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
Modified: trunk/app/tools/gimpperspectiveclonetool.c
==============================================================================
--- trunk/app/tools/gimpperspectiveclonetool.c (original)
+++ trunk/app/tools/gimpperspectiveclonetool.c Tue Oct 28 17:40:32 2008
@@ -940,11 +940,13 @@
button = gimp_prop_check_button_new (config, "sample-merged",
_("Sample merged"));
- gimp_enum_radio_frame_add (GTK_FRAME (frame), button, GIMP_IMAGE_CLONE);
+ gimp_enum_radio_frame_add (GTK_FRAME (frame), button,
+ GIMP_IMAGE_CLONE, TRUE);
hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options), 2,
"pattern-view-type", "pattern-view-size");
- gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox, GIMP_PATTERN_CLONE);
+ gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox,
+ GIMP_PATTERN_CLONE, TRUE);
table = gtk_table_new (1, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
Modified: trunk/app/widgets/gimpfilleditor.c
==============================================================================
--- trunk/app/widgets/gimpfilleditor.c (original)
+++ trunk/app/widgets/gimpfilleditor.c Tue Oct 28 17:40:32 2008
@@ -131,14 +131,14 @@
gimp_color_panel_set_context (GIMP_COLOR_PANEL (color_button),
GIMP_CONTEXT (editor->options));
gimp_enum_radio_box_add (GTK_BOX (box), color_button,
- GIMP_FILL_STYLE_SOLID);
+ GIMP_FILL_STYLE_SOLID, FALSE);
pattern_box = gimp_prop_pattern_box_new (NULL,
GIMP_CONTEXT (editor->options), 2,
"pattern-view-type",
"pattern-view-size");
gimp_enum_radio_box_add (GTK_BOX (box), pattern_box,
- GIMP_FILL_STYLE_PATTERN);
+ GIMP_FILL_STYLE_PATTERN, FALSE);
}
return object;
Modified: trunk/app/widgets/gimpwidgets-utils.c
==============================================================================
--- trunk/app/widgets/gimpwidgets-utils.c (original)
+++ trunk/app/widgets/gimpwidgets-utils.c Tue Oct 28 17:40:32 2008
@@ -246,7 +246,8 @@
void
gimp_enum_radio_box_add (GtkBox *box,
GtkWidget *widget,
- gint enum_value)
+ gint enum_value,
+ gboolean below)
{
GList *children;
GList *list;
@@ -267,48 +268,78 @@
{
GtkWidget *radio = list->data;
GtkWidget *hbox;
- GtkWidget *spacer;
- gint indicator_size;
- gint indicator_spacing;
- gint focus_width;
- gint focus_padding;
- gint border_width;
-
- gtk_widget_style_get (radio,
- "indicator-size", &indicator_size,
- "indicator-spacing", &indicator_spacing,
- "focus-line-width", &focus_width,
- "focus-padding", &focus_padding,
- NULL);
-
- border_width = gtk_container_get_border_width (GTK_CONTAINER (radio));
hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, 0);
+ gtk_box_reorder_child (GTK_BOX (box), hbox, pos);
+
+ if (below)
+ {
+ GtkWidget *spacer;
+ gint indicator_size;
+ gint indicator_spacing;
+ gint focus_width;
+ gint focus_padding;
+ gint border_width;
+
+ gtk_widget_style_get (radio,
+ "indicator-size", &indicator_size,
+ "indicator-spacing", &indicator_spacing,
+ "focus-line-width", &focus_width,
+ "focus-padding", &focus_padding,
+ NULL);
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (radio));
+
+ spacer = gtk_vbox_new (FALSE, 0);
+ gtk_widget_set_size_request (spacer,
+ indicator_size +
+ 3 * indicator_spacing +
+ focus_width +
+ focus_padding +
+ border_width,
+ -1);
+ gtk_box_pack_start (GTK_BOX (hbox), spacer, FALSE, FALSE, 0);
+ gtk_widget_show (spacer);
+ }
+ else
+ {
+ GtkSizeGroup *size_group;
+
+ size_group = g_object_get_data (G_OBJECT (box), "size-group");
+
+ if (! size_group)
+ {
+ size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ g_object_set_data (G_OBJECT (box), "size-group", size_group);
+
+ gtk_size_group_add_widget (size_group, radio);
+ g_object_unref (size_group);
+ }
+ else
+ {
+ gtk_size_group_add_widget (size_group, radio);
+ }
- spacer = gtk_vbox_new (FALSE, 0);
- gtk_widget_set_size_request (spacer,
- indicator_size +
- 3 * indicator_spacing +
- focus_width +
- focus_padding +
- border_width,
- -1);
- gtk_box_pack_start (GTK_BOX (hbox), spacer, FALSE, FALSE, 0);
- gtk_widget_show (spacer);
+ gtk_box_set_spacing (GTK_BOX (hbox), 4);
+
+ g_object_ref (radio);
+ gtk_container_remove (GTK_CONTAINER (box), radio);
+ gtk_box_pack_start (GTK_BOX (hbox), radio, FALSE, FALSE, 0);
+ g_object_unref (radio);
+ }
gtk_box_pack_start (GTK_BOX (hbox), widget, TRUE, TRUE, 0);
gtk_widget_show (widget);
- g_object_set_data (G_OBJECT (radio), "set_sensitive", hbox);
+ g_object_set_data (G_OBJECT (radio), "set_sensitive", widget);
g_signal_connect (radio, "toggled",
G_CALLBACK (gimp_toggle_button_sensitive_update),
NULL);
- gtk_widget_set_sensitive (hbox,
+ gtk_widget_set_sensitive (widget,
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (list->data)));
- gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, 0);
- gtk_box_reorder_child (GTK_BOX (box), hbox, pos);
gtk_widget_show (hbox);
break;
@@ -321,7 +352,8 @@
void
gimp_enum_radio_frame_add (GtkFrame *frame,
GtkWidget *widget,
- gint enum_value)
+ gint enum_value,
+ gboolean below)
{
GtkWidget *vbox;
@@ -332,7 +364,7 @@
g_return_if_fail (GTK_IS_VBOX (vbox));
- gimp_enum_radio_box_add (GTK_BOX (vbox), widget, enum_value);
+ gimp_enum_radio_box_add (GTK_BOX (vbox), widget, enum_value, below);
}
GtkIconSize
Modified: trunk/app/widgets/gimpwidgets-utils.h
==============================================================================
--- trunk/app/widgets/gimpwidgets-utils.h (original)
+++ trunk/app/widgets/gimpwidgets-utils.h Tue Oct 28 17:40:32 2008
@@ -40,10 +40,12 @@
gboolean left_align);
void gimp_enum_radio_box_add (GtkBox *box,
GtkWidget *widget,
- gint enum_value);
+ gint enum_value,
+ gboolean below);
void gimp_enum_radio_frame_add (GtkFrame *frame,
GtkWidget *widget,
- gint enum_value);
+ gint enum_value,
+ gboolean below);
GtkIconSize gimp_get_icon_size (GtkWidget *widget,
const gchar *stock_id,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]