code cleanup. Pack the widgets the way we usually do this.

2007-02-08  Sven Neumann  <sven@gimp.org>

	* app/tools/gimprectangleoptions.c (gimp_rectangle_options_gui):
	code cleanup. Pack the widgets the way we usually do this.


svn path=/trunk/; revision=21875
This commit is contained in:
Sven Neumann 2007-02-08 16:59:40 +00:00 committed by Sven Neumann
parent aac28d11ca
commit aba50bbc14
2 changed files with 27 additions and 45 deletions

View file

@ -1,3 +1,8 @@
2007-02-08 Sven Neumann <sven@gimp.org>
* app/tools/gimprectangleoptions.c (gimp_rectangle_options_gui):
code cleanup. Pack the widgets the way we usually do this.
2007-02-08 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-scale.c: applied patch from Robert

View file

@ -501,7 +501,7 @@ gimp_rectangle_options_gui (GimpToolOptions *tool_options)
GtkWidget *frame;
GtkWidget *aspect;
GList *children;
gint row;
gint row = 0;
private = GIMP_RECTANGLE_OPTIONS_GET_PRIVATE (tool_options);
@ -528,81 +528,58 @@ gimp_rectangle_options_gui (GimpToolOptions *tool_options)
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
table = gtk_table_new (6, 6, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 5);
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, FALSE, 5);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 3);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
/* X */
row = 0;
entry = gimp_prop_size_entry_new (config, "x0", "unit", "%a",
GIMP_SIZE_ENTRY_UPDATE_SIZE, 300);
label = gtk_label_new (_("X"));
gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, row, row + 1);
gtk_widget_show (label);
gimp_size_entry_show_unit_menu (GIMP_SIZE_ENTRY (entry), FALSE);
gtk_table_attach_defaults (GTK_TABLE (table), entry, 2, 5, row, row + 1);
gtk_widget_show (entry);
gimp_table_attach_aligned (GTK_TABLE (table), 0, row++,
_("X:"), 0.0, 0.5,
entry, 1, FALSE);
/* Y */
row++;
entry = gimp_prop_size_entry_new (config, "y0", "unit", "%a",
GIMP_SIZE_ENTRY_UPDATE_SIZE, 300);
label = gtk_label_new (_("Y"));
gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, row, row + 1);
gtk_widget_show (label);
gimp_size_entry_show_unit_menu (GIMP_SIZE_ENTRY (entry), FALSE);
gtk_table_attach_defaults (GTK_TABLE (table), entry, 2, 5, row, row + 1);
gtk_widget_show (entry);
gimp_table_attach_aligned (GTK_TABLE (table), 0, row++,
_("Y:"), 0.0, 0.5,
entry, 1, FALSE);
/* Width */
row++;
entry = gimp_prop_size_entry_new (config, "width", "unit", "%a",
GIMP_SIZE_ENTRY_UPDATE_SIZE, 300);
label = gtk_label_new (_("Width"));
gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, row, row + 1);
gtk_widget_show (label);
gimp_size_entry_show_unit_menu (GIMP_SIZE_ENTRY (entry), FALSE);
gtk_table_attach_defaults (GTK_TABLE (table), entry, 2, 5, row, row + 1);
gtk_widget_show (entry);
gimp_table_attach_aligned (GTK_TABLE (table), 0, row,
_("Width:"), 0.0, 0.5,
entry, 1, FALSE);
button = gimp_prop_check_button_new (config, "fixed-width", _("Fix"));
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
gtk_widget_show (button);
gtk_table_attach_defaults (GTK_TABLE (table), button, 5, 6, row, row + 1);
gtk_table_attach_defaults (GTK_TABLE (table), button, 2, 3, row, row + 1);
row++;
/* Height */
row++;
label = gtk_label_new (_("Height"));
gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, row, row + 1);
gtk_widget_show (label);
entry = gimp_prop_size_entry_new (config, "height", "unit", "%a",
GIMP_SIZE_ENTRY_UPDATE_SIZE, 300);
gimp_size_entry_show_unit_menu (GIMP_SIZE_ENTRY (entry), FALSE);
gtk_table_attach_defaults (GTK_TABLE (table), entry, 2, 5, row, row + 1);
gtk_widget_show (entry);
gimp_table_attach_aligned (GTK_TABLE (table), 0, row,
_("Height:"), 0.0, 0.5,
entry, 1, FALSE);
button = gimp_prop_check_button_new (config, "fixed-height", _("Fix"));
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
gtk_widget_show (button);
gtk_table_attach_defaults (GTK_TABLE (table), button, 5, 6, row, row + 1);
gtk_table_attach_defaults (GTK_TABLE (table), button, 2, 3, row, row + 1);
row++;
/* Aspect */
row++;
label = gtk_label_new (_("Aspect"));
gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, row, row + 1);
gtk_widget_show (label);
hbox = gtk_hbox_new (FALSE, 0);
gtk_table_attach_defaults (GTK_TABLE (table), hbox, 2, 5, row, row + 1);
gtk_table_attach_defaults (GTK_TABLE (table), hbox, 1, 2, row, row + 1);
gtk_widget_show (hbox);
entry = gimp_prop_aspect_ratio_new (config,
@ -627,7 +604,7 @@ gimp_rectangle_options_gui (GimpToolOptions *tool_options)
button = gimp_prop_check_button_new (config, "fixed-aspect", _("Fix"));
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
gtk_widget_show (button);
gtk_table_attach_defaults (GTK_TABLE (table), button, 5, 6, row, row + 1);
gtk_table_attach_defaults (GTK_TABLE (table), button, 2, 3, row, row + 1);
gtk_widget_show (table);