app: clean up the transform options' preview and guides UI

This commit is contained in:
Michael Natterer
2011-07-31 00:25:43 +02:00
parent e9bf7ba6dc
commit 1b2ae6fd9e

View File

@ -119,7 +119,7 @@ gimp_transform_options_class_init (GimpTransformOptionsClass *klass)
GIMP_PARAM_STATIC_STRINGS); GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_PREVIEW_OPACITY, GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_PREVIEW_OPACITY,
"preview-opacity", "preview-opacity",
N_("Preview opacity"), N_("Opacity of the preview image"),
0.0, 1.0, 1.0, 0.0, 1.0, 1.0,
GIMP_PARAM_STATIC_STRINGS); GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_GRID_TYPE, GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_GRID_TYPE,
@ -264,10 +264,9 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
GtkWidget *box; GtkWidget *box;
GtkWidget *label; GtkWidget *label;
GtkWidget *frame; GtkWidget *frame;
GtkWidget *button;
GtkWidget *combo; GtkWidget *combo;
GtkWidget *scale; GtkWidget *scale;
GtkWidget *preview_box; GtkWidget *grid_box;
const gchar *constrain = NULL; const gchar *constrain = NULL;
hbox = gtk_hbox_new (FALSE, 2); hbox = gtk_hbox_new (FALSE, 2);
@ -306,42 +305,36 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (combo); gtk_widget_show (combo);
/* the preview frame */ /* the preview frame */
frame = gimp_frame_new (_("Preview:")); scale = gimp_prop_opacity_spin_scale_new (config, "preview-opacity",
_("Image opacity"));
frame = gimp_prop_expanding_frame_new (config, "show-preview",
_("Show image preview"),
scale, NULL);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame); gtk_widget_show (frame);
preview_box = gtk_vbox_new (FALSE, 2); /* the guides frame */
gtk_container_add (GTK_CONTAINER (frame), preview_box); frame = gimp_frame_new (_("Guides"));
gtk_widget_show (preview_box); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
button = gimp_prop_check_button_new (config, "show-preview", grid_box = gtk_vbox_new (FALSE, 2);
_("Show image")); gtk_container_add (GTK_CONTAINER (frame), grid_box);
gtk_box_pack_start (GTK_BOX (preview_box), button, FALSE, FALSE, 0); gtk_widget_show (grid_box);
gtk_widget_show (button);
/* the preview opacity scale */ /* the guides type menu */
scale = gimp_prop_opacity_spin_scale_new (config, "preview-opacity",
_("Image opacity"));
gtk_box_pack_start (GTK_BOX (preview_box), scale, FALSE, FALSE, 0);
gtk_widget_show (scale);
g_object_bind_property (config, "show-preview",
scale, "sensitive",
G_BINDING_SYNC_CREATE);
/* the grid type menu */
combo = gimp_prop_enum_combo_box_new (config, "grid-type", 0, 0); combo = gimp_prop_enum_combo_box_new (config, "grid-type", 0, 0);
gtk_box_pack_start (GTK_BOX (preview_box), combo, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (grid_box), combo, FALSE, FALSE, 0);
gtk_widget_show (combo); gtk_widget_show (combo);
/* the grid density scale */ /* the grid density scale */
scale = gimp_prop_spin_scale_new (config, "grid-size", NULL, scale = gimp_prop_spin_scale_new (config, "grid-size", NULL,
1.8, 8.0, 0); 1.8, 8.0, 0);
gtk_box_pack_start (GTK_BOX (preview_box), scale, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (grid_box), scale, FALSE, FALSE, 0);
gtk_widget_show (scale); gtk_widget_show (scale);
g_object_bind_property_full (config, "grid-type", g_object_bind_property_full (config, "grid-type",
scale, "sensitive", scale, "visible",
G_BINDING_SYNC_CREATE, G_BINDING_SYNC_CREATE,
gimp_transform_options_sync_grid, gimp_transform_options_sync_grid,
NULL, NULL,