removed the pattern preview...

2003-04-08  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimpbucketfilloptions.c: removed the pattern preview...

	* app/tools/paint_options.c: ...and added it here so all paint
	tools can use it if needed. Added a pattern preview to the clone
	tool options.
This commit is contained in:
Michael Natterer 2003-04-08 20:08:37 +00:00 committed by Michael Natterer
parent e9d617b5f2
commit bfe98456e4
4 changed files with 102 additions and 50 deletions

View File

@ -1,3 +1,11 @@
2003-04-08 Michael Natterer <mitch@gimp.org>
* app/tools/gimpbucketfilloptions.c: removed the pattern preview...
* app/tools/paint_options.c: ...and added it here so all paint
tools can use it if needed. Added a pattern preview to the clone
tool options.
2003-04-08 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdockable.[ch]: Added "gpointer get_tab_data" to

View File

@ -33,8 +33,6 @@
#include "display/gimpdisplay.h"
#include "widgets/gimpcontainerpopup.h"
#include "widgets/gimpdock.h"
#include "widgets/gimppropwidgets.h"
#include "widgets/gimpwidgets-utils.h"
@ -68,9 +66,6 @@ static void gimp_bucket_fill_options_get_property (GObject *object,
static void gimp_bucket_fill_options_reset (GimpToolOptions *tool_options);
static void bucket_options_pattern_clicked (GtkWidget *widget,
GimpContext *context);
static GimpPaintOptionsClass *parent_class = NULL;
@ -228,33 +223,16 @@ gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
{
GObject *config;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *button;
GtkWidget *preview;
GtkWidget *vbox2;
GtkWidget *table;
GtkWidget *frame;
GtkWidget *button;
gchar *str;
config = G_OBJECT (tool_options);
vbox = gimp_paint_options_gui (tool_options);
table = g_object_get_data (G_OBJECT (vbox), GIMP_PAINT_OPTIONS_TABLE_KEY);
/* the brush preview */
button = gtk_button_new ();
preview = gimp_prop_preview_new (config, "pattern", 24);
gtk_container_add (GTK_CONTAINER (button), preview);
gtk_widget_show (preview);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Pattern:"), 1.0, 0.5,
button, 2, TRUE);
g_signal_connect (button, "clicked",
G_CALLBACK (bucket_options_pattern_clicked),
tool_options);
/* fill type */
str = g_strdup_printf (_("Fill Type %s"), gimp_get_mod_name_control ());
frame = gimp_prop_enum_radio_frame_new (config, "fill-mode", str, 0, 0);
@ -300,21 +278,3 @@ gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
return vbox;
}
static void
bucket_options_pattern_clicked (GtkWidget *widget,
GimpContext *context)
{
GtkWidget *toplevel;
GtkWidget *popup;
toplevel = gtk_widget_get_toplevel (widget);
popup = gimp_container_popup_new (context->gimp->pattern_factory->container,
context,
GIMP_DOCK (toplevel)->dialog_factory,
"gimp-pattern-grid",
GIMP_STOCK_TOOL_BUCKET_FILL,
_("Open the pattern selection dialog"));
gimp_container_popup_show (GIMP_CONTAINER_POPUP (popup), widget);
}

View File

