Commit 190a68b9 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

added GIMP_COLOR_PICK_MODE_NONE to the GimpColorPickMode enum.

2003-10-25  Sven Neumann  <sven@gimp.org>

	* app/tools/tools-enums.[ch]: added GIMP_COLOR_PICK_MODE_NONE to
	the GimpColorPickMode enum.

	* app/tools/gimpcolorpickeroptions.[ch]: removed "update-toolbox"
	property; the new enum value serves this role better.

	* app/tools/gimpcolorpickertool.c: handle the new enum value.

	* app/tools/gimpcolortool.c: default to GIMP_COLOR_PICK_MODE_NONE.
	Don't set a cursor modifier for this value. Fixes tool cursor for
	levels and curves tools.

	* app/tools/gimppainttool.[ch]: added a function to conveniently
	enable the color picker and set the pick mode at the same time.

	* app/tools/gimpairbrushtool.c
	* app/tools/gimppaintbrushtool.c
	* app/tools/gimppenciltool.c
	* app/tools/gimpsmudgetool.c: use the new function.

	* app/tools/gimperasertool.c: enabled color picking in the eraser
	tool but set the mode to GIMP_COLOR_PICK_MODE_BACKGROUND.
parent f7db733e
2003-10-25 Sven Neumann <sven@gimp.org>
* app/tools/tools-enums.[ch]: added GIMP_COLOR_PICK_MODE_NONE to
the GimpColorPickMode enum.
* app/tools/gimpcolorpickeroptions.[ch]: removed "update-toolbox"
property; the new enum value serves this role better.
* app/tools/gimpcolorpickertool.c: handle the new enum value.
* app/tools/gimpcolortool.c: default to GIMP_COLOR_PICK_MODE_NONE.
Don't set a cursor modifier for this value. Fixes tool cursor for
levels and curves tools.
* app/tools/gimppainttool.[ch]: added a function to conveniently
enable the color picker and set the pick mode at the same time.
* app/tools/gimpairbrushtool.c
* app/tools/gimppaintbrushtool.c
* app/tools/gimppenciltool.c
* app/tools/gimpsmudgetool.c: use the new function.
* app/tools/gimperasertool.c: enabled color picking in the eraser
tool but set the mode to GIMP_COLOR_PICK_MODE_BACKGROUND.
2003-10-25 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-utils.[ch] (gimp_config_connect): make it
......@@ -92,15 +92,12 @@ gimp_airbrush_tool_get_type (void)
static void
gimp_airbrush_tool_init (GimpAirbrushTool *airbrush)
{
GimpTool *tool;
GimpPaintTool *paint_tool;
tool = GIMP_TOOL (airbrush);
paint_tool = GIMP_PAINT_TOOL (airbrush);
GimpTool *tool = GIMP_TOOL (airbrush);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_AIRBRUSH_TOOL_CURSOR);
paint_tool->pick_colors = TRUE;
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (airbrush),
GIMP_COLOR_PICK_MODE_FOREGROUND);
}
......
......@@ -244,6 +244,29 @@ gimp_paint_tool_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
/**
* gimp_paint_tool_enable_color_picker:
* @tool: a #GimpPaintTool
* @mode: the #GimpColorPickMode to set
*
* This is a convenience function used from the init method of paint
* tools that want the color picking functionality. The @mode that is
* set here is used to decide what cursor modifier to draw and if the
* picked color goes to the foreground or background color.
**/
void
gimp_paint_tool_enable_color_picker (GimpPaintTool *tool,
GimpColorPickMode mode)
{
g_return_if_fail (GIMP_IS_PAINT_TOOL (tool));
tool->pick_colors = TRUE;
GIMP_COLOR_TOOL (tool)->pick_mode = mode;
}
static void
gimp_paint_tool_control (GimpTool *tool,
GimpToolAction action,
......@@ -860,7 +883,20 @@ gimp_paint_tool_color_picked (GimpColorTool *color_tool,
GimpContext *context;
context = gimp_get_user_context (tool->gdisp->gimage->gimp);
gimp_context_set_foreground (context, color);
switch (color_tool->pick_mode)
{
case GIMP_COLOR_PICK_MODE_NONE:
break;
case GIMP_COLOR_PICK_MODE_FOREGROUND:
gimp_context_set_foreground (context, color);
break;
case GIMP_COLOR_PICK_MODE_BACKGROUND:
gimp_context_set_background (context, color);
break;
}
}
}
......
......@@ -53,7 +53,10 @@ struct _GimpPaintToolClass
};
GType gimp_paint_tool_get_type (void) G_GNUC_CONST;
GType gimp_paint_tool_get_type (void) G_GNUC_CONST;
void gimp_paint_tool_enable_color_picker (GimpPaintTool *tool,
GimpColorPickMode mode);
#endif /* __GIMP_PAINT_TOOL_H__ */
......@@ -38,7 +38,6 @@ enum
{
PROP_0,
PROP_SAMPLE_AVERAGE, /* overrides a GimpColorOptions property */
PROP_UPDATE_TOOLBOX,
PROP_PICK_MODE
};
......@@ -103,10 +102,6 @@ gimp_color_picker_options_class_init (GimpColorPickerOptionsClass *klass)
"sample-average", NULL,
FALSE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_UPDATE_TOOLBOX,
"update-toolbox", NULL,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_PICK_MODE,
"pick-mode", NULL,
GIMP_TYPE_COLOR_PICK_MODE,
......@@ -127,9 +122,6 @@ gimp_color_picker_options_set_property (GObject *object,
case PROP_SAMPLE_AVERAGE:
GIMP_COLOR_OPTIONS (options)->sample_average = g_value_get_boolean (value);
break;
case PROP_UPDATE_TOOLBOX:
options->update_toolbox = g_value_get_boolean (value);
break;
case PROP_PICK_MODE:
options->pick_mode = g_value_get_enum (value);
break;
......@@ -153,9 +145,6 @@ gimp_color_picker_options_get_property (GObject *object,
g_value_set_boolean (value,
GIMP_COLOR_OPTIONS (options)->sample_average);
break;
case PROP_UPDATE_TOOLBOX:
g_value_set_boolean (value, options->update_toolbox);
break;
case PROP_PICK_MODE:
g_value_set_enum (value, options->pick_mode);
break;
......@@ -168,12 +157,11 @@ gimp_color_picker_options_get_property (GObject *object,
GtkWidget *
gimp_color_picker_options_gui (GimpToolOptions *tool_options)
{
GimpColorPickerOptions *options = GIMP_COLOR_PICKER_OPTIONS (tool_options);
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox;
GtkWidget *button;
GtkWidget *frame;
gchar *str;
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox;
GtkWidget *button;
GtkWidget *frame;
gchar *str;
vbox = gimp_color_options_gui (tool_options);
......@@ -183,12 +171,6 @@ gimp_color_picker_options_gui (GimpToolOptions *tool_options)
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
/* the update toolbox color toggle button */
button = gimp_prop_check_button_new (config, "update-toolbox",
_("Update Toolbox Color"));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
/* the pick FG/BG frame */
str = g_strdup_printf (_("Pick Mode %s"), gimp_get_mod_name_control ());
frame = gimp_prop_enum_radio_frame_new (config, "pick-mode", str, -1, -1);
......@@ -197,8 +179,5 @@ gimp_color_picker_options_gui (GimpToolOptions *tool_options)
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
gtk_widget_show (frame);
gtk_widget_set_sensitive (frame, options->update_toolbox);
g_object_set_data (G_OBJECT (button), "set_sensitive", frame);
return vbox;
}
......@@ -36,10 +36,9 @@ typedef struct _GimpToolOptionsClass GimpColorPickerOptionsClass;
struct _GimpColorPickerOptions
{
GimpColorOptions parent_instance;
GimpColorOptions parent_instance;
gboolean update_toolbox;
GimpColorPickMode pick_mode;
GimpColorPickMode pick_mode;
};
......
......@@ -155,6 +155,8 @@ gimp_color_picker_tool_class_init (GimpColorPickerToolClass *klass)
static void
gimp_color_picker_tool_init (GimpColorPickerTool *tool)
{
GIMP_COLOR_TOOL (tool)->pick_mode = GIMP_COLOR_PICK_MODE_FOREGROUND;
gimp_tool_control_set_preserve (GIMP_TOOL (tool)->control, FALSE);
}
......@@ -223,6 +225,9 @@ gimp_color_picker_tool_modifier_key (GimpTool *tool,
{
switch (options->pick_mode)
{
case GIMP_COLOR_PICK_MODE_NONE:
break;
case GIMP_COLOR_PICK_MODE_FOREGROUND:
g_object_set (options, "pick-mode", GIMP_COLOR_PICK_MODE_BACKGROUND,
NULL);
......@@ -232,9 +237,6 @@ gimp_color_picker_tool_modifier_key (GimpTool *tool,
g_object_set (options, "pick-mode", GIMP_COLOR_PICK_MODE_FOREGROUND,
NULL);
break;
default:
break;
}
}
......@@ -262,6 +264,7 @@ gimp_color_picker_tool_picked (GimpColorTool *color_tool,
GimpTool *tool;
GimpColorPickerTool *picker_tool;
GimpColorPickerOptions *options;
GimpContext *user_context;
tool = GIMP_TOOL (color_tool);
picker_tool = GIMP_COLOR_PICKER_TOOL (color_tool);
......@@ -274,26 +277,24 @@ gimp_color_picker_tool_picked (GimpColorTool *color_tool,
options = GIMP_COLOR_PICKER_OPTIONS (color_tool->options);
if (options->update_toolbox)
{
GimpContext *user_context;
user_context = gimp_get_user_context (tool->gdisp->gimage->gimp);
user_context = gimp_get_user_context (tool->gdisp->gimage->gimp);
#if 0
gimp_palette_editor_update_color (user_context, color, update_state);
gimp_palette_editor_update_color (user_context, color, update_state);
#endif
switch (options->pick_mode)
{
case GIMP_COLOR_PICK_MODE_FOREGROUND:
gimp_context_set_foreground (user_context, color);
break;
switch (options->pick_mode)
{
case GIMP_COLOR_PICK_MODE_NONE:
break;
case GIMP_COLOR_PICK_MODE_BACKGROUND:
gimp_context_set_background (user_context, color);
break;
}
case GIMP_COLOR_PICK_MODE_FOREGROUND:
gimp_context_set_foreground (user_context, color);
break;
case GIMP_COLOR_PICK_MODE_BACKGROUND:
gimp_context_set_background (user_context, color);
break;
}
}
......
......@@ -110,7 +110,7 @@ gimp_color_tool_get_type (void)
};
tool_type = g_type_register_static (GIMP_TYPE_DRAW_TOOL,
"GimpColorTool",
"GimpColorTool",
&tool_info, 0);
}
......@@ -175,7 +175,7 @@ gimp_color_tool_init (GimpColorTool *color_tool)
color_tool->enabled = FALSE;
color_tool->center_x = 0;
color_tool->center_y = 0;
color_tool->pick_mode = GIMP_COLOR_PICK_MODE_FOREGROUND;
color_tool->pick_mode = GIMP_COLOR_PICK_MODE_NONE;
color_tool->options = NULL;
}
......@@ -261,7 +261,8 @@ gimp_color_tool_cursor_update (GimpTool *tool,
if (color_tool->enabled)
{
GdkCursorType cursor = GIMP_BAD_CURSOR;
GdkCursorType cursor = GIMP_BAD_CURSOR;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
if (coords->x > 0 && coords->x < gdisp->gimage->width &&
coords->y > 0 && coords->y < gdisp->gimage->height &&
......@@ -272,13 +273,22 @@ gimp_color_tool_cursor_update (GimpTool *tool,
cursor = GIMP_COLOR_PICKER_CURSOR;
}
switch (color_tool->pick_mode)
{
case GIMP_COLOR_PICK_MODE_NONE:
modifier = GIMP_CURSOR_MODIFIER_NONE;
break;
case GIMP_COLOR_PICK_MODE_FOREGROUND:
modifier = GIMP_CURSOR_MODIFIER_FOREGROUND;
break;
case GIMP_COLOR_PICK_MODE_BACKGROUND:
modifier = GIMP_CURSOR_MODIFIER_BACKGROUND;
break;
}
gimp_tool_set_cursor (tool, gdisp,
cursor,
GIMP_COLOR_PICKER_TOOL_CURSOR,
color_tool->pick_mode ==
GIMP_COLOR_PICK_MODE_FOREGROUND ?
GIMP_CURSOR_MODIFIER_FOREGROUND :
GIMP_CURSOR_MODIFIER_BACKGROUND);
GIMP_COLOR_PICKER_TOOL_CURSOR, modifier);
return; /* don't chain up */
}
......
......@@ -106,9 +106,7 @@ gimp_eraser_tool_get_type (void)
static void
gimp_eraser_tool_class_init (GimpEraserToolClass *klass)
{
GimpToolClass *tool_class;
tool_class = GIMP_TOOL_CLASS (klass);
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......@@ -119,11 +117,7 @@ gimp_eraser_tool_class_init (GimpEraserToolClass *klass)
static void
gimp_eraser_tool_init (GimpEraserTool *eraser)
{
GimpTool *tool;
GimpPaintTool *paint_tool;
tool = GIMP_TOOL (eraser);
paint_tool = GIMP_PAINT_TOOL (eraser);
GimpTool *tool = GIMP_TOOL (eraser);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_ERASER_TOOL_CURSOR);
......@@ -131,6 +125,9 @@ gimp_eraser_tool_init (GimpEraserTool *eraser)
GIMP_ERASER_TOOL_CURSOR);
gimp_tool_control_set_toggle_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_MINUS);
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (eraser),
GIMP_COLOR_PICK_MODE_BACKGROUND);
}
static void
......
......@@ -92,14 +92,11 @@ gimp_paintbrush_tool_get_type (void)
static void
gimp_paintbrush_tool_init (GimpPaintbrushTool *paintbrush)
{
GimpTool *tool;
GimpPaintTool *paint_tool;
tool = GIMP_TOOL (paintbrush);
paint_tool = GIMP_PAINT_TOOL (paintbrush);
GimpTool *tool = GIMP_TOOL (paintbrush);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_PAINTBRUSH_TOOL_CURSOR);
paint_tool->pick_colors = TRUE;
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (paintbrush),
GIMP_COLOR_PICK_MODE_FOREGROUND);
}
......@@ -244,6 +244,29 @@ gimp_paint_tool_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
/**
* gimp_paint_tool_enable_color_picker:
* @tool: a #GimpPaintTool
* @mode: the #GimpColorPickMode to set
*
* This is a convenience function used from the init method of paint
* tools that want the color picking functionality. The @mode that is
* set here is used to decide what cursor modifier to draw and if the
* picked color goes to the foreground or background color.
**/
void
gimp_paint_tool_enable_color_picker (GimpPaintTool *tool,
GimpColorPickMode mode)
{
g_return_if_fail (GIMP_IS_PAINT_TOOL (tool));
tool->pick_colors = TRUE;
GIMP_COLOR_TOOL (tool)->pick_mode = mode;
}
static void
gimp_paint_tool_control (GimpTool *tool,
GimpToolAction action,
......@@ -860,7 +883,20 @@ gimp_paint_tool_color_picked (GimpColorTool *color_tool,
GimpContext *context;
context = gimp_get_user_context (tool->gdisp->gimage->gimp);
gimp_context_set_foreground (context, color);
switch (color_tool->pick_mode)
{
case GIMP_COLOR_PICK_MODE_NONE:
break;
case GIMP_COLOR_PICK_MODE_FOREGROUND:
gimp_context_set_foreground (context, color);
break;
case GIMP_COLOR_PICK_MODE_BACKGROUND:
gimp_context_set_background (context, color);
break;
}
}
}
......
......@@ -53,7 +53,10 @@ struct _GimpPaintToolClass
};
GType gimp_paint_tool_get_type (void) G_GNUC_CONST;
GType gimp_paint_tool_get_type (void) G_GNUC_CONST;
void gimp_paint_tool_enable_color_picker (GimpPaintTool *tool,
GimpColorPickMode mode);
#endif /* __GIMP_PAINT_TOOL_H__ */
......@@ -88,14 +88,11 @@ gimp_pencil_tool_get_type (void)
static void
gimp_pencil_tool_init (GimpPencilTool *pencil)
{
GimpTool *tool;
GimpPaintTool *paint_tool;
tool = GIMP_TOOL (pencil);
paint_tool = GIMP_PAINT_TOOL (pencil);
GimpTool *tool = GIMP_TOOL (pencil);
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_PENCIL_TOOL_CURSOR);
paint_tool->pick_colors = TRUE;
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (pencil),
GIMP_COLOR_PICK_MODE_FOREGROUND);
}
......@@ -92,15 +92,12 @@ gimp_smudge_tool_get_type (void)
static void
gimp_smudge_tool_init (GimpSmudgeTool *smudge)
{
GimpTool *tool;
GimpPaintTool *paint_tool;
tool = GIMP_TOOL (smudge);
paint_tool = GIMP_PAINT_TOOL (smudge);
GimpTool *tool = GIMP_TOOL (smudge);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_SMUDGE_TOOL_CURSOR);
paint_tool->pick_colors = TRUE;
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (smudge),
GIMP_COLOR_PICK_MODE_FOREGROUND);
}
......
......@@ -11,8 +11,9 @@
static const GEnumValue gimp_color_pick_mode_enum_values[] =
{
{ GIMP_COLOR_PICK_MODE_FOREGROUND, N_("Pick Foreground Color"), "foreground" },
{ GIMP_COLOR_PICK_MODE_BACKGROUND, N_("Pick Background Color"), "background" },
{ GIMP_COLOR_PICK_MODE_NONE, N_("Pick Only"), "none" },
{ GIMP_COLOR_PICK_MODE_FOREGROUND, N_("Set Foreground Color"), "foreground" },
{ GIMP_COLOR_PICK_MODE_BACKGROUND, N_("Set Background Color"), "background" },
{ 0, NULL, NULL }
};
......
......@@ -20,7 +20,7 @@
#define __TOOLS_ENUMS_H__
/*
* these enums that are registered with the type system
* these enums are registered with the type system
*/
#define GIMP_TYPE_COLOR_PICK_MODE (gimp_color_pick_mode_get_type ())
......@@ -29,8 +29,9 @@ GType gimp_color_pick_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_COLOR_PICK_MODE_FOREGROUND, /*< desc="Pick Foreground Color" >*/
GIMP_COLOR_PICK_MODE_BACKGROUND /*< desc="Pick Background Color" >*/
GIMP_COLOR_PICK_MODE_NONE, /*< desc="Pick Only" >*/
GIMP_COLOR_PICK_MODE_FOREGROUND, /*< desc="Set Foreground Color" >*/
GIMP_COLOR_PICK_MODE_BACKGROUND /*< desc="Set Background Color" >*/
} GimpColorPickMode;
......
......@@ -102,8 +102,8 @@ gimp_enum_menu_finalize (GObject *object)
* @enum_type: the #GType of an enum.
* @callback: a callback to connect to the "activate" signal of each
* #GtkMenuItem that is created.
* @callback_data: data to pass to the @callback.
*
* @callback_data: data to pass to the @callback.
*
* Creates a new #GimpEnumMenu, derived from #GtkMenu with menu items
* for each of the enum values. The enum needs to be registered to the
* type system and should have translatable value names.
......@@ -111,7 +111,7 @@ gimp_enum_menu_finalize (GObject *object)
* To each menu item it's enum value is attached as "gimp-item-data".
* Therefore you can use gimp_menu_item_update() from libgimpwidgets
* as @callback function.
*
*
* Return value: a new #GimpEnumMenu.
**/
GtkWidget *
......@@ -130,7 +130,7 @@ gimp_enum_menu_new (GType enum_type,
enum_class->minimum,
enum_class->maximum,
callback, callback_data);
g_type_class_unref (enum_class);
return menu;
......@@ -244,7 +244,7 @@ gimp_enum_menu_new_with_values_valist (GType enum_type,
* gimp_enum_menu_set_stock_prefix:
* @enum_menu: a #GimpEnumMenu
* @stock_prefix: the prefix of the group of stock ids to use.
*
*
* Adds stock icons to the items in @enum_menu. The stock_id for each
* icon is created by appending the enum_value's nick to the given
* @stock_prefix. If no such stock_id exists, no icon is displayed.
......@@ -288,8 +288,8 @@ gimp_enum_menu_set_stock_prefix (GimpEnumMenu *enum_menu,
* @enum_type: the #GType of an enum.
* @callback: a callback to connect to the "activate" signal of each
* #GtkMenuItem that is created.
* @callback_data: data to pass to the @callback.
*
* @callback_data: data to pass to the @callback.
*
* This function calls gimp_enum_menu_new() for you and attaches
* the resulting @GtkMenu to a newly created #GtkOptionMenu.
*
......@@ -306,10 +306,10 @@ gimp_enum_option_menu_new (GType enum_type,
g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), NULL);
menu = gimp_enum_menu_new (enum_type, callback, callback_data);
option_menu = gtk_option_menu_new ();
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
return option_menu;
}
......@@ -328,10 +328,10 @@ gimp_enum_option_menu_new_with_range (GType enum_type,
menu = gimp_enum_menu_new_with_range (enum_type,
minimum, maximum,
callback, callback_data);
option_menu = gtk_option_menu_new ();
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
return option_menu;
}
......@@ -376,7 +376,7 @@ gimp_enum_option_menu_new_with_values_valist (GType enum_type,
option_menu = gtk_option_menu_new ();
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
}
return option_menu;
}
......@@ -384,7 +384,7 @@ gimp_enum_option_menu_new_with_values_valist (GType enum_type,
* gimp_enum_option_menu_set_stock_prefix:
* @option_menu: a #GtkOptionMenu created using gtk_enum_option_menu_new().
* @stock_prefix: the prefix of the group of stock ids to use.
*
*
* A convenience function that calls gimp_enum_menu_set_stock_prefix()
* with the enum menu used by @option_menu.
**/
......@@ -408,12 +408,12 @@ gimp_enum_option_menu_set_stock_prefix (GtkOptionMenu *option_menu,
* @enum_type: the #GType of an enum.
* @callback: a callback to connect to the "toggled" signal of each
* #GtkRadioButton that is created.
* @callback_data: data to pass to the @callback.
* @callback_data: data to pass to the @callback.
* @first_button: returns the first button in the created group.
*
*
* Creates a new group of #GtkRadioButtons representing the enum values.
* This is very similar to gimp_enum_menu_new().
*
*
* Return value: a new #GtkVBox holding a group of #GtkRadioButtons.
**/
GtkWidget *
......@@ -434,7 +434,7 @@ gimp_enum_radio_box_new (GType enum_type,
enum_class->maximum,
callback, callback_data,
first_button);
g_type_class_unref (enum_class);
return vbox;
......@@ -470,7 +470,7 @@ gimp_enum_radio_box_new_with_range (GType enum_type,
if (value->value < minimum || value->value > maximum)
continue;
button = gtk_radio_button_new_with_mnemonic (group,
button = gtk_radio_button_new_with_mnemonic (group,
gettext (value->value_name));
if (first_button && *first_button == NULL)
......@@ -505,7 +505,7 @@ gimp_enum_radio_box_new_with_range (GType enum_type,
*
* Calls gimp_enum_radio_box_new() and puts the resulting vbox into a
* #GtkFrame.
*
*
* Return value: a new #GtkFrame holding a group of #GtkRadioButtons.
**/
GtkWidget *
......@@ -524,14 +524,14 @@ gimp_enum_radio_frame_new (GType enum_type,
NULL);
frame = gtk_frame_new (NULL);
if (label_widget)
{
gtk_frame_set_label_widget (GTK_FRAME (frame), label_widget);
gtk_widget_show (label_widget);
}
radio_box = gimp_enum_radio_box_new (enum_type,
radio_box = gimp_enum_radio_box_new (enum_type,
callback, callback_data,
first_button);
......@@ -560,7 +560,7 @@ gimp_enum_radio_frame_new_with_range (GType enum_type,
NULL);
frame = gtk_frame_new (NULL);
if (label_widget)
{
gtk_frame_set_label_widget (GTK_FRAME (frame), label_widget);
......@@ -594,7 +594,7 @@ gimp_enum_radio_frame_new_with_range (GType enum_type,
* Creates a horizontal box of radio buttons with stock icons. The
* stock_id for each icon is created by appending the enum_value's
* nick to the given @stock_prefix.
*
*
* Return value: a new #GtkHbox holding a group of #GtkRadioButtons.
**/
GtkWidget *
......@@ -618,7 +618,7 @@ gimp_enum_stock_box_new (GType enum_type,
stock_prefix, icon_size,
callback, callback_data,
first_button);
g_type_class_unref (enum_class);
return box;
......@@ -660,7 +660,7 @@ gimp_enum_stock_box_new_with_range (GType enum_type,
continue;
button = gtk_radio_button_new (group);
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
if (first_button && *first_button == NULL)
......@@ -694,5 +694,5 @@ gimp_enum_stock_box_new_with_range (GType enum_type,
callback_data);
}
return hbox;
return hbox;
}
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