DND cleanup part 1:
2002-09-02 Michael Natterer <mitch@gimp.org> DND cleanup part 1: * app/widgets/gimpdnd.[ch]: changed all gimp_dnd_*_dest_set() and _unset() functions to _dest_add() and _dest_remove(). Switch from using static arrays of GtkTargetEntries to dynamic GtkTargetLists. The _add() and _remove() functions configure the drag dest automatically if not already done, so there is no need to call gtk_drag_dest_set() on the widget any more. Drag source cleanup will follow... Renamed silly function names gimp_gtk_* to gimp_dnd_* * app/display/gimpdisplayshell.c * app/tools/gimpblendtool.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcontainerview.c * app/widgets/gimpgradienteditor.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c * app/widgets/gimppreview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimpselectioneditor.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/gui/about-dialog.c * app/gui/color-select.c * app/gui/device-status-dialog.c * app/gui/tool-options-dialog.c: changed accordingly. Removed all calls to gtk_drag_dest_set() and their GtkTargetEntry tables. * app/widgets/gimpchannellistitem.c: enabled some commented out dnd code (which will not work since dnd needs more love...) * app/widgets/gimpitemlistview.[ch]: added a third "gboolean interactive" parameter to GimpItemNewFunc. * app/gui/channels-commands.[ch] * app/gui/layers-commands.[ch] * app/gui/vectors-commands.[ch]: if the new_item_func is called with "interactive == FALSE", don't pop up a dialog but silently create a new item of the image's size. * app/widgets/gimpdrawablelistview.c: use the new feature to allow color and pattern drops to the "New" button, which creates a new layer/channel filled with the color/pattern. (special feature for drc ;-) * app/widgets/gimppaletteeditor.c: fixed event handling so we see the context menu again. Also, don't redraw on "expose", since GtkPreview does that for us.
This commit is contained in:
committed by
Michael Natterer
parent
e6a9cc4de1
commit
c5d4b7020b
@ -350,11 +350,7 @@ gimp_item_list_view_new (gint preview_size,
|
||||
/* connect "drop to new" manually as it makes a difference whether
|
||||
* it was clicked or dropped
|
||||
*/
|
||||
gimp_gtk_drag_dest_set_by_type (list_view->new_button,
|
||||
GTK_DEST_DEFAULT_ALL,
|
||||
item_type,
|
||||
GDK_ACTION_COPY);
|
||||
gimp_dnd_viewable_dest_set (list_view->new_button,
|
||||
gimp_dnd_viewable_dest_add (list_view->new_button,
|
||||
item_type,
|
||||
gimp_item_list_view_new_dropped,
|
||||
view);
|
||||
@ -540,7 +536,7 @@ static void
|
||||
gimp_item_list_view_new_clicked (GtkWidget *widget,
|
||||
GimpItemListView *view)
|
||||
{
|
||||
view->new_item_func (view->gimage, NULL);
|
||||
view->new_item_func (view->gimage, NULL, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -555,7 +551,9 @@ gimp_item_list_view_new_dropped (GtkWidget *widget,
|
||||
if (viewable && gimp_container_have (GIMP_CONTAINER_VIEW (view)->container,
|
||||
GIMP_OBJECT (viewable)))
|
||||
{
|
||||
view->new_item_func (view->gimage, viewable);
|
||||
view->new_item_func (view->gimage, viewable, FALSE);
|
||||
|
||||
gimp_image_flush (view->gimage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user