Commit 5c816c6b authored by jtl's avatar jtl

*** empty log message ***

parent 7f5fbf42
2000-04-16 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/ink.c: tweaked dialog layout
* app/interface.c: take theme's [xy]thickness into account when
setting up minimum sizes and size_increments
* app/tool_options.c: changed the term "Pressure" to "Hardness"
in the pressure sensitivity UI
* plug-ins/gap/iter_ALT/gen/plug_in_bump_map_iter_ALT.inc: removed
* plug-ins/gap/iter_ALT/mod/plug_in_bump_map_iter_ALT.inc: new file
* plug-ins/gap/Makefile.am
* plug-ins/gap/gap_filter_iterators.c: changed filter_iterator to
reflect changes in the bumpmap plug_in
2000-04-16 Jens Lautenbacher <jtl@gimp.org>
Sven Neumann <sven@gimp.org>
......
......@@ -727,7 +727,7 @@ paint_pressure_options_new (ToolType tool_type)
case ERASER:
case PAINTBRUSH:
case SMUDGE:
pressure->pressure_w = gtk_check_button_new_with_label (_("Pressure"));
pressure->pressure_w = gtk_check_button_new_with_label (_("Hardness"));
gtk_container_add (GTK_CONTAINER (wbox), pressure->pressure_w);
gtk_signal_connect (GTK_OBJECT (pressure->pressure_w), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
......
......@@ -521,27 +521,16 @@ create_toolbox (void)
GList *list;
GtkAccelGroup *table;
GdkGeometry geometry;
GtkStyle *style;
gint xthickness;
gint ythickness;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
/* Register dialog */
dialog_register_toolbox (window);
gtk_window_set_wmclass (GTK_WINDOW (window), "toolbox", "Gimp");
gtk_window_set_title (GTK_WINDOW (window), _("The GIMP"));
gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, FALSE);
geometry.min_width = 30;
geometry.min_height = 102;
geometry.width_inc = 28;
geometry.height_inc = 28;
gtk_window_set_geometry_hints (GTK_WINDOW (window),
NULL,
&geometry,
GDK_HINT_MIN_SIZE | GDK_HINT_RESIZE_INC);
session_set_window_geometry (window, &toolbox_session_info, TRUE);
gtk_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (toolbox_delete),
NULL);
......@@ -572,6 +561,29 @@ create_toolbox (void)
gtk_widget_set_events (window, GDK_POINTER_MOTION_MASK);
gtk_widget_set_extension_events (window, GDK_EXTENSION_EVENTS_CURSOR);
}
/* set up the window geometry after the events have been set,
since we need to realize the widget */
gtk_window_set_wmclass (GTK_WINDOW (window), "toolbox", "Gimp");
gtk_window_set_title (GTK_WINDOW (window), _("The GIMP"));
gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, FALSE);
gtk_widget_realize (window);
style = gtk_widget_get_style (window);
xthickness = ((GtkStyleClass *) style->klass)->xthickness;
ythickness = ((GtkStyleClass *) style->klass)->ythickness;
geometry.min_width = 2 + 24 + 2 * xthickness;
geometry.min_height = 100 + 24 + 2 * ythickness;
geometry.width_inc = 24 + 2 * xthickness;
geometry.height_inc = 24 + 2 * ythickness;
gtk_window_set_geometry_hints (GTK_WINDOW (window),
NULL,
&geometry,
GDK_HINT_MIN_SIZE | GDK_HINT_RESIZE_INC);
session_set_window_geometry (window, &toolbox_session_info, TRUE);
main_vbox = gtk_vbox_new (FALSE, 1);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 1);
......@@ -602,7 +614,8 @@ create_toolbox (void)
wbox = gtk_hwrap_box_new (FALSE);
gtk_wrap_box_set_justify (GTK_WRAP_BOX (wbox), GTK_JUSTIFY_TOP);
gtk_wrap_box_set_line_justify (GTK_WRAP_BOX (wbox), GTK_JUSTIFY_LEFT);
gtk_wrap_box_set_aspect_ratio (GTK_WRAP_BOX (wbox), 140.0 / 192.0); /* 5x5 tools */
/* magic number to set a default 5x5 layout */
gtk_wrap_box_set_aspect_ratio (GTK_WRAP_BOX (wbox), 5.0 / 5.9);
gtk_container_set_border_width (GTK_CONTAINER (wbox), 0);
gtk_box_pack_start (GTK_BOX (main_vbox), wbox, TRUE, TRUE, 0);
gtk_widget_show (wbox);
......
......@@ -521,27 +521,16 @@ create_toolbox (void)
GList *list;
GtkAccelGroup *table;
GdkGeometry geometry;
GtkStyle *style;
gint xthickness;
gint ythickness;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
/* Register dialog */
dialog_register_toolbox (window);
gtk_window_set_wmclass (GTK_WINDOW (window), "toolbox", "Gimp");
gtk_window_set_title (GTK_WINDOW (window), _("The GIMP"));
gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, FALSE);
geometry.min_width = 30;
geometry.min_height = 102;
geometry.width_inc = 28;
geometry.height_inc = 28;
gtk_window_set_geometry_hints (GTK_WINDOW (window),
NULL,
&geometry,
GDK_HINT_MIN_SIZE | GDK_HINT_RESIZE_INC);
session_set_window_geometry (window, &toolbox_session_info, TRUE);
gtk_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (toolbox_delete),
NULL);
......@@ -572,6 +561,29 @@ create_toolbox (void)
gtk_widget_set_events (window, GDK_POINTER_MOTION_MASK);
gtk_widget_set_extension_events (window, GDK_EXTENSION_EVENTS_CURSOR);
}
/* set up the window geometry after the events have been set,
since we need to realize the widget */
gtk_window_set_wmclass (GTK_WINDOW (window), "toolbox", "Gimp");
gtk_window_set_title (GTK_WINDOW (window), _("The GIMP"));
gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, FALSE);
gtk_widget_realize (window);
style = gtk_widget_get_style (window);
xthickness = ((GtkStyleClass *) style->klass)->xthickness;
ythickness = ((GtkStyleClass *) style->klass)->ythickness;
geometry.min_width = 2 + 24 + 2 * xthickness;
geometry.min_height = 100 + 24 + 2 * ythickness;
geometry.width_inc = 24 + 2 * xthickness;
geometry.height_inc = 24 + 2 * ythickness;
gtk_window_set_geometry_hints (GTK_WINDOW (window),
NULL,
&geometry,
GDK_HINT_MIN_SIZE | GDK_HINT_RESIZE_INC);
session_set_window_geometry (window, &toolbox_session_info, TRUE);
main_vbox = gtk_vbox_new (FALSE, 1);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 1);
......@@ -602,7 +614,8 @@ create_toolbox (void)
wbox = gtk_hwrap_box_new (FALSE);
gtk_wrap_box_set_justify (GTK_WRAP_BOX (wbox), GTK_JUSTIFY_TOP);
gtk_wrap_box_set_line_justify (GTK_WRAP_BOX (wbox), GTK_JUSTIFY_LEFT);
gtk_wrap_box_set_aspect_ratio (GTK_WRAP_BOX (wbox), 140.0 / 192.0); /* 5x5 tools */
/* magic number to set a default 5x5 layout */
gtk_wrap_box_set_aspect_ratio (GTK_WRAP_BOX (wbox), 5.0 / 5.9);
gtk_container_set_border_width (GTK_CONTAINER (wbox), 0);
gtk_box_pack_start (GTK_BOX (main_vbox), wbox, TRUE, TRUE, 0);
gtk_widget_show (wbox);
......
......@@ -258,8 +258,8 @@ ink_options_new (void)
GtkWidget *table;
GtkWidget *vbox;
GtkWidget *abox;
GtkWidget *label;
GtkWidget *hbox;
GtkWidget *hbox2;
GtkWidget *radio_button;
GtkWidget *pixmap_widget;
GtkWidget *slider;
......@@ -281,151 +281,117 @@ ink_options_new (void)
options->aspect = options->aspect_d = 1.0;
options->angle = options->angle_d = 0.0;
/* the main table */
table = gtk_table_new (9, 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 2);
gtk_table_set_row_spacing (GTK_TABLE (table), 1, 2);
gtk_table_set_row_spacing (GTK_TABLE (table), 3, 2);
gtk_table_set_row_spacing (GTK_TABLE (table), 5, 2);
gtk_table_set_row_spacing (GTK_TABLE (table), 7, 4);
gtk_box_pack_start (GTK_BOX (((ToolOptions *) options)->main_vbox), table,
FALSE, FALSE, 0);
/* the main vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (((ToolOptions *) options)->main_vbox), vbox,
TRUE, TRUE, 0);
gtk_widget_show (vbox);
/* adjust sliders */
frame = gtk_frame_new (_("Adjustment"));
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
gtk_widget_show (frame);
table = gtk_table_new (2, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_show (table);
/* size slider */
label = gtk_label_new (_("Size:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (label);
options->size_w =
gtk_adjustment_new (options->size_d, 0.0, 20.0, 1.0, 2.0, 0.0);
slider = gtk_hscale_new (GTK_ADJUSTMENT (options->size_w));
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
gtk_table_attach_defaults (GTK_TABLE (table), slider, 1, 2, 0, 1);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Size:"), 1.0, 1.0,
slider, 1, FALSE);
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->size_w), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->size);
gtk_widget_show (slider);
/* sens slider */
label = gtk_label_new (_("Sensitivity:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (label);
/* angle adjust slider */
options->tilt_angle_w =
gtk_adjustment_new (options->tilt_angle_d, -90.0, 90.0, 1, 10.0, 0.0);
slider = gtk_hscale_new (GTK_ADJUSTMENT (options->tilt_angle_w));
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Angle:"), 1.0, 1.0,
slider, 1, FALSE);
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->tilt_angle_w), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->tilt_angle);
/* sens sliders */
frame = gtk_frame_new (_("Sensitivity"));
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
gtk_widget_show (frame);
table = gtk_table_new (3, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_show (table);
/* size sens slider */
options->sensitivity_w =
gtk_adjustment_new (options->sensitivity_d, 0.0, 1.0, 0.01, 0.1, 0.0);
slider = gtk_hscale_new (GTK_ADJUSTMENT (options->sensitivity_w));
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
gtk_table_attach_defaults (GTK_TABLE (table), slider, 1, 2, 1, 2);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Size:"), 1.0, 1.0,
slider, 1, FALSE);
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->sensitivity_w), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->sensitivity);
gtk_widget_show (slider);
/* tilt sens slider */
label = gtk_label_new (_("Tilt"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 1.0);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3,
GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
gtk_widget_show (label);
label = gtk_label_new (_("Sensitivity:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4,
GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
gtk_widget_show (label);
abox = gtk_alignment_new (0.5, 1.0, 1.0, 0.0);
gtk_table_attach (GTK_TABLE (table), abox, 1, 2, 2, 4,
GTK_EXPAND | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (abox);
options->tilt_sensitivity_w =
gtk_adjustment_new (options->tilt_sensitivity_d, 0.0, 1.0, 0.01, 0.1, 0.0);
slider = gtk_hscale_new (GTK_ADJUSTMENT (options->tilt_sensitivity_w));
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
gtk_container_add (GTK_CONTAINER (abox), slider);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Tilt:"), 1.0, 1.0,
slider, 1, FALSE);
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->tilt_sensitivity_w), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->tilt_sensitivity);
gtk_widget_show (slider);
/* velocity sens slider */
label = gtk_label_new (_("Speed"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 1.0);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 4, 5,
GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
gtk_widget_show (label);
label = gtk_label_new (_("Sensitivity:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 5, 6,
GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
gtk_widget_show (label);
abox = gtk_alignment_new (0.5, 1.0, 1.0, 0.0);
gtk_table_attach (GTK_TABLE (table), abox, 1, 2, 4, 6,
GTK_EXPAND | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (abox);
options->vel_sensitivity_w =
gtk_adjustment_new (options->vel_sensitivity_d, 0.0, 1.0, 0.01, 0.1, 0.0);
slider = gtk_hscale_new (GTK_ADJUSTMENT (options->vel_sensitivity_w));
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
gtk_container_add (GTK_CONTAINER (abox), slider);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
_("Speed:"), 1.0, 1.0,
slider, 1, FALSE);
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->vel_sensitivity_w), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->vel_sensitivity);
gtk_widget_show (slider);
/* angle adjust slider */
label = gtk_label_new (_("Angle"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 1.0);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 6, 7,
GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
gtk_widget_show (label);
label = gtk_label_new (_("Adjust:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 7, 8,
GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
gtk_widget_show (label);
abox = gtk_alignment_new (0.5, 1.0, 1.0, 0.0);
gtk_table_attach (GTK_TABLE (table), abox, 1, 2, 6, 8,
GTK_EXPAND | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (abox);
options->tilt_angle_w =
gtk_adjustment_new (options->tilt_angle_d, -90.0, 90.0, 1, 10.0, 0.0);
slider = gtk_hscale_new (GTK_ADJUSTMENT (options->tilt_angle_w));
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
gtk_container_add (GTK_CONTAINER (abox), slider);
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->tilt_angle_w), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->tilt_angle);
/* bottom hbox */
hbox = gtk_hbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
/* Brush type radiobuttons */
frame = gtk_frame_new (_("Type"));
gtk_table_attach (GTK_TABLE (table), frame, 0, 1, 8, 9,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
gtk_widget_show (frame);
hbox2 = gtk_hbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (frame), hbox2);
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_box_pack_start (GTK_BOX (hbox2), vbox, FALSE, FALSE, 0);
gtk_widget_show (vbox);
pixmap = blob_pixmap (gtk_widget_get_colormap (vbox),
......@@ -434,6 +400,7 @@ ink_options_new (void)
pixmap_widget = gtk_pixmap_new (pixmap, NULL);
gdk_pixmap_unref (pixmap);
gtk_misc_set_padding (GTK_MISC (pixmap_widget), 6, 0);
radio_button = gtk_radio_button_new (NULL);
gtk_signal_connect (GTK_OBJECT (radio_button), "toggled",
......@@ -451,6 +418,7 @@ ink_options_new (void)
pixmap_widget = gtk_pixmap_new (pixmap, NULL);
gdk_pixmap_unref (pixmap);
gtk_misc_set_padding (GTK_MISC (pixmap_widget), 6, 0);
radio_button =
gtk_radio_button_new_from_widget (GTK_RADIO_BUTTON (radio_button));
......@@ -469,6 +437,7 @@ ink_options_new (void)
pixmap_widget = gtk_pixmap_new (pixmap, NULL);
gdk_pixmap_unref (pixmap);
gtk_misc_set_padding (GTK_MISC (pixmap_widget), 6, 0);
radio_button =
gtk_radio_button_new_from_widget (GTK_RADIO_BUTTON (radio_button));
......@@ -483,7 +452,7 @@ ink_options_new (void)
/* Brush shape widget */
frame = gtk_frame_new (_("Shape"));
gtk_table_attach_defaults (GTK_TABLE (table), frame, 1, 2, 8, 9);
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
gtk_widget_show (frame);
vbox = gtk_vbox_new (FALSE, 2);
......@@ -491,13 +460,13 @@ ink_options_new (void)
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
options->brush_w = g_new (BrushWidget, 1);
options->brush_w->state = FALSE;
frame = gtk_aspect_frame_new (NULL, 0.5, 0.5, 1.0, FALSE);
frame = gtk_aspect_frame_new (NULL, 0.0, 0.5, 1.0, FALSE);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
options->brush_w = g_new (BrushWidget, 1);
options->brush_w->state = FALSE;
darea = gtk_drawing_area_new();
options->brush_w->widget = darea;
......@@ -523,7 +492,7 @@ ink_options_new (void)
GTK_SIGNAL_FUNC (brush_widget_realize),
options->brush_w);
gtk_widget_show_all (table);
gtk_widget_show_all (hbox);
return options;
}
......
......@@ -521,27 +521,16 @@ create_toolbox (void)
GList *list;
GtkAccelGroup *table;
GdkGeometry geometry;
GtkStyle *style;
gint xthickness;
gint ythickness;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
/* Register dialog */
dialog_register_toolbox (window);
gtk_window_set_wmclass (GTK_WINDOW (window), "toolbox", "Gimp");
gtk_window_set_title (GTK_WINDOW (window), _("The GIMP"));
gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, FALSE);
geometry.min_width = 30;
geometry.min_height = 102;
geometry.width_inc = 28;
geometry.height_inc = 28;
gtk_window_set_geometry_hints (GTK_WINDOW (window),
NULL,
&geometry,
GDK_HINT_MIN_SIZE | GDK_HINT_RESIZE_INC);
session_set_window_geometry (window, &toolbox_session_info, TRUE);
gtk_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (toolbox_delete),
NULL);
......@@ -572,6 +561,29 @@ create_toolbox (void)
gtk_widget_set_events (window, GDK_POINTER_MOTION_MASK);
gtk_widget_set_extension_events (window, GDK_EXTENSION_EVENTS_CURSOR);
}
/* set up the window geometry after the events have been set,
since we need to realize the widget */
gtk_window_set_wmclass (GTK_WINDOW (window), "toolbox", "Gimp");
gtk_window_set_title (GTK_WINDOW (window), _("The GIMP"));
gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, FALSE);
gtk_widget_realize (window);
style = gtk_widget_get_style (window);
xthickness = ((GtkStyleClass *) style->klass)->xthickness;
ythickness = ((GtkStyleClass *) style->klass)->ythickness;
geometry.min_width = 2 + 24 + 2 * xthickness;
geometry.min_height = 100 + 24 + 2 * ythickness;
geometry.width_inc = 24 + 2 * xthickness;
geometry.height_inc = 24 + 2 * ythickness;
gtk_window_set_geometry_hints (GTK_WINDOW (window),
NULL,
&geometry,
GDK_HINT_MIN_SIZE | GDK_HINT_RESIZE_INC);
session_set_window_geometry (window, &toolbox_session_info, TRUE);
main_vbox = gtk_vbox_new (FALSE, 1);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 1);
......@@ -602,7 +614,8 @@ create_toolbox (void)
wbox = gtk_hwrap_box_new (FALSE);
gtk_wrap_box_set_justify (GTK_WRAP_BOX (wbox), GTK_JUSTIFY_TOP);
gtk_wrap_box_set_line_justify (GTK_WRAP_BOX (wbox), GTK_JUSTIFY_LEFT);
gtk_wrap_box_set_aspect_ratio (GTK_WRAP_BOX (wbox), 140.0 / 192.0); /* 5x5 tools */
/* magic number to set a default 5x5 layout */
gtk_wrap_box_set_aspect_ratio (GTK_WRAP_BOX (wbox), 5.0 / 5.9);
gtk_container_set_border_width (GTK_CONTAINER (wbox), 0);
gtk_box_pack_start (GTK_BOX (main_vbox), wbox, TRUE, TRUE, 0);
gtk_widget_show (wbox);
......
......@@ -258,8 +258,8 @@ ink_options_new (void)
GtkWidget *table;
GtkWidget *vbox;
GtkWidget *abox;
GtkWidget *label;
GtkWidget *hbox;
GtkWidget *hbox2;
GtkWidget *radio_button;
GtkWidget *pixmap_widget;
GtkWidget *slider;
......@@ -281,151 +281,117 @@ ink_options_new (void)
options->aspect = options->aspect_d = 1.0;
options->angle = options->angle_d = 0.0;
/* the main table */
table = gtk_table_new (9, 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 2);
gtk_table_set_row_spacing (GTK_TABLE (table), 1, 2);
gtk_table_set_row_spacing (GTK_TABLE (table), 3, 2);
gtk_table_set_row_spacing (GTK_TABLE (table), 5, 2);
gtk_table_set_row_spacing (GTK_TABLE (table), 7, 4);
gtk_box_pack_start (GTK_BOX (((ToolOptions *) options)->main_vbox), table,
FALSE, FALSE, 0);
/* the main vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (((ToolOptions *) options)->main_vbox), vbox,
TRUE, TRUE, 0);
gtk_widget_show (vbox);
/* adjust sliders */
frame = gtk_frame_new (_("Adjustment"));
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
gtk_widget_show (frame);
table = gtk_table_new (2, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_show (table);
/* size slider */
label = gtk_label_new (_("Size:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (label);
options->size_w =
gtk_adjustment_new (options->size_d, 0.0, 20.0, 1.0, 2.0, 0.0);
slider = gtk_hscale_new (GTK_ADJUSTMENT (options->size_w));
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
gtk_table_attach_defaults (GTK_TABLE (table), slider, 1, 2, 0, 1);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Size:"), 1.0, 1.0,
slider, 1, FALSE);
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->size_w), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->size);
gtk_widget_show (slider);
/* sens slider */
label = gtk_label_new (_("Sensitivity:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (label);
/* angle adjust slider */
options->tilt_angle_w =
gtk_adjustment_new (options->tilt_angle_d, -90.0, 90.0, 1, 10.0, 0.0);
slider = gtk_hscale_new (GTK_ADJUSTMENT (options->tilt_angle_w));
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Angle:"), 1.0, 1.0,
slider, 1, FALSE);
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->tilt_angle_w), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->tilt_angle);
/* sens sliders */
frame = gtk_frame_new (_("Sensitivity"));
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
gtk_widget_show (frame);
table = gtk_table_new (3, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_show (table);