diff options
| author | Felipe Corr??a da Silva Sanches <juca@members.fsf.org> | 2009-01-27 21:05:05 +0000 |
|---|---|---|
| committer | JucaBlues <JucaBlues@users.sourceforge.net> | 2009-01-27 21:05:05 +0000 |
| commit | fb3052fbd66ff1a9dd232967735303c7aae086d0 (patch) | |
| tree | 87dbaacbe43614d0d036cb1ea5c70bad67a4a27f /src | |
| parent | simplify sketch result to fix crash (diff) | |
| download | inkscape-fb3052fbd66ff1a9dd232967735303c7aae086d0.tar.gz inkscape-fb3052fbd66ff1a9dd232967735303c7aae086d0.zip | |
draw red X icon while dragging the "remove color" item
(bzr r7192)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dialogs/swatches.cpp | 17 | ||||
| -rw-r--r-- | src/dialogs/swatches.h | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/dialogs/swatches.cpp b/src/dialogs/swatches.cpp index 13c65f707..1a0db9a8a 100644 --- a/src/dialogs/swatches.cpp +++ b/src/dialogs/swatches.cpp @@ -198,6 +198,23 @@ static void dragBegin( GtkWidget *widget, GdkDragContext* dc, gpointer data ) ColorItem* item = reinterpret_cast<ColorItem*>(data); if ( item ) { + if (item->isRemove()){ + GError *error = NULL; + gchar *filepath = (gchar *) g_strdup_printf("%s/remove-color.png", INKSCAPE_PIXMAPDIR); + gsize bytesRead = 0; + gsize bytesWritten = 0; + gchar *localFilename = g_filename_from_utf8( filepath, + -1, + &bytesRead, + &bytesWritten, + &error); + GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file_at_scale(localFilename, 32, 24, FALSE, &error); + g_free(localFilename); + g_free(filepath); + gtk_drag_set_icon_pixbuf( dc, pixbuf, 0, 0 ); + return; + } + Glib::RefPtr<Gdk::Pixbuf> thumb = Gdk::Pixbuf::create( Gdk::COLORSPACE_RGB, false, 8, 32, 24 ); guint32 fillWith = (0xff000000 & (item->def.getR() << 24)) | (0x00ff0000 & (item->def.getG() << 16)) diff --git a/src/dialogs/swatches.h b/src/dialogs/swatches.h index cc0cf8956..00c73ff84 100644 --- a/src/dialogs/swatches.h +++ b/src/dialogs/swatches.h @@ -44,7 +44,7 @@ public: ::PreviewSize size, guint ratio); void buttonClicked(bool secondary = false); - + bool isRemove(){ return _isRemove; } ColorDef def; private: |
