summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b8a8935)
raw | patch | inline | side by side (parent: b8a8935)
author | JucaBlues <JucaBlues@users.sourceforge.net> | |
Tue, 27 Jan 2009 21:05:05 +0000 (21:05 +0000) | ||
committer | JucaBlues <JucaBlues@users.sourceforge.net> | |
Tue, 27 Jan 2009 21:05:05 +0000 (21:05 +0000) |
src/dialogs/swatches.cpp | patch | blob | history | |
src/dialogs/swatches.h | patch | blob | history |
index 13c65f7075b59979216a1759389aa224ad97774a..1a0db9a8a1c0c571b9100c70824a2facf8b24bd4 100644 (file)
--- a/src/dialogs/swatches.cpp
+++ b/src/dialogs/swatches.cpp
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 cc0cf89561681ed8591774c0942e5a029bf53e50..00c73ff8497e2b5e1de7b1722a677eafa90f7f07 100644 (file)
--- a/src/dialogs/swatches.h
+++ b/src/dialogs/swatches.h
::PreviewSize size,
guint ratio);
void buttonClicked(bool secondary = false);
-
+ bool isRemove(){ return _isRemove; }
ColorDef def;
private: