Minor cosmetic changes to the transform tool options dialog.

Made "Traditional" the default behaviour.


--Sven
This commit is contained in:
Sven Neumann
1998-08-13 20:22:13 +00:00
parent 844a3481ee
commit dbac5e9ef6
5 changed files with 108 additions and 70 deletions

View File

@ -1,3 +1,7 @@
Thu Aug 13 22:20:06 MEST 1998 Sven Neumann <sven@gimp.org>
* app/transform_tool.[ch]: minor cosmetic changes
Thu Aug 13 22:16:42 MEST 1998 Sven Neumann <sven@gimp.org> Thu Aug 13 22:16:42 MEST 1998 Sven Neumann <sven@gimp.org>
Applied the patch from Tor Lillqvist <tml@iki.fi>: Applied the patch from Tor Lillqvist <tml@iki.fi>:

View File

@ -90,7 +90,7 @@ static TransformOptions *
create_transform_options (void) create_transform_options (void)
{ {
TransformOptions *options; TransformOptions *options;
GtkWidget *vbox, *hbox; GtkWidget *main_box, *box, *vbox, *hbox;
GtkWidget *label; GtkWidget *label;
GtkWidget *radio_frame; GtkWidget *radio_frame;
GtkWidget *radio_box; GtkWidget *radio_box;
@ -110,8 +110,8 @@ create_transform_options (void)
}; };
char *direction_button_names[2] = char *direction_button_names[2] =
{ {
"Corrective", "Traditional",
"Traditional" "Corrective"
}; };
/* the new options structure */ /* the new options structure */
@ -119,17 +119,25 @@ create_transform_options (void)
options->type = ROTATE; options->type = ROTATE;
options->smoothing = 1; options->smoothing = 1;
options->clip = 1; options->clip = 1;
options->direction = TRANSFORM_CORRECTIVE; options->direction = TRANSFORM_TRADITIONAL;
options->grid_size = 32; options->grid_size = 32;
/* the main vbox */ /* the main vbox */
vbox = gtk_vbox_new (FALSE, 1); main_box = gtk_vbox_new (FALSE, 1);
/* the main label */ /* the main label */
label = gtk_label_new ("Transform Tool Options"); label = gtk_label_new ("Transform Tool Options");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (main_box), label, FALSE, FALSE, 0);
gtk_widget_show (label); gtk_widget_show (label);
/* the hbox holding the left and right vboxes*/
box = gtk_hbox_new (0, 2);
gtk_box_pack_start (GTK_BOX (main_box), box, FALSE, FALSE, 0);
/* the left vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (box), vbox, FALSE, FALSE, 0);
/* the first radio frame and box, for transform type */ /* the first radio frame and box, for transform type */
radio_frame = gtk_frame_new ("Transform"); radio_frame = gtk_frame_new ("Transform");
gtk_box_pack_start (GTK_BOX (vbox), radio_frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), radio_frame, FALSE, FALSE, 0);
@ -153,6 +161,22 @@ create_transform_options (void)
gtk_widget_show (radio_box); gtk_widget_show (radio_box);
gtk_widget_show (radio_frame); gtk_widget_show (radio_frame);
/* the smoothing toggle button */
smoothing_toggle = gtk_check_button_new_with_label ("Smoothing");
gtk_box_pack_start (GTK_BOX (vbox), smoothing_toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (smoothing_toggle), "toggled",
(GtkSignalFunc) transform_toggle_update,
&options->smoothing);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (smoothing_toggle),
options->smoothing);
gtk_widget_show (smoothing_toggle);
gtk_widget_show (vbox);
/* the right vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (box), vbox, FALSE, FALSE, 0);
/* the second radio frame and box, for transform direction */ /* the second radio frame and box, for transform direction */
radio_frame = gtk_frame_new ("Tool paradigm"); radio_frame = gtk_frame_new ("Tool paradigm");
gtk_box_pack_start (GTK_BOX (vbox), radio_frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), radio_frame, FALSE, FALSE, 0);
@ -176,26 +200,6 @@ create_transform_options (void)
gtk_widget_show (radio_box); gtk_widget_show (radio_box);
gtk_widget_show (radio_frame); gtk_widget_show (radio_frame);
/* the smoothing toggle button */
smoothing_toggle = gtk_check_button_new_with_label ("Smoothing");
gtk_box_pack_start (GTK_BOX (vbox), smoothing_toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (smoothing_toggle), "toggled",
(GtkSignalFunc) transform_toggle_update,
&options->smoothing);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (smoothing_toggle),
options->smoothing);
gtk_widget_show (smoothing_toggle);
/* the clip resulting image toggle button */
clip_toggle = gtk_check_button_new_with_label ("Clip perspective");
gtk_box_pack_start (GTK_BOX (vbox), clip_toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (clip_toggle), "toggled",
(GtkSignalFunc) transform_toggle_update,
&options->clip);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (clip_toggle),
options->clip);
gtk_widget_show (clip_toggle);
/* the grid density entry */ /* the grid density entry */
hbox = gtk_hbox_new (FALSE, 1); hbox = gtk_hbox_new (FALSE, 1);
gtk_widget_show (hbox); gtk_widget_show (hbox);
@ -212,12 +216,25 @@ create_transform_options (void)
gtk_box_pack_start (GTK_BOX (hbox), grid_density, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), grid_density, FALSE, FALSE, 0);
gtk_widget_show (grid_density); gtk_widget_show (grid_density);
/* the clip resulting image toggle button */
clip_toggle = gtk_check_button_new_with_label ("Clip perspective");
gtk_box_pack_start (GTK_BOX (vbox), clip_toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (clip_toggle), "toggled",
(GtkSignalFunc) transform_toggle_update,
&options->clip);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (clip_toggle),
options->clip);
gtk_widget_show (clip_toggle);
gtk_widget_show (vbox);
gtk_widget_show (box);
/* Register this selection options widget with the main tools options dialog */ /* Register this selection options widget with the main tools options dialog */
tools_register_options (ROTATE, vbox); tools_register_options (ROTATE, main_box);
tools_register_options (SCALE, vbox); tools_register_options (SCALE, main_box);
tools_register_options (SHEAR, vbox); tools_register_options (SHEAR, main_box);
tools_register_options (PERSPECTIVE, vbox); tools_register_options (PERSPECTIVE, main_box);
return options; return options;
} }
@ -295,7 +312,7 @@ int
transform_tool_clip () transform_tool_clip ()
{ {
if (!transform_options) if (!transform_options)
return 0; return 1;
else else
return transform_options->clip; return transform_options->clip;
} }

