Commit 2a48c63e authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

setup the dnd stuff in GimpView::set_viewable() and remove GimpView's

2005-07-22  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimppaletteview.c: setup the dnd stuff in
	GimpView::set_viewable() and remove GimpView's automatically added
	GimpPalette drag source. Fixes color dragging (bug #113237).
parent 6a4b4544
2005-07-22 Michael Natterer <mitch@gimp.org>
* app/widgets/gimppaletteview.c: setup the dnd stuff in
GimpView::set_viewable() and remove GimpView's automatically added
GimpPalette drag source. Fixes color dragging (bug #113237).
2005-07-21 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimppreview.[ch]: added gimp_preview_get_area()
......
......@@ -187,13 +187,6 @@ gimp_palette_view_init (GimpPaletteView *view)
view->selected = NULL;
view->dnd_entry = NULL;
view->gc = NULL;
gimp_dnd_color_source_add (GTK_WIDGET (view),
gimp_palette_view_drag_color,
view);
gimp_dnd_color_dest_add (GTK_WIDGET (view),
gimp_palette_view_drop_color,
view);
}
static void
......@@ -300,17 +293,40 @@ gimp_palette_view_set_viewable (GimpView *view,
gimp_palette_view_select_entry (pal_view, NULL);
if (old_viewable)
g_signal_handlers_disconnect_by_func (old_viewable,
gimp_palette_view_invalidate,
view);
{
g_signal_handlers_disconnect_by_func (old_viewable,
gimp_palette_view_invalidate,
view);
if (! new_viewable)
{
gimp_dnd_color_source_remove (GTK_WIDGET (view));
gimp_dnd_color_dest_remove (GTK_WIDGET (view));
}
}
GIMP_VIEW_CLASS (parent_class)->set_viewable (view,
old_viewable, new_viewable);
if (new_viewable)
g_signal_connect (new_viewable, "invalidate-preview",
G_CALLBACK (gimp_palette_view_invalidate),
view);
{
g_signal_connect (new_viewable, "invalidate-preview",
G_CALLBACK (gimp_palette_view_invalidate),
view);
/* unset the palette drag handler set by GimpView */
gimp_dnd_viewable_source_remove (GTK_WIDGET (view), GIMP_TYPE_PALETTE);
if (! old_viewable)
{
gimp_dnd_color_source_add (GTK_WIDGET (view),
gimp_palette_view_drag_color,
view);
gimp_dnd_color_dest_add (GTK_WIDGET (view),
gimp_palette_view_drop_color,
view);
}
}
}
......
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