Commit 2d54cc64 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

app/bucket_fill.c app/clone.c app/convolve.c app/flip_tool.c app/ink.c

1999-04-18  Michael Natterer  <mitschel@cs.tu-berlin.de>

	* app/bucket_fill.c
	* app/clone.c
	* app/convolve.c
	* app/flip_tool.c
	* app/ink.c
	* app/paintbrush.c
	* app/transform_tool.c: remember all radio buttons in the
	ToolOptions structures. This enables arbitrary default values and
	gui feedback for the "toggle key" feature.
parent 283fdacb
1999-04-18 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/bucket_fill.c
* app/clone.c
* app/convolve.c
* app/flip_tool.c
* app/ink.c
* app/paintbrush.c
* app/transform_tool.c: remember all radio buttons in the
ToolOptions structures. This enables arbitrary default values and
gui feedback for the "toggle key" feature.
Sat Apr 17 11:15:35 PDT 1999 Manish Singh <yosh@gimp.org>
* app/text_tool_cmds.c: doh, decipoints not decipixels
......
......@@ -61,13 +61,13 @@ struct _BucketOptions
double threshold_d;
GtkObject *threshold_w;
FillMode fill_mode;
FillMode fill_mode_d;
GtkWidget *fill_mode_w;
int sample_merged;
int sample_merged_d;
GtkWidget *sample_merged_w;
FillMode fill_mode;
FillMode fill_mode_d;
GtkWidget *fill_mode_w[2]; /* 2 radio buttons */
};
......@@ -128,7 +128,10 @@ bucket_options_reset (void)
options->sample_merged_d);
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->threshold_w),
options->threshold_d);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->fill_mode_w), TRUE);
gtk_toggle_button_set_active (((options->fill_mode_d == FgColorFill) ?
GTK_TOGGLE_BUTTON (options->fill_mode_w[0]) :
GTK_TOGGLE_BUTTON (options->fill_mode_w[1])),
TRUE);
}
static BucketOptions *
......@@ -247,8 +250,6 @@ bucket_options_new (void)
gtk_signal_connect (GTK_OBJECT (options->sample_merged_w), "toggled",
(GtkSignalFunc) tool_options_toggle_update,
&options->sample_merged);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->sample_merged_w),
options->sample_merged_d);
gtk_box_pack_start (GTK_BOX (vbox), options->sample_merged_w, FALSE, FALSE, 0);
gtk_widget_show (options->sample_merged_w);
......@@ -272,8 +273,7 @@ bucket_options_new (void)
gtk_box_pack_start (GTK_BOX (radio_box), radio_button, FALSE, FALSE, 0);
gtk_widget_show (radio_button);
if (i == 0)
options->fill_mode_w = radio_button;
options->fill_mode_w[i] = radio_button;
}
gtk_widget_show (radio_box);
gtk_widget_show (radio_frame);
......@@ -687,6 +687,9 @@ tools_new_bucket_fill (void)
{
bucket_options = bucket_options_new ();
tools_register (BUCKET_FILL, (ToolOptions *) bucket_options);
/* press all default buttons */
bucket_options_reset ();
}
tool = (Tool *) g_malloc (sizeof (Tool));
......
......@@ -52,11 +52,11 @@ struct _CloneOptions
CloneType type;
CloneType type_d;
GtkWidget *type_w;
GtkWidget *type_w[2]; /* 2 radio buttons */
AlignType aligned;
AlignType aligned_d;
GtkWidget *aligned_w;
GtkWidget *aligned_w[3]; /* 3 radio buttons */
};
......@@ -113,8 +113,8 @@ clone_options_reset (void)
{
CloneOptions *options = clone_options;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->type_w), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->aligned_w), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->type_w[options->type_d]), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->aligned_w[options->aligned_d]), TRUE);
}
static CloneOptions *
......@@ -172,8 +172,7 @@ clone_options_new (void)
gtk_box_pack_start (GTK_BOX (radio_box), radio_button, FALSE, FALSE, 0);
gtk_widget_show (radio_button);
if (i == options->type_d)
options->type_w = radio_button;
options->type_w[i] = radio_button;
}
gtk_widget_show (radio_box);
gtk_widget_show (radio_frame);
......@@ -198,8 +197,7 @@ clone_options_new (void)
gtk_box_pack_start (GTK_BOX (radio_box), radio_button, FALSE, FALSE, 0);
gtk_widget_show (radio_button);
if (i == options->aligned_d)
options->aligned_w = radio_button;
options->aligned_w[i] = radio_button;
}
gtk_widget_show (radio_box);
gtk_widget_show (radio_frame);
......@@ -357,6 +355,9 @@ tools_new_clone ()
{
clone_options = clone_options_new ();
tools_register (CLONE, (ToolOptions *) clone_options);
/* press all default buttons */
clone_options_reset ();
}
tool = paint_core_new (CLONE);
......
......@@ -47,7 +47,7 @@ struct _ConvolveOptions
ConvolveType type;
ConvolveType type_d;
GtkWidget *type_w;
GtkWidget *type_w[2]; /* 2 radio buttons */
double pressure;
double pressure_d;
......@@ -117,7 +117,7 @@ convolve_options_reset (void)
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->pressure_w),
options->pressure_d);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->type_w), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->type_w[options->type_d]), TRUE);
}
static ConvolveOptions *
......@@ -194,8 +194,7 @@ convolve_options_new (void)
(gpointer) ((long) i));
gtk_widget_show (radio_button);
if (i == options->type_d)
options->type_w = radio_button;
options->type_w[i] = radio_button;
}
gtk_widget_show (radio_box);
......@@ -228,6 +227,9 @@ tools_new_convolve ()
{
convolve_options = convolve_options_new ();
tools_register (CONVOLVE, (ToolOptions *) convolve_options);
/* press all default buttons */
convolve_options_reset ();
}
tool = paint_core_new (CONVOLVE);
......
......@@ -41,7 +41,7 @@ struct _FlipOptions
ToolType type;
ToolType type_d;
GtkWidget *type_w;
GtkWidget *type_w[2]; /* 2 radio buttons */
};
......@@ -63,7 +63,7 @@ static Argument * flip_invoker (Argument *);
/* functions */
static void
flip_type_callback (GtkWidget *w,
flip_type_callback (GtkWidget *widget,
gpointer client_data)
{
flip_change_type ((long) client_data);
......@@ -74,7 +74,10 @@ flip_options_reset (void)
{
FlipOptions *options = flip_options;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->type_w), TRUE);
gtk_toggle_button_set_active (((options->type_d == FLIP_HORZ) ?
GTK_TOGGLE_BUTTON (options->type_w[0]) :
GTK_TOGGLE_BUTTON (options->type_w[1])),
TRUE);
}
static FlipOptions *
......@@ -85,7 +88,6 @@ flip_options_new (void)
GtkWidget *vbox;
GSList *group = NULL;
GtkWidget *radio_box;
GtkWidget *radio_button;
/* the new flip tool options structure */
options = (FlipOptions *) g_malloc (sizeof (FlipOptions));
......@@ -101,22 +103,22 @@ flip_options_new (void)
gtk_box_pack_start (GTK_BOX (vbox), radio_box, FALSE, FALSE, 0);
/* the radio buttons */
options->type_w =
options->type_w[0] =
gtk_radio_button_new_with_label (group, _("Horizontal"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (options->type_w));
gtk_box_pack_start (GTK_BOX (radio_box), options->type_w, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (options->type_w), "toggled",
group = gtk_radio_button_group (GTK_RADIO_BUTTON (options->type_w[0]));
gtk_box_pack_start (GTK_BOX (radio_box), options->type_w[0], FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (options->type_w[0]), "toggled",
(GtkSignalFunc) flip_type_callback,
(gpointer) ((long) (FLIP_HORZ)));
gtk_widget_show (options->type_w);
gtk_widget_show (options->type_w[0]);
radio_button = gtk_radio_button_new_with_label (group, _("Vertical"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
gtk_box_pack_start (GTK_BOX (radio_box), radio_button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (radio_button), "toggled",
options->type_w[1] = gtk_radio_button_new_with_label (group, _("Vertical"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (options->type_w[1]));
gtk_box_pack_start (GTK_BOX (radio_box), options->type_w[1], FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (options->type_w[1]), "toggled",
(GtkSignalFunc) flip_type_callback,
(gpointer) ((long) (FLIP_VERT)));
gtk_widget_show (radio_button);
gtk_widget_show (options->type_w[1]);
gtk_widget_show (radio_box);
......@@ -198,6 +200,9 @@ tools_new_flip ()
flip_options = flip_options_new ();
tools_register (FLIP_HORZ, (ToolOptions *) flip_options);
tools_register (FLIP_VERT, (ToolOptions *) flip_options);
/* press all default buttons */
flip_options_reset ();
}
switch (flip_options->type)
......
......@@ -104,7 +104,7 @@ struct _InkOptions
BlobFunc function;
BlobFunc function_d;
GtkWidget *function_w;
GtkWidget *function_w[3]; /* 3 radio buttons */
double aspect;
double aspect_d;
......@@ -236,8 +236,12 @@ ink_options_reset (void)
options->vel_sensitivity_d);
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->tilt_angle_w),
options->tilt_angle_d);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->function_w), TRUE);
gtk_toggle_button_set_active (((options->function_d == blob_ellipse) ?
GTK_TOGGLE_BUTTON (options->function_w[0]) :
((options->function_d == blob_square) ?
GTK_TOGGLE_BUTTON (options->function_w[1]) :
GTK_TOGGLE_BUTTON (options->function_w[2]))),
TRUE);
options->aspect = options->aspect_d;
options->angle = options->angle_d;
gtk_widget_queue_draw (options->brush_w->widget);
......@@ -434,7 +438,7 @@ ink_options_new (void)
gtk_container_add (GTK_CONTAINER (radio_button), pixmap_widget);
gtk_box_pack_start (GTK_BOX (vbox), radio_button, FALSE, FALSE, 0);
options->function_w = radio_button;
options->function_w[0] = radio_button;
pixmap = blob_pixmap (gtk_widget_get_colormap (vbox),
gtk_widget_get_visual (vbox),
......@@ -452,6 +456,8 @@ ink_options_new (void)
gtk_container_add (GTK_CONTAINER (radio_button), pixmap_widget);
gtk_box_pack_start (GTK_BOX (vbox), radio_button, FALSE, FALSE, 0);
options->function_w[1] = radio_button;
pixmap = blob_pixmap (gtk_widget_get_colormap (vbox),
gtk_widget_get_visual (vbox),
blob_diamond);
......@@ -468,6 +474,8 @@ ink_options_new (void)
gtk_container_add (GTK_CONTAINER (radio_button), pixmap_widget);
gtk_box_pack_start (GTK_BOX (vbox), radio_button, FALSE, FALSE, 0);
options->function_w[2] = radio_button;
/* Brush shape widget */
frame = gtk_frame_new (_("Shape"));
gtk_table_attach_defaults (GTK_TABLE (table), frame, 1, 2, 8, 9);
......@@ -480,17 +488,17 @@ ink_options_new (void)
options->brush_w = g_new (BrushWidget, 1);
options->brush_w->state = FALSE;
frame = gtk_aspect_frame_new (NULL, 0.5, 0.5, 1.0, FALSE);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
darea = gtk_drawing_area_new();
options->brush_w->widget = darea;
gtk_drawing_area_size (GTK_DRAWING_AREA (darea), 60, 60);
gtk_container_add (GTK_CONTAINER (frame), darea);
gtk_widget_set_events (darea,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
| GDK_POINTER_MOTION_MASK | GDK_EXPOSURE_MASK);
......@@ -1531,6 +1539,9 @@ tools_new_ink ()
{
ink_options = ink_options_new ();
tools_register (INK, (ToolOptions *) ink_options);
/* press all default buttons */
ink_options_reset ();
}
tool = (Tool *) g_malloc (sizeof (Tool));
......@@ -1635,4 +1646,3 @@ ink_invoker (args)
/* Fix me */
return NULL;
}
......@@ -52,11 +52,11 @@ struct _CloneOptions
CloneType type;
CloneType type_d;
GtkWidget *type_w;
GtkWidget *type_w[2]; /* 2 radio buttons */
AlignType aligned;
AlignType aligned_d;
GtkWidget *aligned_w;
GtkWidget *aligned_w[3]; /* 3 radio buttons */
};
......@@ -113,8 +113,8 @@ clone_options_reset (void)
{
CloneOptions *options = clone_options;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->type_w), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->aligned_w), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->type_w[options->type_d]), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->aligned_w[options->aligned_d]), TRUE);
}
static CloneOptions *
......@@ -172,8 +172,7 @@ clone_options_new (void)
gtk_box_pack_start (GTK_BOX (radio_box), radio_button, FALSE, FALSE, 0);
gtk_widget_show (radio_button);
if (i == options->type_d)
options->type_w = radio_button;
options->type_w[i] = radio_button;
}
gtk_widget_show (radio_box);
gtk_widget_show (radio_frame);
......@@ -198,8 +197,7 @@ clone_options_new (void)
gtk_box_pack_start (GTK_BOX (radio_box), radio_button, FALSE, FALSE, 0);
gtk_widget_show (radio_button);
if (i == options->aligned_d)
options->aligned_w = radio_button;
options->aligned_w[i] = radio_button;
}
gtk_widget_show (radio_box);
gtk_widget_show (radio_frame);
......@@ -357,6 +355,9 @@ tools_new_clone ()
{
clone_options = clone_options_new ();
tools_register (CLONE, (ToolOptions *) clone_options);
/* press all default buttons */
clone_options_reset ();
}
tool = paint_core_new (CLONE);
......
......@@ -47,7 +47,7 @@ struct _ConvolveOptions
ConvolveType type;
ConvolveType type_d;
GtkWidget *type_w;
GtkWidget *type_w[2]; /* 2 radio buttons */
double pressure;
double pressure_d;
......@@ -117,7 +117,7 @@ convolve_options_reset (void)
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->pressure_w),
options->pressure_d);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->type_w), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->type_w[options->type_d]), TRUE);
}
static ConvolveOptions *
......@@ -194,8 +194,7 @@ convolve_options_new (void)
(gpointer) ((long) i));
gtk_widget_show (radio_button);
if (i == options->type_d)
options->type_w = radio_button;
options->type_w[i] = radio_button;
}
gtk_widget_show (radio_box);
......@@ -228,6 +227,9 @@ tools_new_convolve ()
{
convolve_options = convolve_options_new ();
tools_register (CONVOLVE, (ToolOptions *) convolve_options);
/* press all default buttons */
convolve_options_reset ();
}
tool = paint_core_new (CONVOLVE);
......
......@@ -104,7 +104,7 @@ struct _InkOptions
BlobFunc function;
BlobFunc function_d;
GtkWidget *function_w;
GtkWidget *function_w[3]; /* 3 radio buttons */
double aspect;
double aspect_d;
......@@ -236,8 +236,12 @@ ink_options_reset (void)
options->vel_sensitivity_d);
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->tilt_angle_w),
options->tilt_angle_d);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->function_w), TRUE);
gtk_toggle_button_set_active (((options->function_d == blob_ellipse) ?
GTK_TOGGLE_BUTTON (options->function_w[0]) :
((options->function_d == blob_square) ?
GTK_TOGGLE_BUTTON (options->function_w[1]) :
GTK_TOGGLE_BUTTON (options->function_w[2]))),
TRUE);
options->aspect = options->aspect_d;
options->angle = options->angle_d;
gtk_widget_queue_draw (options->brush_w->widget);
......@@ -434,7 +438,7 @@ ink_options_new (void)
gtk_container_add (GTK_CONTAINER (radio_button), pixmap_widget);
gtk_box_pack_start (GTK_BOX (vbox), radio_button, FALSE, FALSE, 0);
options->function_w = radio_button;
options->function_w[0] = radio_button;
pixmap = blob_pixmap (gtk_widget_get_colormap (vbox),
gtk_widget_get_visual (vbox),
......@@ -452,6 +456,8 @@ ink_options_new (void)
gtk_container_add (GTK_CONTAINER (radio_button), pixmap_widget);
gtk_box_pack_start (GTK_BOX (vbox), radio_button, FALSE, FALSE, 0);
options->function_w[1] = radio_button;
pixmap = blob_pixmap (gtk_widget_get_colormap (vbox),
gtk_widget_get_visual (vbox),
blob_diamond);
......@@ -468,6 +474,8 @@ ink_options_new (void)
gtk_container_add (GTK_CONTAINER (radio_button), pixmap_widget);
gtk_box_pack_start (GTK_BOX (vbox), radio_button, FALSE, FALSE, 0);
options->function_w[2] = radio_button;
/* Brush shape widget */
frame = gtk_frame_new (_("Shape"));
gtk_table_attach_defaults (GTK_TABLE (table), frame, 1, 2, 8, 9);
......@@ -480,17 +488,17 @@ ink_options_new (void)
options->brush_w = g_new (BrushWidget, 1);
options->brush_w->state = FALSE;
frame = gtk_aspect_frame_new (NULL, 0.5, 0.5, 1.0, FALSE);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
darea = gtk_drawing_area_new();
options->brush_w->widget = darea;
gtk_drawing_area_size (GTK_DRAWING_AREA (darea), 60, 60);
gtk_container_add (GTK_CONTAINER (frame), darea);
gtk_widget_set_events (darea,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
| GDK_POINTER_MOTION_MASK | GDK_EXPOSURE_MASK);
......@@ -1531,6 +1539,9 @@ tools_new_ink ()
{
ink_options = ink_options_new ();
tools_register (INK, (ToolOptions *) ink_options);
/* press all default buttons */
ink_options_reset ();
}
tool = (Tool *) g_malloc (sizeof (Tool));
......@@ -1635,4 +1646,3 @@ ink_invoker (args)
/* Fix me */
return NULL;
}
......@@ -52,11 +52,11 @@ struct _CloneOptions
CloneType type;
CloneType type_d;
GtkWidget *type_w;
GtkWidget *type_w[2]; /* 2 radio buttons */
AlignType aligned;
AlignType aligned_d;
GtkWidget *aligned_w;
GtkWidget *aligned_w[3]; /* 3 radio buttons */
};
......@@ -113,8 +113,8 @@ clone_options_reset (void)
{
CloneOptions *options = clone_options;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->type_w), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->aligned_w), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->type_w[options->type_d]), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->aligned_w[options->aligned_d]), TRUE);
}
static CloneOptions *
......@@ -172,8 +172,7 @@ clone_options_new (void)
gtk_box_pack_start (GTK_BOX (radio_box), radio_button, FALSE, FALSE, 0);
gtk_widget_show (radio_button);
if (i == options->type_d)
options->type_w = radio_button;
options->type_w[i] = radio_button;
}
gtk_widget_show (radio_box);
gtk_widget_show (radio_frame);
......@@ -198,8 +197,7 @@ clone_options_new (void)
gtk_box_pack_start (GTK_BOX (radio_box), radio_button, FALSE, FALSE, 0);
gtk_widget_show (radio_button);
if (i == options->aligned_d)
options->aligned_w = radio_button;
options->aligned_w[i] = radio_button;
}
gtk_widget_show (radio_box);
gtk_widget_show (radio_frame);
......@@ -357,6 +355,9 @@ tools_new_clone ()
{
clone_options = clone_options_new ();
tools_register (CLONE, (ToolOptions *) clone_options);
/* press all default buttons */
clone_options_reset ();
}
tool = paint_core_new (CLONE);
......
......@@ -58,7 +58,7 @@ struct _PaintOptions
int gradient_type;
int gradient_type_d;
GtkWidget *gradient_type_w;
GtkWidget *gradient_type_w[4]; /* 4 radio buttons */
gboolean incremental;
gboolean incremental_d;
......@@ -129,7 +129,7 @@ paintbrush_options_reset (void)
options->use_gradient_d);
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->gradient_length_w),
options->gradient_length_d);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->gradient_type_w),
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->gradient_type_w[options->gradient_type_d]),
TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->incremental_w),
options->incremental_d);
......@@ -202,8 +202,6 @@ paintbrush_options_new (void)
gtk_check_button_new_with_label (_("Gradient"));
gtk_table_attach (GTK_TABLE (table), options->use_gradient_w, 0, 1, 1, 2,
GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->use_gradient_w),
options->use_gradient_d);
gtk_signal_connect (GTK_OBJECT (options->use_gradient_w), "toggled",
(GtkSignalFunc) paintbrush_gradient_toggle_callback,
&options->use_gradient);
......@@ -238,9 +236,6 @@ paintbrush_options_new (void)
gtk_table_attach_defaults (GTK_TABLE (table), radio_frame, 0, 2, 3, 4);
/* automatically set the sensitive state of the gradient stuff */
gtk_widget_set_sensitive (scale, options->use_gradient_d);
gtk_widget_set_sensitive (label, options->use_gradient_d);
gtk_widget_set_sensitive (radio_frame, options->use_gradient_d);
gtk_object_set_data (GTK_OBJECT (options->use_gradient_w), "set_sensitive",
scale);
gtk_object_set_data (GTK_OBJECT (scale), "set_sensitive",
......@@ -264,11 +259,9 @@ paintbrush_options_new (void)
gtk_box_pack_start (GTK_BOX (radio_box), radio_button, FALSE, FALSE, 0);
gtk_widget_show (radio_button);
if (i == options->gradient_type_d)
options->gradient_type_w = radio_button;
options->gradient_type_w[i] = radio_button;
}
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->gradient_type_w),
TRUE);
gtk_widget_show (radio_box);
gtk_widget_show (radio_frame);
......@@ -278,8 +271,6 @@ paintbrush_options_new (void)
gtk_signal_connect (GTK_OBJECT (options->incremental_w), "toggled",
(GtkSignalFunc) tool_options_toggle_update,
&options->incremental);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->incremental_w),
options->incremental_d);
gtk_widget_show (options->incremental_w);
return options;
......@@ -352,6 +343,9 @@ tools_new_paintbrush ()
{
paintbrush_options = paintbrush_options_new ();
tools_register (PAINTBRUSH, (ToolOptions *) paintbrush_options);
/* press all default buttons */
paintbrush_options_reset ();
}
tool = paint_core_new (PAINTBRUSH);
......
......@@ -61,13 +61,13 @@ struct _BucketOptions
double threshold_d;
GtkObject *threshold_w;
FillMode fill_mode;
FillMode fill_mode_d;
GtkWidget *fill_mode_w;
int sample_merged;
int sample_merged_d;
GtkWidget *sample_merged_w;
FillMode fill_mode;
FillMode fill_mode_d;
GtkWidget *fill_mode_w[2]; /* 2 radio buttons */
};
......@@ -128,7 +128,10 @@ bucket_options_reset (void)
options->sample_merged_d);
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->threshold_w),
options->threshold_d);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->fill_mode_w), TRUE);
gtk_toggle_button_set_active (((options->fill_mode_d == FgColorFill) ?
GTK_TOGGLE_BUTTON (options->fill_mode_w[0]) :
GTK_TOGGLE_BUTTON (options->fill_mode_w[1])),
TRUE);
}
static BucketOptions *
......@@ -247,8 +250,6 @@ bucket_options_new (void)
gtk_signal_connect (GTK_OBJECT (options