View File

@ -27,7 +27,7 @@ int transform_tool_direction (void);
int transform_tool_grid_size (void); int transform_tool_grid_size (void);
/* transform directions */ /* transform directions */
#define TRANSFORM_CORRECTIVE 0 #define TRANSFORM_TRADITIONAL 0
#define TRANSFORM_TRADITIONAL 1 #define TRANSFORM_CORRECTIVE 1
#endif /* __TRANSFORM_TOOL_H__ */ #endif /* __TRANSFORM_TOOL_H__ */

View File

@ -90,7 +90,7 @@ static TransformOptions *
create_transform_options (void) create_transform_options (void)
{ {
TransformOptions *options; TransformOptions *options;
GtkWidget *vbox, *hbox; GtkWidget *main_box, *box, *vbox, *hbox;
GtkWidget *label; GtkWidget *label;
GtkWidget *radio_frame; GtkWidget *radio_frame;
GtkWidget *radio_box; GtkWidget *radio_box;
@ -110,8 +110,8 @@ create_transform_options (void)
}; };
char *direction_button_names[2] = char *direction_button_names[2] =
{ {
"Corrective", "Traditional",
"Traditional" "Corrective"
}; };
/* the new options structure */ /* the new options structure */
@ -119,17 +119,25 @@ create_transform_options (void)
options->type = ROTATE; options->type = ROTATE;
options->smoothing = 1; options->smoothing = 1;
options->clip = 1; options->clip = 1;
options->direction = TRANSFORM_CORRECTIVE; options->direction = TRANSFORM_TRADITIONAL;
options->grid_size = 32; options->grid_size = 32;
/* the main vbox */ /* the main vbox */
vbox = gtk_vbox_new (FALSE, 1); main_box = gtk_vbox_new (FALSE, 1);
/* the main label */ /* the main label */
label = gtk_label_new ("Transform Tool Options"); label = gtk_label_new ("Transform Tool Options");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (main_box), label, FALSE, FALSE, 0);
gtk_widget_show (label); gtk_widget_show (label);
/* the hbox holding the left and right vboxes*/
box = gtk_hbox_new (0, 2);
gtk_box_pack_start (GTK_BOX (main_box), box, FALSE, FALSE, 0);
/* the left vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (box), vbox, FALSE, FALSE, 0);
/* the first radio frame and box, for transform type */ /* the first radio frame and box, for transform type */
radio_frame = gtk_frame_new ("Transform"); radio_frame = gtk_frame_new ("Transform");
gtk_box_pack_start (GTK_BOX (vbox), radio_frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), radio_frame, FALSE, FALSE, 0);
@ -153,6 +161,22 @@ create_transform_options (void)
gtk_widget_show (radio_box); gtk_widget_show (radio_box);
gtk_widget_show (radio_frame); gtk_widget_show (radio_frame);
/* the smoothing toggle button */
smoothing_toggle = gtk_check_button_new_with_label ("Smoothing");
gtk_box_pack_start (GTK_BOX (vbox), smoothing_toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (smoothing_toggle), "toggled",
(GtkSignalFunc) transform_toggle_update,
&options->smoothing);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (smoothing_toggle),
options->smoothing);
gtk_widget_show (smoothing_toggle);
gtk_widget_show (vbox);
/* the right vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (box), vbox, FALSE, FALSE, 0);
/* the second radio frame and box, for transform direction */ /* the second radio frame and box, for transform direction */
radio_frame = gtk_frame_new ("Tool paradigm"); radio_frame = gtk_frame_new ("Tool paradigm");
gtk_box_pack_start (GTK_BOX (vbox), radio_frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), radio_frame, FALSE, FALSE, 0);
@ -176,26 +200,6 @@ create_transform_options (void)
gtk_widget_show (radio_box); gtk_widget_show (radio_box);
gtk_widget_show (radio_frame); gtk_widget_show (radio_frame);
/* the smoothing toggle button */
smoothing_toggle = gtk_check_button_new_with_label ("Smoothing");
gtk_box_pack_start (GTK_BOX (vbox), smoothing_toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (smoothing_toggle), "toggled",
(GtkSignalFunc) transform_toggle_update,
&options->smoothing);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (smoothing_toggle),
options->smoothing);
gtk_widget_show (smoothing_toggle);
/* the clip resulting image toggle button */
clip_toggle = gtk_check_button_new_with_label ("Clip perspective");
gtk_box_pack_start (GTK_BOX (vbox), clip_toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (clip_toggle), "toggled",
(GtkSignalFunc) transform_toggle_update,
&options->clip);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (clip_toggle),
options->clip);
gtk_widget_show (clip_toggle);
/* the grid density entry */ /* the grid density entry */
hbox = gtk_hbox_new (FALSE, 1); hbox = gtk_hbox_new (FALSE, 1);
gtk_widget_show (hbox); gtk_widget_show (hbox);
@ -212,12 +216,25 @@ create_transform_options (void)
gtk_box_pack_start (GTK_BOX (hbox), grid_density, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), grid_density, FALSE, FALSE, 0);
gtk_widget_show (grid_density); gtk_widget_show (grid_density);
/* the clip resulting image toggle button */
clip_toggle = gtk_check_button_new_with_label ("Clip perspective");
gtk_box_pack_start (GTK_BOX (vbox), clip_toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (clip_toggle), "toggled",
(GtkSignalFunc) transform_toggle_update,
&options->clip);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (clip_toggle),
options->clip);
gtk_widget_show (clip_toggle);
gtk_widget_show (vbox);
gtk_widget_show (box);
/* Register this selection options widget with the main tools options dialog */ /* Register this selection options widget with the main tools options dialog */
tools_register_options (ROTATE, vbox); tools_register_options (ROTATE, main_box);
tools_register_options (SCALE, vbox); tools_register_options (SCALE, main_box);
tools_register_options (SHEAR, vbox); tools_register_options (SHEAR, main_box);
tools_register_options (PERSPECTIVE, vbox); tools_register_options (PERSPECTIVE, main_box);
return options; return options;
} }
@ -295,7 +312,7 @@ int
transform_tool_clip () transform_tool_clip ()
{ {
if (!transform_options) if (!transform_options)
return 0; return 1;
else else
return transform_options->clip; return transform_options->clip;
} }

View File

@ -27,7 +27,7 @@ int transform_tool_direction (void);
int transform_tool_grid_size (void); int transform_tool_grid_size (void);
/* transform directions */ /* transform directions */
#define TRANSFORM_CORRECTIVE 0 #define TRANSFORM_TRADITIONAL 0
#define TRANSFORM_TRADITIONAL 1 #define TRANSFORM_CORRECTIVE 1
#endif /* __TRANSFORM_TOOL_H__ */ #endif /* __TRANSFORM_TOOL_H__ */