Commit 8ed375a4 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

added GIMP_CONTEXT_PATTERN_MASK to the context properties which are

2003-03-25  Michael Natterer  <mitch@gimp.org>

	* app/tools/tool_manager.c: added GIMP_CONTEXT_PATTERN_MASK to the
	context properties which are remembered per tool options.

	* app/tools/paint_options.[ch]
	* app/tools/gimpblendoptions.c: attach the brush and gradient
	preview to the GtkTable that holds opacity and paint mode.

	* app/tools/gimpbucketfilloptions.c: added a pattern preview
	and popup.
parent f4364f1a
2003-03-25 Michael Natterer <mitch@gimp.org>
* app/tools/tool_manager.c: added GIMP_CONTEXT_PATTERN_MASK to the
context properties which are remembered per tool options.
* app/tools/paint_options.[ch]
* app/tools/gimpblendoptions.c: attach the brush and gradient
preview to the GtkTable that holds opacity and paint mode.
* app/tools/gimpbucketfilloptions.c: added a pattern preview
and popup.
2003-03-25 Michael Natterer <mitch@gimp.org>
 
* app/text/Makefile.am
......@@ -32,7 +32,6 @@
#include "widgets/gimpcontainerpopup.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdock.h"
#include "widgets/gimppropwidgets.h"
#include "gimpblendoptions.h"
......@@ -56,20 +55,20 @@ enum
static void gimp_blend_options_init (GimpBlendOptions *options);
static void gimp_blend_options_class_init (GimpBlendOptionsClass *options_class);
static void gimp_blend_options_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_blend_options_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_blend_options_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_blend_options_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gradient_type_notify (GimpBlendOptions *options,
GParamSpec *pspec,
GtkWidget *repeat_menu);
static void blend_options_gradient_clicked (GtkWidget *widget,
GimpContext *context);
static void blend_options_gradient_clicked (GtkWidget *widget,
GimpContext *context);
static void blend_options_gradient_type_notify (GimpBlendOptions *options,
GParamSpec *pspec,
GtkWidget *repeat_menu);
static GimpPaintOptionsClass *parent_class = NULL;
......@@ -240,18 +239,7 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
vbox = gimp_paint_options_gui (tool_options);
/* the offset scale */
table = gtk_table_new (4, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 1);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
gimp_prop_scale_entry_new (config, "offset",
GTK_TABLE (table), 0, 0,
_("Offset:"),
1.0, 10.0, 1,
FALSE, 0.0, 0.0);
table = g_object_get_data (G_OBJECT (vbox), GIMP_PAINT_OPTIONS_TABLE_KEY);
/* the gradient preview */
button = gtk_button_new ();
......@@ -259,7 +247,7 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
gtk_container_add (GTK_CONTAINER (button), preview);
gtk_widget_show (preview);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Gradient:"), 1.0, 0.5,
button, 2, TRUE);
......@@ -267,20 +255,27 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
G_CALLBACK (blend_options_gradient_clicked),
tool_options);
/* the offset scale */
gimp_prop_scale_entry_new (config, "offset",
GTK_TABLE (table), 0, 3,
_("Offset:"),
1.0, 10.0, 1,
FALSE, 0.0, 0.0);
/* the gradient type menu */
optionmenu = gimp_prop_enum_option_menu_new (config, "gradient-type", 0, 0);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
gimp_table_attach_aligned (GTK_TABLE (table), 0, 4,
_("Shape:"), 1.0, 0.5,
optionmenu, 2, TRUE);
/* the repeat option */
optionmenu = gimp_prop_enum_option_menu_new (config, "repeat", 0, 0);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
gimp_table_attach_aligned (GTK_TABLE (table), 0, 5,
_("Repeat:"), 1.0, 0.5,
optionmenu, 2, TRUE);
g_signal_connect (config, "notify::gradient-type",
G_CALLBACK (gradient_type_notify),
G_CALLBACK (blend_options_gradient_type_notify),
optionmenu);
/* frame for supersampling options */
......@@ -335,9 +330,9 @@ blend_options_gradient_clicked (GtkWidget *widget,
}
static void
gradient_type_notify (GimpBlendOptions *options,
GParamSpec *pspec,
GtkWidget *repeat_menu)
blend_options_gradient_type_notify (GimpBlendOptions *options,
GParamSpec *pspec,
GtkWidget *repeat_menu)
{
gtk_widget_set_sensitive (repeat_menu, options->gradient_type < 6);
}
......@@ -28,10 +28,12 @@
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpdatafactory.h"
#include "core/gimptoolinfo.h"
#include "display/gimpdisplay.h"
#include "widgets/gimpcontainerpopup.h"
#include "widgets/gimppropwidgets.h"
#include "widgets/gimpwidgets-utils.h"
......@@ -63,7 +65,13 @@ static void gimp_bucket_fill_options_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
static void gimp_bucket_fill_options_reset (GimpToolOptions *tool_options);
static void gimp_bucket_fill_options_reset (GimpToolOptions *tool_options);
static void bucket_options_pattern_clicked (GtkWidget *widget,
GimpContext *context);
static void bucket_options_fill_mode_notify (GimpBucketFillOptions *options,
GParamSpec *pspec,
GtkWidget *button);
static GimpPaintOptionsClass *parent_class = NULL;
......@@ -220,27 +228,46 @@ gimp_bucket_fill_options_reset (GimpToolOptions *tool_options)
GtkWidget *
gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
{
GObject *config;
GtkWidget *vbox;
GtkWidget *vbox2;
GtkWidget *table;
GtkWidget *frame;
GtkWidget *button;
gchar *str;
GObject *config;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *button;
GtkWidget *preview;
GtkWidget *vbox2;
GtkWidget *frame;
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);
g_free (str);
frame = gimp_prop_enum_radio_frame_new (config, "fill-mode",
str, 0, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
g_free (str);
g_signal_connect (config, "notify::fill-mode",
G_CALLBACK (bucket_options_fill_mode_notify),
button);
frame = gtk_frame_new (_("Finding Similar Colors"));
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
......@@ -279,3 +306,23 @@ gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
return vbox;
}
static void
bucket_options_pattern_clicked (GtkWidget *widget,
GimpContext *context)
{
GtkWidget *popup;
popup = gimp_container_popup_new (context->gimp->pattern_factory->container,
context);
gimp_container_popup_show (GIMP_CONTAINER_POPUP (popup), widget);
}
static void
bucket_options_fill_mode_notify (GimpBucketFillOptions *options,
GParamSpec *pspec,
GtkWidget *button)
{
gtk_widget_set_sensitive (button,
options->fill_mode == GIMP_PATTERN_BUCKET_FILL);
}
......@@ -35,7 +35,6 @@
#include "widgets/gimpcontainerpopup.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdock.h"
#include "widgets/gimppropwidgets.h"
#include "widgets/gtkhwrapbox.h"
......@@ -97,6 +96,8 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
g_object_set_data (G_OBJECT (vbox), GIMP_PAINT_OPTIONS_TABLE_KEY, table);
/* the opacity scale */
gimp_prop_opacity_entry_new (config, "opacity",
GTK_TABLE (table), 0, 0,
......@@ -139,16 +140,6 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
context);
}
/* a separator after the common paint options */
if (tool_options->tool_info->tool_type == GIMP_TYPE_BLEND_TOOL)
{
GtkWidget *separator;
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
gtk_widget_show (separator);
}
/* the "incremental" toggle */
if (tool_options->tool_info->tool_type == GIMP_TYPE_AIRBRUSH_TOOL ||
tool_options->tool_info->tool_type == GIMP_TYPE_ERASER_TOOL ||
......
......@@ -20,6 +20,9 @@
#define __PAINT_OPTIONS_H__
#define GIMP_PAINT_OPTIONS_TABLE_KEY "gimp-paint-options-table"
GtkWidget * gimp_paint_options_gui (GimpToolOptions *tool_options);
......
......@@ -35,7 +35,6 @@
#include "widgets/gimpcontainerpopup.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdock.h"
#include "widgets/gimppropwidgets.h"
#include "widgets/gtkhwrapbox.h"
......@@ -97,6 +96,8 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
g_object_set_data (G_OBJECT (vbox), GIMP_PAINT_OPTIONS_TABLE_KEY, table);
/* the opacity scale */
gimp_prop_opacity_entry_new (config, "opacity",
GTK_TABLE (table), 0, 0,
......@@ -139,16 +140,6 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
context);
}
/* a separator after the common paint options */
if (tool_options->tool_info->tool_type == GIMP_TYPE_BLEND_TOOL)
{
GtkWidget *separator;
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
gtk_widget_show (separator);
}
/* the "incremental" toggle */
if (tool_options->tool_info->tool_type == GIMP_TYPE_AIRBRUSH_TOOL ||
tool_options->tool_info->tool_type == GIMP_TYPE_ERASER_TOOL ||
......
......@@ -20,6 +20,9 @@
#define __PAINT_OPTIONS_H__
#define GIMP_PAINT_OPTIONS_TABLE_KEY "gimp-paint-options-table"
GtkWidget * gimp_paint_options_gui (GimpToolOptions *tool_options);
......
......@@ -57,6 +57,7 @@
#define PAINT_OPTIONS_MASK GIMP_CONTEXT_OPACITY_MASK | \
GIMP_CONTEXT_PAINT_MODE_MASK | \
GIMP_CONTEXT_BRUSH_MASK | \
GIMP_CONTEXT_PATTERN_MASK | \
GIMP_CONTEXT_GRADIENT_MASK
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment