when dropping a color on a text layer, change the text color. This is a

2004-02-11  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell-dnd.c
	(gimp_display_shell_bucket_fill): when dropping a color on a text
	layer, change the text color. This is a quick hack; we should make
	filling a drawable a virtual method that can be overridden by the
	text layer.
This commit is contained in:
Sven Neumann
2004-02-11 21:42:22 +00:00
committed by Sven Neumann
parent b17955d2a1
commit b9f19e30a9
2 changed files with 32 additions and 7 deletions

View File

@ -1,3 +1,11 @@
2004-02-11 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-dnd.c
(gimp_display_shell_bucket_fill): when dropping a color on a text
layer, change the text color. This is a quick hack; we should make
filling a drawable a virtual method that can be overridden by the
text layer.
2004-02-11 Sven Neumann <sven@gimp.org>
* configure.in (GIMP_DESKTOP_ICON): fixed icon names.

View File

@ -33,6 +33,9 @@
#include "core/gimplayer.h"
#include "core/gimppattern.h"
#include "text/gimptext.h"
#include "text/gimptextlayer.h"
#include "vectors/gimpvectors.h"
#include "vectors/gimpvectors-import.h"
@ -166,6 +169,7 @@ gimp_display_shell_bucket_fill (GimpDisplayShell *shell,
{
GimpImage *gimage = shell->gdisp->gimage;
GimpDrawable *drawable;
GimpText *text;
if (gimage->gimp->busy)
return;
@ -175,14 +179,27 @@ gimp_display_shell_bucket_fill (GimpDisplayShell *shell,
if (! drawable)
return;
gimp_drawable_bucket_fill_full (drawable,
fill_mode,
GIMP_NORMAL_MODE, GIMP_OPACITY_OPAQUE,
FALSE /* no seed fill */,
FALSE, 0.0, FALSE, 0.0, 0.0 /* fill params */,
color, pattern);
/* FIXME: there should be a virtual method for this that the
GimpTextLayer can override. */
gimp_image_flush (gimage);
if (GIMP_IS_TEXT_LAYER (drawable) &&
(text = gimp_text_layer_get_text (GIMP_TEXT_LAYER (drawable))) != NULL)
{
g_object_set (text, "color", color, NULL);
gimp_text_layer_flush (GIMP_TEXT_LAYER (drawable));
}
else
{
gimp_drawable_bucket_fill_full (drawable,
fill_mode,
GIMP_NORMAL_MODE, GIMP_OPACITY_OPAQUE,
FALSE, /* no seed fill */
FALSE, 0.0, FALSE, /* fill params */
0.0, 0.0, /* ignored */
color, pattern);
gimp_image_flush (gimage);
}
gimp_context_set_display (gimp_get_user_context (gimage->gimp),
shell->gdisp);