Commit 903816ca authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

switch to a more compact dialog layout.

2005-06-22  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/mblur.c: switch to a more compact dialog layout.
parent 62887851
2005-06-22 Sven Neumann <sven@gimp.org>
* plug-ins/common/mblur.c: switch to a more compact dialog layout.
2005-06-21 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* plug-ins/common/mblur.c: add option of blurring inward
......
......@@ -890,18 +890,19 @@ static gboolean
mblur_dialog (gint32 image_ID,
GimpDrawable *drawable)
{
GtkWidget *dialog;
GtkWidget *vbox;
GtkWidget *frame;
GtkWidget *table;
GtkWidget *entry;
GtkWidget *spinbutton;
GtkWidget *label;
GtkWidget *button;
GtkSizeGroup *group;
GtkObject *adj;
gdouble xres, yres;
gboolean run;
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *frame;
GtkWidget *table;
GtkWidget *entry;
GtkWidget *spinbutton;
GtkWidget *label;
GtkWidget *button;
GtkObject *adj;
gdouble xres, yres;
gboolean run;
gimp_ui_init ("mblur", FALSE);
......@@ -919,19 +920,23 @@ mblur_dialog (gint32 image_ID,
GTK_RESPONSE_CANCEL,
-1);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);
gtk_widget_show (vbox);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_vbox);
gtk_widget_show (main_vbox);
preview = gimp_drawable_preview_new (drawable, &mbvals.preview);
gtk_box_pack_start (GTK_BOX (vbox), preview, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (main_vbox), preview, TRUE, TRUE, 0);
gtk_widget_show (preview);
g_signal_connect_swapped (preview, "invalidated",
G_CALLBACK (mblur),
drawable);
hbox = gtk_hbox_new (FALSE, 12);
gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
frame = gimp_int_radio_group_new (TRUE, _("Blur Type"),
G_CALLBACK (mblur_radio_button_update),
&mbvals.mblur_type, mbvals.mblur_type,
......@@ -942,12 +947,56 @@ mblur_dialog (gint32 image_ID,
NULL);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
center = gimp_frame_new (_("Blur Center"));
gtk_box_pack_start (GTK_BOX (hbox), center, FALSE, FALSE, 0);
gtk_widget_show (center);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_add (GTK_CONTAINER (center), vbox);
gtk_widget_show (vbox);
gimp_image_get_resolution (image_ID, &xres, &yres);
entry = gimp_size_entry_new (1,
GIMP_UNIT_PIXEL, "%a",
TRUE, FALSE, FALSE, 5,
GIMP_SIZE_ENTRY_UPDATE_SIZE);
gtk_table_set_row_spacings (GTK_TABLE (entry), 2);
gtk_table_set_col_spacing (GTK_TABLE (entry), 0, 6);
gtk_table_set_col_spacing (GTK_TABLE (entry), 2, 6);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
gtk_widget_show (entry);
g_signal_connect (entry, "value_changed",
G_CALLBACK (mblur_center_update),
NULL);
g_signal_connect_swapped (entry, "value_changed",
G_CALLBACK (gimp_preview_invalidate),
preview);
spinbutton = gimp_spin_button_new (&adj, 1, 0, 1, 1, 10, 1, 1, 2);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry),
GTK_SPIN_BUTTON (spinbutton), NULL);
gtk_table_attach_defaults (GTK_TABLE (entry), spinbutton, 1, 2, 0, 1);
gtk_widget_show (spinbutton);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (entry), 0, xres, TRUE);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (entry), 0, mbvals.center_x);
label = gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
_("_X:"), 0, 0, 0.0);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (entry), 1, yres, TRUE);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (entry), 1, mbvals.center_y);
label = gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
_("_Y:"), 1, 0, 0.0);
button = gtk_check_button_new_with_mnemonic (_("Blur _outward"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), mbvals.blur_outward);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
mbvals.blur_outward);
gtk_box_pack_start (GTK_BOX (main_vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
g_signal_connect (button, "toggled",
G_CALLBACK (gimp_toggle_button_update),
......@@ -957,10 +1006,8 @@ mblur_dialog (gint32 image_ID,
preview);
dir_button = button;
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
frame = gimp_frame_new (_("Blur Parameters"));
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
table = gtk_table_new (2, 3, FALSE);
......@@ -974,8 +1021,6 @@ mblur_dialog (gint32 image_ID,
mbvals.length, 0.0, 256.0, 1.0, 8.0, 0,
TRUE, 0, 0,
NULL, NULL);
gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_LABEL (length));
g_object_unref (group);
g_signal_connect (length, "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
......@@ -989,7 +1034,6 @@ mblur_dialog (gint32 image_ID,
mbvals.angle, 0.0, 360.0, 1.0, 15.0, 0,
TRUE, 0, 0,
NULL, NULL);
gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_LABEL (angle));
g_signal_connect (angle, "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
......@@ -998,47 +1042,6 @@ mblur_dialog (gint32 image_ID,
G_CALLBACK (gimp_preview_invalidate),
preview);
center = gimp_frame_new (_("Blur Center"));
gtk_box_pack_start (GTK_BOX (vbox), center, FALSE, FALSE, 0);
gtk_widget_show (center);
gimp_image_get_resolution (image_ID, &xres, &yres);
entry = gimp_size_entry_new (1,
GIMP_UNIT_PIXEL, "%a",
TRUE, FALSE, FALSE, 5,
GIMP_SIZE_ENTRY_UPDATE_SIZE);
gtk_table_set_row_spacings (GTK_TABLE (entry), 2);
gtk_table_set_col_spacing (GTK_TABLE (entry), 0, 6);
gtk_table_set_col_spacing (GTK_TABLE (entry), 2, 6);
gtk_container_add (GTK_CONTAINER (center), entry);
gtk_widget_show (entry);
g_signal_connect (entry, "value_changed",
G_CALLBACK (mblur_center_update),
NULL);
g_signal_connect_swapped (entry, "value_changed",
G_CALLBACK (gimp_preview_invalidate),
preview);
spinbutton = gimp_spin_button_new (&adj, 1, 0, 1, 1, 10, 1, 1, 2);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry),
GTK_SPIN_BUTTON (spinbutton), NULL);
gtk_table_attach_defaults (GTK_TABLE (entry), spinbutton, 1, 2, 0, 1);
gtk_widget_show (spinbutton);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (entry), 0, xres, TRUE);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (entry), 0, mbvals.center_x);
label = gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
_("_X:"), 0, 0, 0.0);
gtk_size_group_add_widget (group, label);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (entry), 1, yres, TRUE);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (entry), 1, mbvals.center_y);
label = gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
_("_Y:"), 1, 0, 0.0);
gtk_size_group_add_widget (group, label);
mblur_set_sensitivity ();
gtk_widget_show (dialog);
......
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