Commit e9e98af6 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/config/gimpdisplayconfig.[ch] added "gboolean show_brush_outline".

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

	* app/config/gimpdisplayconfig.[ch]
	* app/config/gimprc-blurbs.h: added "gboolean show_brush_outline".

	* app/gui/preferences-dialog.c (prefs_dialog_new): added it to the
	"Pointer Movement Feedback" frame.

	* app/tools/gimppainttool.[ch]: connect to
	"notify::show-brush-outline" and toggle brush outline display
	accordingly. Fixes bug #120084.
parent 1081b14f
2003-08-19 Michael Natterer <mitch@gimp.org>
* app/config/gimpdisplayconfig.[ch]
* app/config/gimprc-blurbs.h: added "gboolean show_brush_outline".
* app/gui/preferences-dialog.c (prefs_dialog_new): added it to the
"Pointer Movement Feedback" frame.
* app/tools/gimppainttool.[ch]: connect to
"notify::show-brush-outline" and toggle brush outline display
accordingly. Fixes bug #120084.
2003-08-19 Sven Neumann <sven@gimp.org>
* themes/Default/images/Makefile.am
......@@ -65,6 +65,7 @@ enum
PROP_PERFECT_MOUSE,
PROP_CURSOR_MODE,
PROP_CURSOR_UPDATING,
PROP_SHOW_BRUSH_OUTLINE,
PROP_IMAGE_TITLE_FORMAT,
PROP_IMAGE_STATUS_FORMAT,
PROP_CONFIRM_ON_CLOSE,
......@@ -177,6 +178,10 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
"cursor-updating", CURSOR_UPDATING_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_BRUSH_OUTLINE,
"show-brush-outline", SHOW_BRUSH_OUTLINE_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_IMAGE_TITLE_FORMAT,
"image-title-format",
IMAGE_TITLE_FORMAT_BLURB,
......@@ -326,6 +331,9 @@ gimp_display_config_set_property (GObject *object,
case PROP_CURSOR_UPDATING:
display_config->cursor_updating = g_value_get_boolean (value);
break;
case PROP_SHOW_BRUSH_OUTLINE:
display_config->show_brush_outline = g_value_get_boolean (value);
break;
case PROP_IMAGE_TITLE_FORMAT:
g_free (display_config->image_title_format);
display_config->image_title_format = g_value_dup_string (value);
......@@ -433,6 +441,9 @@ gimp_display_config_get_property (GObject *object,
case PROP_CURSOR_UPDATING:
g_value_set_boolean (value, display_config->cursor_updating);
break;
case PROP_SHOW_BRUSH_OUTLINE:
g_value_set_boolean (value, display_config->show_brush_outline);
break;
case PROP_IMAGE_TITLE_FORMAT:
g_value_set_string (value, display_config->image_title_format);
break;
......
......@@ -49,6 +49,7 @@ struct _GimpDisplayConfig
gboolean perfect_mouse;
GimpCursorMode cursor_mode;
gboolean cursor_updating;
gboolean show_brush_outline;
gchar *image_title_format;
gchar *image_status_format;
gboolean confirm_on_close;
......
......@@ -246,6 +246,10 @@ N_("Save the positions and sizes of the main dialogs when the GIMP exits.")
#define SCRIPT_FU_PATH_BLURB \
"This path will be searched for scripts when the Script-Fu plug-in is run."
#define SHOW_BRUSH_OUTLINE_BLURB \
N_("When enabled, all paint tools will show a preview of the current " \
"brush's outline.")
#define SHOW_MENUBAR_BLURB \
N_("When enabled, the menubar is visible by default. This can also be " \
"toggled with the \"View->Show Menubar\" command.")
......
......@@ -1426,6 +1426,9 @@ prefs_dialog_new (Gimp *gimp,
vbox2 = prefs_frame_new (_("Pointer Movement Feedback"),
GTK_CONTAINER (vbox), FALSE);
prefs_check_button_add (config, "show-brush-outline",
_("Show _Brush Outline"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "perfect-mouse",
_("Perfect-but-Slow _Pointer Tracking"),
GTK_BOX (vbox2));
......
......@@ -1426,6 +1426,9 @@ prefs_dialog_new (Gimp *gimp,
vbox2 = prefs_frame_new (_("Pointer Movement Feedback"),
GTK_CONTAINER (vbox), FALSE);
prefs_check_button_add (config, "show-brush-outline",
_("Show _Brush Outline"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "perfect-mouse",
_("Perfect-but-Slow _Pointer Tracking"),
GTK_BOX (vbox2));
......
......@@ -29,6 +29,8 @@
#include "tools-types.h"
#include "config/gimpdisplayconfig.h"
#include "core/gimp.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
......@@ -111,6 +113,10 @@ static void gimp_paint_tool_color_picked (GimpColorTool *color_tool,
GimpRGB *color,
gint color_index);
static void gimp_paint_tool_notify_brush (GimpDisplayConfig *config,
GParamSpec *pspec,
GimpPaintTool *paint_tool);
static GimpColorToolClass *parent_class = NULL;
......@@ -181,14 +187,16 @@ gimp_paint_tool_init (GimpPaintTool *paint_tool)
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
paint_tool->pick_colors = FALSE;
paint_tool->draw_line = FALSE;
paint_tool->draw_brush = TRUE;
paint_tool->pick_colors = FALSE;
paint_tool->draw_line = FALSE;
paint_tool->brush_x = 0.0;
paint_tool->brush_y = 0.0;
paint_tool->notify_connected = FALSE;
paint_tool->draw_brush = TRUE;
paint_tool->core = NULL;
paint_tool->brush_x = 0.0;
paint_tool->brush_y = 0.0;
paint_tool->core = NULL;
}
static void
......@@ -564,6 +572,19 @@ gimp_paint_tool_oper_update (GimpTool *tool,
return;
}
if (! paint_tool->notify_connected)
{
paint_tool->draw_brush =
GIMP_DISPLAY_CONFIG (tool->tool_info->gimp->config)->show_brush_outline;
g_signal_connect_object (tool->tool_info->gimp->config,
"notify::show-brush-outline",
G_CALLBACK (gimp_paint_tool_notify_brush),
paint_tool, 0);
paint_tool->notify_connected = TRUE;
}
core = paint_tool->core;
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
......@@ -812,3 +833,15 @@ gimp_paint_tool_color_picked (GimpColorTool *color_tool,
gimp_context_set_foreground (context, color);
}
}
static void
gimp_paint_tool_notify_brush (GimpDisplayConfig *config,
GParamSpec *pspec,
GimpPaintTool *paint_tool)
{
gimp_draw_tool_pause (GIMP_DRAW_TOOL (paint_tool));
paint_tool->draw_brush = config->show_brush_outline;
gimp_draw_tool_resume (GIMP_DRAW_TOOL (paint_tool));
}
......@@ -39,6 +39,8 @@ struct _GimpPaintTool
gboolean pick_colors; /* pick color if ctrl is pressed */
gboolean draw_line;
gboolean notify_connected;
gboolean draw_brush;
gdouble brush_x;
......
......@@ -29,6 +29,8 @@
#include "tools-types.h"
#include "config/gimpdisplayconfig.h"
#include "core/gimp.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
......@@ -111,6 +113,10 @@ static void gimp_paint_tool_color_picked (GimpColorTool *color_tool,
GimpRGB *color,
gint color_index);
static void gimp_paint_tool_notify_brush (GimpDisplayConfig *config,
GParamSpec *pspec,
GimpPaintTool *paint_tool);
static GimpColorToolClass *parent_class = NULL;
......@@ -181,14 +187,16 @@ gimp_paint_tool_init (GimpPaintTool *paint_tool)
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
paint_tool->pick_colors = FALSE;
paint_tool->draw_line = FALSE;
paint_tool->draw_brush = TRUE;
paint_tool->pick_colors = FALSE;
paint_tool->draw_line = FALSE;
paint_tool->brush_x = 0.0;
paint_tool->brush_y = 0.0;
paint_tool->notify_connected = FALSE;
paint_tool->draw_brush = TRUE;
paint_tool->core = NULL;
paint_tool->brush_x = 0.0;
paint_tool->brush_y = 0.0;
paint_tool->core = NULL;
}
static void
......@@ -564,6 +572,19 @@ gimp_paint_tool_oper_update (GimpTool *tool,
return;
}
if (! paint_tool->notify_connected)
{
paint_tool->draw_brush =
GIMP_DISPLAY_CONFIG (tool->tool_info->gimp->config)->show_brush_outline;
g_signal_connect_object (tool->tool_info->gimp->config,
"notify::show-brush-outline",
G_CALLBACK (gimp_paint_tool_notify_brush),
paint_tool, 0);
paint_tool->notify_connected = TRUE;
}
core = paint_tool->core;
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
......@@ -812,3 +833,15 @@ gimp_paint_tool_color_picked (GimpColorTool *color_tool,
gimp_context_set_foreground (context, color);
}
}
static void
gimp_paint_tool_notify_brush (GimpDisplayConfig *config,
GParamSpec *pspec,
GimpPaintTool *paint_tool)
{
gimp_draw_tool_pause (GIMP_DRAW_TOOL (paint_tool));
paint_tool->draw_brush = config->show_brush_outline;
gimp_draw_tool_resume (GIMP_DRAW_TOOL (paint_tool));
}
......@@ -39,6 +39,8 @@ struct _GimpPaintTool
gboolean pick_colors; /* pick color if ctrl is pressed */
gboolean draw_line;
gboolean notify_connected;
gboolean draw_brush;
gdouble brush_x;
......
Markdown is supported
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