use a combo-box for the curve type.

2008-05-22  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpcurvestool.c (gimp_curves_tool_dialog): use a
	combo-box for the curve type.

svn path=/trunk/; revision=25748
This commit is contained in:
Sven Neumann
2008-05-22 08:39:30 +00:00
committed by Sven Neumann
parent a81c227a1a
commit e161a6148c
2 changed files with 27 additions and 24 deletions

View File

@ -1,3 +1,8 @@
2008-05-22 Sven Neumann <sven@gimp.org>
* app/tools/gimpcurvestool.c (gimp_curves_tool_dialog): use a
combo-box for the curve type.
2008-05-22 Sven Neumann <sven@gimp.org> 2008-05-22 Sven Neumann <sven@gimp.org>
* core/gimpdrawable-brightness-contrast.c * core/gimpdrawable-brightness-contrast.c

View File

@ -421,6 +421,7 @@ gimp_curves_tool_dialog (GimpImageMapTool *image_map_tool)
GtkWidget *table; GtkWidget *table;
GtkWidget *button; GtkWidget *button;
GtkWidget *bar; GtkWidget *bar;
GtkWidget *combo;
vbox = image_map_tool->main_vbox; vbox = image_map_tool->main_vbox;
@ -539,23 +540,22 @@ gimp_curves_tool_dialog (GimpImageMapTool *image_map_tool)
gtk_widget_show (table); gtk_widget_show (table);
hbox = gtk_hbox_new (FALSE, 6); hbox = gtk_hbox_new (FALSE, 6);
gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox); gtk_widget_show (hbox);
/* The radio box for selecting the curve type */ label = gtk_label_new_with_mnemonic (_("Curve _type:"));
frame = gimp_frame_new (_("Curve Type")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (hbox), frame, FALSE, FALSE, 0); gtk_widget_show (label);
gtk_widget_show (frame);
hbox = gimp_enum_stock_box_new (GIMP_TYPE_CURVE_TYPE, tool->curve_type = combo = gimp_enum_combo_box_new (GIMP_TYPE_CURVE_TYPE);
"gimp-curve", GTK_ICON_SIZE_MENU, gimp_enum_combo_box_set_stock_prefix (GIMP_ENUM_COMBO_BOX (combo),
G_CALLBACK (curves_curve_type_callback), "gimp-curve");
tool, gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), 0,
&tool->curve_type); G_CALLBACK (curves_curve_type_callback),
gtk_container_add (GTK_CONTAINER (frame), hbox); tool);
gtk_widget_show (hbox); gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
gtk_widget_show (combo);
} }
static void static void
@ -682,13 +682,13 @@ gimp_curves_tool_config_notify (GObject *object,
gimp_curve_view_set_curve (GIMP_CURVE_VIEW (tool->graph), curve); gimp_curve_view_set_curve (GIMP_CURVE_VIEW (tool->graph), curve);
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (tool->curve_type), gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (tool->curve_type),
curve->curve_type); curve->curve_type);
} }
else if (! strcmp (pspec->name, "curve")) else if (! strcmp (pspec->name, "curve"))
{ {
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (tool->curve_type), gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (tool->curve_type),
curve->curve_type); curve->curve_type);
} }
gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool)); gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
@ -748,16 +748,14 @@ static void
curves_curve_type_callback (GtkWidget *widget, curves_curve_type_callback (GtkWidget *widget,
GimpCurvesTool *tool) GimpCurvesTool *tool)
{ {
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) gint value;
{
GimpCurvesConfig *config = tool->config;
GimpCurveType curve_type;
gimp_radio_button_update (widget, &curve_type); if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value))
{
GimpCurvesConfig *config = tool->config;
GimpCurveType curve_type = value;
if (config->curve[config->channel]->curve_type != curve_type) if (config->curve[config->channel]->curve_type != curve_type)
{ gimp_curve_set_curve_type (config->curve[config->channel], curve_type);
gimp_curve_set_curve_type (config->curve[config->channel], curve_type);
}
} }
} }