Commit 17d655c1 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/gimprc.[ch] app/gui/preferences-dialog.c

2002-03-12  Michael Natterer  <mitch@gimp.org>

	* app/gimprc.[ch]
	* app/gui/preferences-dialog.c
	* app/paint/gimppaintoptions.[ch]
	* app/tools/paint_options.[ch]
	* app/tools/tool_manager.[ch]: removed the "global_paint_options"
	gimprc option because it doesn't quite fit the new dockable dialog
	architecture.

	* app/gui/brush-select.[ch]
	* app/gui/gradient-select.[ch]
	* app/gui/palette-select.[ch]
	* app/gui/pattern-select.[ch]: removed the "Global Brush/Pattern/...
	Selection" part of them. They are now only used for temp popup
	selections and the PDB. *Lots* of cleanup.

	* app/gui/convert-dialog.c
	* app/gui/dialogs-constructors.[ch]
	* app/gui/dialogs.c
	* app/gui/gui.c
	* app/gui/menus.c
	* app/gui/palette-import-dialog.c
	* app/plug-in/plug-in.c: changed accordingly.

	Cleaned up the palette and other data PDB stuff:

	* tools/pdbgen/Makefile.am
	* tools/pdbgen/groups.pl: added "palette_select" and "palettes".

	* tools/pdbgen/pdb/palette_select.pdb: new file. Makes the palette
	selection PDB controllable.

	* tools/pdbgen/pdb/palettes.pdb: new file cut out of palette.pdb
	because of API symmetry with brushes, patterns, ...

	* tools/pdbgen/pdb/palette.pdb: removed from here.

	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/brushes.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/palette.pdb
	* tools/pdbgen/pdb/pattern_select.pdb
	* tools/pdbgen/pdb/patterns.pdb: lots of cleanup.

	Autogenerated stuff:

	* app/pdb/Makefile.am
	* app/pdb/palette_select_cmds.c
	* app/pdb/palettes_cmds.c: new files.

	* app/pdb/brush_select_cmds.c
	* app/pdb/brushes_cmds.c
	* app/pdb/gradient_select_cmds.c
	* app/pdb/gradients_cmds.c
	* app/pdb/internal_procs.c
	* app/pdb/palette_cmds.c
	* app/pdb/pattern_select_cmds.c
	* app/pdb/patterns_cmds.c: regenerated.

	* libgimp/Makefile.am
	* libgimp/gimp_pdb.h
	* libgimp/gimppalettes_pdb.[ch]
	* libgimp/gimppaletteselect_pdb.[ch]: new files.

	* libgimp/gimpgradientselect_pdb.[ch]
	* libgimp/gimppalette_pdb.[ch]
	* libgimp/gimppatterns_pdb.c: regenerated.

	* devel-docs/libgimp/tmpl/gimpgradients.sgml
	* devel-docs/libgimp/tmpl/gimppalette.sgml: regenerated.
