added a colspan parameter and fixed packing of the stock icon.

2003-02-21  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpwidgets-utils.[ch] (gimp_table_attach_stock):
	added a colspan parameter and fixed packing of the stock icon.

	* app/tools/gimpselectionoptions.c
	* app/tools/gimptextoptions.c: improved dialog layout.
This commit is contained in:
Sven Neumann 2003-02-21 00:42:53 +00:00 committed by Sven Neumann
parent 496aeb6d9d
commit a18fee2912
5 changed files with 67 additions and 61 deletions

View File

@ -1,3 +1,11 @@
2003-02-21 Sven Neumann <sven@gimp.org>
* app/widgets/gimpwidgets-utils.[ch] (gimp_table_attach_stock):
added a colspan parameter and fixed packing of the stock icon.
* app/tools/gimpselectionoptions.c
* app/tools/gimptextoptions.c: improved dialog layout.
2003-02-20 Sven Neumann <sven@gimp.org>
* app/widgets/gimpfontselection-dialog.c

View File

@ -515,10 +515,9 @@ gimp_selection_options_gui (GimpToolOptions *tool_options)
GtkWidget *frame;
GtkWidget *vbox2;
GtkWidget *table;
GtkWidget *optionmenu;
GtkWidget *menu;
GtkWidget *width_spinbutton;
GtkWidget *height_spinbutton;
GtkObject *adjustment;
frame = gtk_frame_new (NULL);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
@ -546,45 +545,43 @@ gimp_selection_options_gui (GimpToolOptions *tool_options)
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
optionmenu = gimp_prop_enum_option_menu_new (config, "fixed-mode",
0, 0);
gtk_frame_set_label_widget (GTK_FRAME (frame), optionmenu);
gtk_widget_show (optionmenu);
menu = gimp_prop_enum_option_menu_new (config, "fixed-mode", 0, 0);
gtk_frame_set_label_widget (GTK_FRAME (frame), menu);
gtk_widget_show (menu);
table = gtk_table_new (3, 3, FALSE);
table = gtk_table_new (2, 3, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 1);
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_set_sensitive (table, options->fixed_mode != GIMP_RECT_SELECT_MODE_FREE);
gtk_widget_set_sensitive (table,
options->fixed_mode != GIMP_RECT_SELECT_MODE_FREE);
g_signal_connect (config, "notify::fixed-mode",
G_CALLBACK (selection_options_fixed_mode_notify),
table);
adjustment = gimp_prop_scale_entry_new (config, "fixed-width",
GTK_TABLE (table), 0, 0,
_("Width:"),
1.0, 50.0, 1,
TRUE, 1.0, 100.0);
width_spinbutton = gimp_prop_spin_button_new (config, "fixed-width",
1.0, 50.0, 0);
gtk_entry_set_width_chars (GTK_ENTRY (width_spinbutton), 6);
width_spinbutton = GIMP_SCALE_ENTRY_SPINBUTTON (adjustment);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Width:"), 1.0, 0.5,
width_spinbutton, 1, FALSE);
adjustment = gimp_prop_scale_entry_new (config, "fixed-height",
GTK_TABLE (table), 0, 1,
_("Height:"),
1.0, 50.0, 1,
TRUE, 1.0, 100.0);
height_spinbutton = gimp_prop_spin_button_new (config, "fixed-height",
1.0, 50.0, 0);
gtk_entry_set_width_chars (GTK_ENTRY (height_spinbutton), 6);
height_spinbutton = GIMP_SCALE_ENTRY_SPINBUTTON (adjustment);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Height:"), 1.0, 0.5,
height_spinbutton, 1, FALSE);
optionmenu = gimp_prop_unit_menu_new (config, "fixed-unit", "%a");
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Unit:"), 1.0, 0.5,
optionmenu, 2, TRUE);
menu = gimp_prop_unit_menu_new (config, "fixed-unit", "%a");
gtk_table_attach (GTK_TABLE (table), menu, 2, 3, 1, 2,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (menu);
g_object_set_data (G_OBJECT (optionmenu), "set_digits",
width_spinbutton);
g_object_set_data (G_OBJECT (menu), "set_digits", width_spinbutton);
g_object_set_data (G_OBJECT (width_spinbutton), "set_digits",
height_spinbutton);

View File

@ -42,10 +42,10 @@
#include "libgimp/gimpintl.h"
static void gimp_text_options_init (GimpTextOptions *options);
static void gimp_text_options_class_init (GimpTextOptionsClass *options_class);
static void gimp_text_options_init (GimpTextOptions *options);
static void gimp_text_options_class_init (GimpTextOptionsClass *options_class);
static void gimp_text_options_reset (GimpToolOptions *tool_options);
static void gimp_text_options_reset (GimpToolOptions *tool_options);
static GimpToolOptionsClass *parent_class = NULL;
@ -119,71 +119,70 @@ GtkWidget *
gimp_text_options_gui (GimpToolOptions *tool_options)
{
GimpTextOptions *options;
GObject *config;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *button;
GtkWidget *unit_menu;
GtkWidget *menu;
GtkWidget *font_selection;
GtkWidget *box;
GtkWidget *spinbutton;
gint digits;
options = GIMP_TEXT_OPTIONS (tool_options);
config = G_OBJECT (options->text);
vbox = gimp_tool_options_gui (tool_options);
table = gtk_table_new (4, 6, FALSE);
table = gtk_table_new (6, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (table), FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
font_selection = gimp_prop_font_selection_new (G_OBJECT (options->text),
"font");
font_selection = gimp_prop_font_selection_new (config, "font");
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("_Font:"), 1.0, 0.5,
font_selection, 3, FALSE);
font_selection, 2, FALSE);
digits = gimp_unit_get_digits (options->text->font_size_unit);
spinbutton = gimp_prop_spin_button_new (G_OBJECT (options->text),
"font-size",
spinbutton = gimp_prop_spin_button_new (config, "font-size",
1.0, 10.0, digits);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("_Size:"), 1.0, 0.5,
spinbutton, 2, FALSE);
spinbutton, 1, FALSE);
unit_menu = gimp_prop_unit_menu_new (G_OBJECT (options->text),
"font-size-unit", "%a");
g_object_set_data (G_OBJECT (unit_menu), "set_digits", spinbutton);
gtk_table_attach (GTK_TABLE (table), unit_menu, 3, 4, 1, 2,
menu = gimp_prop_unit_menu_new (config, "font-size-unit", "%a");
g_object_set_data (G_OBJECT (menu), "set_digits", spinbutton);
gtk_table_attach (GTK_TABLE (table), menu, 2, 3, 1, 2,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (unit_menu);
gtk_widget_show (menu);
button = gimp_prop_color_button_new (G_OBJECT (options->text),
"color", _("Text Color"),
button = gimp_prop_color_button_new (config, "color",
_("Text Color"),
-1, 24, GIMP_COLOR_AREA_FLAT);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),
GIMP_CONTEXT (options));
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Color:"), 1.0, 0.5, button, 1, FALSE);
_("Color:"), 1.0, 0.5,
button, 1, FALSE);
box = gimp_prop_enum_stock_box_new (G_OBJECT (options->text),
"justify", "gtk-justify", 0, 0);
box = gimp_prop_enum_stock_box_new (config, "justify", "gtk-justify", 0, 0);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
_("Justify:"), 1.0, 0.5, box, 3, TRUE);
_("Justify:"), 1.0, 0.5,
box, 2, TRUE);
spinbutton = gimp_prop_spin_button_new (G_OBJECT (options->text),
"indent", 1.0, 10.0, 1);
spinbutton = gimp_prop_spin_button_new (config, "indent", 1.0, 10.0, 1);
gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 5);
gimp_table_attach_stock (GTK_TABLE (table), 4,
_("Indent:"), 0.5, spinbutton, NULL);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 4,
_("Indent:"), 1.0, 0.5,
spinbutton, 1, FALSE);
spinbutton = gimp_prop_spin_button_new (G_OBJECT (options->text),
"line-spacing", 1.0, 10.0, 1);
spinbutton = gimp_prop_spin_button_new (config, "line-spacing", 1.0, 10.0, 1);
gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 5);
gimp_table_attach_stock (GTK_TABLE (table), 5,
_("Line\nSpacing:"), 0.0, spinbutton,
GIMP_STOCK_LINE_SPACING);
_("Line\nSpacing:"), 0.0,
spinbutton, 1, GIMP_STOCK_LINE_SPACING);
return vbox;
}

View File

@ -246,6 +246,7 @@ gimp_table_attach_stock (GtkTable *table,
const gchar *label_text,
gdouble yalign,
GtkWidget *widget,
gint colspan,
const gchar *stock_id)
{
GtkWidget *image;
@ -266,7 +267,7 @@ gimp_table_attach_stock (GtkTable *table,
{
g_return_if_fail (GTK_IS_WIDGET (widget));
gtk_table_attach (table, widget, 1, 3, row, row + 1,
gtk_table_attach (table, widget, 1, 1 + colspan, row, row + 1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (widget);
@ -278,8 +279,8 @@ gimp_table_attach_stock (GtkTable *table,
if (image)
{
gtk_misc_set_alignment (GTK_MISC (image), 0.0, 0.5);
gtk_table_attach (table, image, 3, 4, row, row + 1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_table_attach (table, image, 1 + colspan, 2 + colspan, row, row + 1,
GTK_SHRINK | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (image);
}
}

View File

@ -41,6 +41,7 @@ void gimp_table_attach_stock (GtkTable *table,
const gchar *label_text,
gdouble yalign,
GtkWidget *widget,
gint colspan,
const gchar *stock_id);
const gchar * gimp_get_mod_name_shift (void);