@ -67,7 +67,9 @@ static GtkWidget * gradient_options_gui (GimpGradientOptions *gradient,
GType tool_type,
GtkWidget *incremental_toggle);
static void paint_options_brush_clicked (GtkWidget *widget,
static void paint_options_brush_clicked (GtkWidget *widget,
GimpContext *context);
static void paint_options_pattern_clicked (GtkWidget *widget,
GimpContext *context);
@ -83,6 +85,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
GtkWidget *optionmenu;
GtkWidget *mode_label;
GtkWidget *incremental_toggle = NULL;
gint table_row = 0;
options = GIMP_PAINT_OPTIONS (tool_options);
context = GIMP_CONTEXT (tool_options);
@ -101,12 +104,12 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
/* the opacity scale */
gimp_prop_opacity_entry_new (config, "opacity",
GTK_TABLE (table), 0, 0,
GTK_TABLE (table), 0, table_row++,
_("Opacity:"));
/* the paint mode menu */
optionmenu = gimp_prop_paint_mode_menu_new (config, "paint-mode", TRUE);
mode_label = gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
mode_label = gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
_("Mode:"), 1.0, 0.5,
optionmenu, 2, TRUE);
@ -132,7 +135,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
gtk_container_add (GTK_CONTAINER (button), preview);
gtk_widget_show (preview);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
_("Brush:"), 1.0, 0.5,
button, 2, TRUE);
@ -141,6 +144,27 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
context);
}
/* the pattern preview */
if (tool_options->tool_info->tool_type == GIMP_TYPE_BUCKET_FILL_TOOL ||
tool_options->tool_info->tool_type == GIMP_TYPE_CLONE_TOOL)
{
GtkWidget *button;
GtkWidget *preview;
button = gtk_button_new ();
preview = gimp_prop_preview_new (config, "pattern", 24);
gtk_container_add (GTK_CONTAINER (button), preview);
gtk_widget_show (preview);
gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
_("Pattern:"), 1.0, 0.5,
button, 2, TRUE);
g_signal_connect (button, "clicked",
G_CALLBACK (paint_options_pattern_clicked),
context);
}
/* the "incremental" toggle */
if (tool_options->tool_info->tool_type == GIMP_TYPE_AIRBRUSH_TOOL ||
tool_options->tool_info->tool_type == GIMP_TYPE_ERASER_TOOL ||
@ -424,3 +448,21 @@ paint_options_brush_clicked (GtkWidget *widget,
_("Open the brush selection dialog"));
gimp_container_popup_show (GIMP_CONTAINER_POPUP (popup), widget);
}
static void
paint_options_pattern_clicked (GtkWidget *widget,
GimpContext *context)
{
GtkWidget *toplevel;
GtkWidget *popup;
toplevel = gtk_widget_get_toplevel (widget);
popup = gimp_container_popup_new (context->gimp->pattern_factory->container,
context,
GIMP_DOCK (toplevel)->dialog_factory,
"gimp-pattern-grid",
GIMP_STOCK_TOOL_BUCKET_FILL,
_("Open the pattern selection dialog"));
gimp_container_popup_show (GIMP_CONTAINER_POPUP (popup), widget);
}

View File

@ -67,7 +67,9 @@ static GtkWidget * gradient_options_gui (GimpGradientOptions *gradient,
GType tool_type,
GtkWidget *incremental_toggle);
static void paint_options_brush_clicked (GtkWidget *widget,
static void paint_options_brush_clicked (GtkWidget *widget,
GimpContext *context);
static void paint_options_pattern_clicked (GtkWidget *widget,
GimpContext *context);
@ -83,6 +85,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
GtkWidget *optionmenu;
GtkWidget *mode_label;
GtkWidget *incremental_toggle = NULL;
gint table_row = 0;
options = GIMP_PAINT_OPTIONS (tool_options);
context = GIMP_CONTEXT (tool_options);
@ -101,12 +104,12 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
/* the opacity scale */
gimp_prop_opacity_entry_new (config, "opacity",
GTK_TABLE (table), 0, 0,
GTK_TABLE (table), 0, table_row++,
_("Opacity:"));
/* the paint mode menu */
optionmenu = gimp_prop_paint_mode_menu_new (config, "paint-mode", TRUE);
mode_label = gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
mode_label = gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
_("Mode:"), 1.0, 0.5,
optionmenu, 2, TRUE);
@ -132,7 +135,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
gtk_container_add (GTK_CONTAINER (button), preview);
gtk_widget_show (preview);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
_("Brush:"), 1.0, 0.5,
button, 2, TRUE);
@ -141,6 +144,27 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
context);
}
/* the pattern preview */
if (tool_options->tool_info->tool_type == GIMP_TYPE_BUCKET_FILL_TOOL ||
tool_options->tool_info->tool_type == GIMP_TYPE_CLONE_TOOL)
{
GtkWidget *button;
GtkWidget *preview;
button = gtk_button_new ();
preview = gimp_prop_preview_new (config, "pattern", 24);
gtk_container_add (GTK_CONTAINER (button), preview);
gtk_widget_show (preview);
gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
_("Pattern:"), 1.0, 0.5,
button, 2, TRUE);
g_signal_connect (button, "clicked",
G_CALLBACK (paint_options_pattern_clicked),
context);
}
/* the "incremental" toggle */
if (tool_options->tool_info->tool_type == GIMP_TYPE_AIRBRUSH_TOOL ||
tool_options->tool_info->tool_type == GIMP_TYPE_ERASER_TOOL ||
@ -424,3 +448,21 @@ paint_options_brush_clicked (GtkWidget *widget,
_("Open the brush selection dialog"));
gimp_container_popup_show (GIMP_CONTAINER_POPUP (popup), widget);
}
static void
paint_options_pattern_clicked (GtkWidget *widget,
GimpContext *context)
{
GtkWidget *toplevel;
GtkWidget *popup;
toplevel = gtk_widget_get_toplevel (widget);
popup = gimp_container_popup_new (context->gimp->pattern_factory->container,
context,
GIMP_DOCK (toplevel)->dialog_factory,
"gimp-pattern-grid",
GIMP_STOCK_TOOL_BUCKET_FILL,
_("Open the pattern selection dialog"));
gimp_container_popup_show (GIMP_CONTAINER_POPUP (popup), widget);
}