parent 5632b082
2002-03-12 Michael Natterer <mitch@gimp.org>
* app/gimprc.[ch]
* app/gui/preferences-dialog.c
* app/paint/gimppaintoptions.[ch]
* app/tools/paint_options.[ch]
* app/tools/tool_manager.[ch]: removed the "global_paint_options"
gimprc option because it doesn't quite fit the new dockable dialog
architecture.
* app/gui/brush-select.[ch]
* app/gui/gradient-select.[ch]
* app/gui/palette-select.[ch]
* app/gui/pattern-select.[ch]: removed the "Global Brush/Pattern/...
Selection" part of them. They are now only used for temp popup
selections and the PDB. *Lots* of cleanup.
* app/gui/convert-dialog.c
* app/gui/dialogs-constructors.[ch]
* app/gui/dialogs.c
* app/gui/gui.c
* app/gui/menus.c
* app/gui/palette-import-dialog.c
* app/plug-in/plug-in.c: changed accordingly.
Cleaned up the palette and other data PDB stuff:
* tools/pdbgen/Makefile.am
* tools/pdbgen/groups.pl: added "palette_select" and "palettes".
* tools/pdbgen/pdb/palette_select.pdb: new file. Makes the palette
selection PDB controllable.
* tools/pdbgen/pdb/palettes.pdb: new file cut out of palette.pdb
because of API symmetry with brushes, patterns, ...
* tools/pdbgen/pdb/palette.pdb: removed from here.
* tools/pdbgen/pdb/brush_select.pdb
* tools/pdbgen/pdb/brushes.pdb
* tools/pdbgen/pdb/gradient_select.pdb
* tools/pdbgen/pdb/gradients.pdb
* tools/pdbgen/pdb/palette.pdb
* tools/pdbgen/pdb/pattern_select.pdb
* tools/pdbgen/pdb/patterns.pdb: lots of cleanup.
Autogenerated stuff:
* app/pdb/Makefile.am
* app/pdb/palette_select_cmds.c
* app/pdb/palettes_cmds.c: new files.
* app/pdb/brush_select_cmds.c
* app/pdb/brushes_cmds.c
* app/pdb/gradient_select_cmds.c
* app/pdb/gradients_cmds.c
* app/pdb/internal_procs.c
* app/pdb/palette_cmds.c
* app/pdb/pattern_select_cmds.c
* app/pdb/patterns_cmds.c: regenerated.
* libgimp/Makefile.am
* libgimp/gimp_pdb.h
* libgimp/gimppalettes_pdb.[ch]
* libgimp/gimppaletteselect_pdb.[ch]: new files.
* libgimp/gimpgradientselect_pdb.[ch]
* libgimp/gimppalette_pdb.[ch]
* libgimp/gimppatterns_pdb.c: regenerated.
* devel-docs/libgimp/tmpl/gimpgradients.sgml
* devel-docs/libgimp/tmpl/gimppalette.sgml: regenerated.
2002-03-11 Sven Neumann <sven@gimp.org>
* app/gui/preferences-dialog.c: use a PangoAttributeList instead of
......
......@@ -102,6 +102,7 @@
#include "gui/brush-select.h"
#include "gui/gradient-select.h"
#include "gui/palette-select.h"
#include "gui/pattern-select.h"
#include "plug-in.h"
......@@ -114,7 +115,6 @@
#include "libgimp/gimpintl.h"
typedef struct _PlugInBlocked PlugInBlocked;
struct _PlugInBlocked
......@@ -1232,8 +1232,9 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brush_select_dialogs_check ();
pattern_select_dialogs_check ();
gradient_select_dialogs_check ();
palette_select_dialogs_check ();
pattern_select_dialogs_check ();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -623,6 +623,7 @@ indexed_custom_palette_button_callback (GtkWidget *widget,
{
dialog->palette_select =
palette_select_new (dialog->gimage->gimp,
NULL,
_("Select Custom Palette"),
GIMP_OBJECT (theCustomPalette)->name,
NULL);
......
......@@ -59,7 +59,6 @@
#include "widgets/gimpvectorslistview.h"
#include "about-dialog.h"
#include "brush-select.h"
#include "brushes-commands.h"
#include "buffers-commands.h"
#include "channels-commands.h"
......@@ -70,15 +69,12 @@
#include "dialogs-constructors.h"
#include "documents-commands.h"
#include "error-console-dialog.h"
#include "gradient-select.h"
#include "gradients-commands.h"
#include "layers-commands.h"
#include "menus.h"
#include "module-browser.h"
#include "palette-select.h"
#include "palettes-commands.h"
#include "paths-dialog.h"
#include "pattern-select.h"
#include "patterns-commands.h"
#include "preferences-dialog.h"
#include "tips-dialog.h"
......@@ -168,38 +164,6 @@ dialogs_device_status_get (GimpDialogFactory *factory,
return device_status_dialog_create (context->gimp);
}
GtkWidget *
dialogs_brush_select_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
return brush_dialog_create (context->gimp);
}
GtkWidget *
dialogs_pattern_select_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
return pattern_dialog_create (context->gimp);
}
GtkWidget *
dialogs_gradient_select_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
return gradient_dialog_create (context->gimp);
}
GtkWidget *
dialogs_palette_select_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
return palette_dialog_create (context->gimp);
}
GtkWidget *
dialogs_preferences_get (GimpDialogFactory *factory,
GimpContext *context,
......
......@@ -28,18 +28,6 @@ GtkWidget * dialogs_toolbox_get (GimpDialogFactory *factory,
GtkWidget * dialogs_device_status_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_brush_select_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_pattern_select_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_gradient_select_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_palette_select_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_preferences_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
......
......@@ -40,10 +40,6 @@ static const GimpDialogFactoryEntry toplevel_entries[] =
{
{ "gimp:toolbox", dialogs_toolbox_get, 32, TRUE, TRUE, TRUE, TRUE },
{ "gimp:device-status-dialog", dialogs_device_status_get, 32, TRUE, TRUE, FALSE, TRUE },
{ "gimp:brush-select-dialog", dialogs_brush_select_get, 32, TRUE, TRUE, FALSE, TRUE },
{ "gimp:pattern-select-dialog", dialogs_pattern_select_get, 32, TRUE, TRUE, FALSE, TRUE },
{ "gimp:gradient-select-dialog", dialogs_gradient_select_get, 32, TRUE, TRUE, FALSE, TRUE },
{ "gimp:palette-select-dialog", dialogs_palette_select_get, 32, TRUE, TRUE, FALSE, TRUE },
{ "gimp:preferences-dialog", dialogs_preferences_get, 32, TRUE, FALSE, FALSE, TRUE },
{ "gimp:module-browser-dialog", dialogs_module_browser_get, 32, TRUE, FALSE, FALSE, TRUE },
{ "gimp:undo-history-dialog", dialogs_undo_history_get, 32, FALSE, FALSE, FALSE, TRUE },
......
......@@ -57,24 +57,25 @@ typedef struct _ImportDialog ImportDialog;
struct _ImportDialog
{
GtkWidget *dialog;
GimpContext *context;
ImportType import_type;
GtkWidget *select_area;
GtkWidget *preview;
GtkWidget *select_button;
GtkWidget *image_menu;
GtkWidget *entry;
GtkWidget *image_menu_item_image;
GtkWidget *image_menu_item_gradient;
GtkWidget *type_option;
GtkWidget *threshold_scale;
GtkWidget *threshold_text;
GtkAdjustment *threshold;
GtkAdjustment *sample;
GtkWidget *dialog;
GimpContext *context;
GradientSelect *gradient_select;
ImportType import_type;
GtkWidget *select_area;
GtkWidget *preview;
GtkWidget *select_button;
GtkWidget *image_menu;
GtkWidget *entry;
GtkWidget *image_menu_item_image;
GtkWidget *image_menu_item_gradient;
GtkWidget *type_option;
GtkWidget *threshold_scale;
GtkWidget *threshold_text;
GtkAdjustment *threshold;
GtkAdjustment *sample;
};
......@@ -91,10 +92,22 @@ palette_import_select_grad_callback (GtkWidget *widget,
gpointer data)
{
ImportDialog *import_dialog;
GimpGradient *gradient;
import_dialog = (ImportDialog *) data;
gradient_dialog_create (import_dialog->context->gimp);
gradient = gimp_context_get_gradient (import_dialog->context);
import_dialog->gradient_select =
gradient_select_new (import_dialog->context->gimp,
import_dialog->context,
_("Select a Gradient to Create a Palette from"),
GIMP_OBJECT (gradient)->name,
NULL,
0);
g_object_add_weak_pointer (G_OBJECT (import_dialog->gradient_select->shell),
(gpointer *) &import_dialog->gradient_select);
}
static void
......@@ -263,6 +276,9 @@ static void
palette_import_close_callback (GtkWidget *widget,
gpointer data)
{
if (import_dialog->gradient_select)
gradient_select_free (import_dialog->gradient_select);
gtk_widget_destroy (import_dialog->dialog);
g_free (import_dialog);
import_dialog = NULL;
......@@ -349,8 +365,8 @@ palette_import_dialog_new (Gimp *gimp)
import_dialog = g_new0 (ImportDialog, 1);
import_dialog->context = gimp_context_new (gimp, "Palette Import",
gimp_get_user_context (gimp));
import_dialog->context = gimp_context_new (gimp, "Palette Import",
gimp_get_user_context (gimp));
import_dialog->dialog =
gimp_dialog_new (_("Import Palette"), "import_palette",
......
......@@ -168,7 +168,6 @@ static gboolean old_using_xserver_resolution;
static gint old_num_processors;
static gchar * old_image_title_format;
static gchar * old_image_status_format;
static gboolean old_global_paint_options;
static guint old_max_new_image_size;
static gboolean old_write_thumbnails;
static gboolean old_trust_dirty_flag;
......@@ -719,11 +718,6 @@ prefs_save_callback (GtkWidget *widget,
{
update = g_list_append (update, "image-status-format");
}
if (gimprc.global_paint_options != old_global_paint_options)
{
update = g_list_append (update, "global-paint-options");
remove = g_list_append (remove, "no-global-paint-options");
}
if (gimprc.max_new_image_size != old_max_new_image_size)
{
update = g_list_append (update, "max-new-image-size");
......@@ -979,8 +973,6 @@ prefs_cancel_callback (GtkWidget *widget,
prefs_strset (&gimprc.image_status_format, old_image_status_format);
prefs_strset (&gimp->config->default_comment, old_default_comment);
tool_manager_set_global_paint_options (gimp, old_global_paint_options);
/* restore values which need a restart */
edit_stingy_memory_use = old_stingy_memory_use;
edit_min_colors = old_min_colors;
......@@ -1081,12 +1073,6 @@ prefs_toggle_callback (GtkWidget *widget,
gdisplays_expose_full ();
gdisplays_flush ();
}
else if (data == &gimprc.global_paint_options)
{
tool_manager_set_global_paint_options (gimp,
GTK_TOGGLE_BUTTON (widget)->active);
}
/* no matching varible found */
else
{
......@@ -1712,7 +1698,6 @@ preferences_dialog_create (Gimp *gimp)
old_monitor_xres = gimprc.monitor_xres;
old_monitor_yres = gimprc.monitor_yres;
old_using_xserver_resolution = gimprc.using_xserver_resolution;
old_global_paint_options = gimprc.global_paint_options;
old_max_new_image_size = gimprc.max_new_image_size;
old_trust_dirty_flag = gimprc.trust_dirty_flag;
old_use_help = gimprc.use_help;
......@@ -2217,11 +2202,6 @@ preferences_dialog_create (Gimp *gimp)
&child_iter,
page_index++);
vbox2 = prefs_frame_new (_("Paint Options"), GTK_CONTAINER (vbox));
prefs_check_button_new (_("Use Global Paint Options"),
&gimprc.global_paint_options, GTK_BOX (vbox2));
vbox2 = prefs_frame_new (_("Finding Contiguous Regions"), GTK_CONTAINER (vbox));
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
......
......@@ -215,7 +215,6 @@ GimpRc gimprc =
/* using_xserver_resolution */ FALSE,
/* image_title_format */ NULL,
/* image_status_format */ NULL,
/* global_paint_options */ FALSE,
/* max_new_image_size */ 33554432, /* 32 MB */
/* trust_dirty_flag */ FALSE,
/* use_help */ TRUE,
......@@ -274,8 +273,6 @@ static ParseFunc funcs[] =
{ "monitor-yresolution", TT_DOUBLE, &gimprc.monitor_yres, NULL },
{ "image-title-format", TT_STRING, &gimprc.image_title_format, NULL },
{ "image-status-format", TT_STRING, &gimprc.image_status_format, NULL },
{ "global-paint-options", TT_BOOLEAN, &gimprc.global_paint_options, NULL },
{ "no-global-paint-options", TT_BOOLEAN, NULL, &gimprc.global_paint_options },
{ "max-new-image-size", TT_MEMSIZE, &gimprc.max_new_image_size, NULL },
{ "trust-dirty-flag", TT_BOOLEAN, &gimprc.trust_dirty_flag, NULL },
{ "dont-trust-dirty-flag", TT_BOOLEAN, NULL, &gimprc.trust_dirty_flag },
......
......@@ -56,7 +56,6 @@ struct _GimpRc
gboolean using_xserver_resolution;
gchar *image_title_format;
gchar *image_status_format;
gboolean global_paint_options;
guint max_new_image_size;
gboolean trust_dirty_flag;
gboolean use_help;
......
......@@ -37,6 +37,7 @@
#include "pdb/procedural_db.h"
#include "widgets/gimpbrushfactoryview.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpwidgets-constructors.h"
#include "brush-select.h"
......@@ -53,6 +54,7 @@
/* local function prototypes */
static void brush_select_change_callbacks (BrushSelect *bsp,
gboolean closing);
......@@ -67,158 +69,138 @@ static void brush_select_paint_mode_changed (GimpContext *context,
BrushSelect *bsp);
static void opacity_scale_update (GtkAdjustment *adj,
gpointer data);
BrushSelect *bsp);
static void paint_mode_menu_callback (GtkWidget *widget,
gpointer data);
BrushSelect *bsp);
static void spacing_scale_update (GtkAdjustment *adj,
gpointer data);
BrushSelect *bsp);
static void brush_select_close_callback (GtkWidget *widget,
gpointer data);
BrushSelect *bsp);
/* list of active dialogs */
static GSList *brush_active_dialogs = NULL;
/* the main brush selection dialog */
static BrushSelect *brush_select_dialog = NULL;
/* public functions */
GtkWidget *
brush_dialog_create (Gimp *gimp)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
if (! brush_select_dialog)
{
brush_select_dialog = brush_select_new (gimp, NULL, NULL, 0.0, 0, 0, NULL);
}
return brush_select_dialog->shell;
}
void
brush_dialog_free (void)
{
if (brush_select_dialog)
{
brush_select_free (brush_select_dialog);
brush_select_dialog = NULL;
}
}
/* If title == NULL then it is the main brush dialog */
BrushSelect *
brush_select_new (Gimp *gimp,
GimpContext *context,
const gchar *title,
/* These are the required initial vals
* If init_name == NULL then use current brush
*/
const gchar *init_name,
gdouble init_opacity,
gint init_spacing,
gint init_mode,
const gchar *callback_name)
{
BrushSelect *bsp;
GtkWidget *main_vbox;
GtkWidget *sep;
GtkWidget *table;
GtkWidget *slider;
GimpBrush *active = NULL;
BrushSelect *bsp;
GtkWidget *sep;
GtkWidget *table;
GtkWidget *slider;
GtkAdjustment *spacing_adj;
GimpBrush *active = NULL;
static gboolean first_call = TRUE;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
bsp = g_new0 (BrushSelect, 1);
bsp->callback_name = g_strdup (callback_name);
/* The shell */
bsp->shell = gimp_dialog_new (title ? title : _("Brush Selection"),
"brush_selection",
gimp_standard_help_func,
"dialogs/brush_selection.html",
title ? GTK_WIN_POS_MOUSE : GTK_WIN_POS_NONE,
FALSE, TRUE, FALSE,
"_delete_event_", brush_select_close_callback,
bsp, NULL, NULL, TRUE, TRUE,
NULL);
gtk_dialog_set_has_separator (GTK_DIALOG (bsp->shell), FALSE);
gtk_widget_hide (GTK_DIALOG (bsp->shell)->action_area);
if (title)
{
bsp->context = gimp_context_new (gimp, title, NULL);
}
else
{
bsp->context = gimp_get_user_context (gimp);
}
g_return_val_if_fail (! context || GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (title != NULL, NULL);
if (gimp->no_data && first_call)
gimp_data_factory_data_init (gimp->brush_factory, FALSE);
first_call = FALSE;
if (title && init_name && strlen (init_name))
if (init_name && strlen (init_name))
{
active = (GimpBrush *)
gimp_container_get_child_by_name (gimp->brush_factory->container,
init_name);
}
else
if (! active)
{
active = gimp_context_get_brush (gimp_get_user_context (gimp));
if (context)
active = gimp_context_get_brush (context);
else
active = gimp_context_get_brush (gimp_get_current_context (gimp));
}
if (!active)
active = gimp_context_get_brush (gimp_get_standard_context (gimp));
if (! active)
return NULL;
bsp = g_new0 (BrushSelect, 1);
if (title)
/* Add to active brush dialogs list */
brush_active_dialogs = g_slist_append (brush_active_dialogs, bsp);
bsp->context = gimp_context_new (gimp, title, context);
bsp->callback_name = g_strdup (callback_name);
if (context)
{
gimp_context_set_brush (bsp->context, active);
gimp_context_set_paint_mode (bsp->context, init_mode);
gimp_context_set_opacity (bsp->context, init_opacity);
bsp->spacing_value = init_spacing;
gimp_context_define_properties (bsp->context,
GIMP_CONTEXT_OPACITY_MASK |
GIMP_CONTEXT_PAINT_MODE_MASK |
GIMP_CONTEXT_BRUSH_MASK,
FALSE);
gimp_context_set_parent (bsp->context, context);
}
/* The main vbox */
main_vbox = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 2);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (bsp->shell)->vbox), main_vbox);
gimp_context_set_brush (bsp->context, active);
gimp_context_set_paint_mode (bsp->context, init_mode);
gimp_context_set_opacity (bsp->context, init_opacity);
bsp->spacing_value = init_spacing;
g_signal_connect (G_OBJECT (bsp->context), "brush_changed",
G_CALLBACK (brush_select_brush_changed),
bsp);
g_signal_connect (G_OBJECT (bsp->context), "opacity_changed",
G_CALLBACK (brush_select_opacity_changed),
bsp);
g_signal_connect (G_OBJECT (bsp->context), "paint_mode_changed",
G_CALLBACK (brush_select_paint_mode_changed),
bsp);
/* The shell */
bsp->shell = gimp_dialog_new (title, "brush_selection",
gimp_standard_help_func,
"dialogs/brush_selection.html",
GTK_WIN_POS_MOUSE,
FALSE, TRUE, FALSE,
"_delete_event_", brush_select_close_callback,
bsp, NULL, NULL, TRUE, TRUE,
NULL);
gtk_dialog_set_has_separator (GTK_DIALOG (bsp->shell), FALSE);
gtk_widget_hide (GTK_DIALOG (bsp->shell)->action_area);
/* The Brush Grid */
bsp->view = gimp_brush_factory_view_new (GIMP_VIEW_TYPE_GRID,
gimp->brush_factory,
dialogs_edit_brush_func,
bsp->context,
title ? FALSE : TRUE,
MIN_CELL_SIZE,
STD_BRUSH_COLUMNS,
STD_BRUSH_ROWS,
NULL);
gtk_box_pack_start (GTK_BOX (main_vbox), bsp->view, TRUE, TRUE, 0);
bsp->view =
gimp_brush_factory_view_new (GIMP_VIEW_TYPE_GRID,
gimp->brush_factory,
dialogs_edit_brush_func,
bsp->context,
title ? FALSE : TRUE,
MIN_CELL_SIZE,
STD_BRUSH_COLUMNS,
STD_BRUSH_ROWS,
gimp_item_factory_from_path ("<Brushes>"));
gtk_container_set_border_width (GTK_CONTAINER (bsp->view), 2);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (bsp->shell)->vbox), bsp->view);
gtk_widget_show (bsp->view);
/* The vbox for the paint options */
bsp->paint_options_box = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (bsp->view), bsp->paint_options_box,
FALSE, FALSE, 0);
/* Create the frame and the table for the options */
table = gtk_table_new (2, 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (bsp->paint_options_box), table, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (bsp->view), table, FALSE, FALSE, 2);
gtk_widget_show (table);
/* Create the opacity scale widget */
bsp->opacity_data =
......@@ -245,56 +227,27 @@ brush_select_new (Gimp *gimp,
_("Mode:"), 1.0, 0.5,
bsp->option_menu, 1, TRUE);
gtk_widget_show (table);
gtk_widget_show (bsp->paint_options_box);
/* A separator after the paint options */
sep = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (bsp->paint_options_box), sep, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (bsp->view), sep, FALSE, FALSE, 0);
gtk_widget_show (sep);
if (title && init_spacing >= 0)
{
GtkAdjustment *adj;
adj = GIMP_BRUSH_FACTORY_VIEW (bsp->view)->spacing_adjustment;
spacing_adj = GIMP_BRUSH_FACTORY_VIEW (bsp->view)->spacing_adjustment;
if (init_spacing >= 0)
{
/* Use passed spacing instead of brushes default */
gtk_adjustment_set_value (adj, init_spacing);
gtk_adjustment_set_value (spacing_adj, init_spacing);
}
g_signal_connect
(G_OBJECT (GIMP_BRUSH_FACTORY_VIEW (bsp->view)->spacing_adjustment),
"value_changed",
G_CALLBACK (spacing_scale_update),
bsp);
g_signal_connect (G_OBJECT (spacing_adj), "value_changed",
G_CALLBACK (spacing_scale_update),
bsp);
gtk_widget_show (table);
gtk_widget_show (main_vbox);
/* Only for main dialog */
if (! title)
{
/* if we are in per-tool paint options mode, hide the paint options */
brush_select_show_paint_options (bsp, gimprc.global_paint_options);
}
gtk_widget_show (bsp->shell);
g_signal_connect (G_OBJECT (bsp->context), "brush_changed",
G_CALLBACK (brush_select_brush_changed),
bsp);
g_signal_connect (G_OBJECT (bsp->context), "opacity_changed",
G_CALLBACK (brush_select_opacity_changed),
bsp);
g_signal_connect (G_OBJECT (bsp->context), "paint_mode_changed",