summaryrefslogtreecommitdiffstats
path: root/src/dialogs/swatches.cpp
diff options
context:
space:
mode:
authorJohn Bintz <me@johnbintz.com>2008-04-21 22:26:43 +0000
committerjohncoswell <johncoswell@users.sourceforge.net>2008-04-21 22:26:43 +0000
commit3ff99201b3f9236b0020bcf7073d9c7dce1a7109 (patch)
treed2db7876618b8426f35602b0d3047cc6f1b5bbb3 /src/dialogs/swatches.cpp
parentUpdated for 32/64 (diff)
downloadinkscape-3ff99201b3f9236b0020bcf7073d9c7dce1a7109.tar.gz
inkscape-3ff99201b3f9236b0020bcf7073d9c7dce1a7109.zip
Show the name of the swatch that is currently under the pointer in the status bar, making it easier to identify a swatch when using a tablet.
(bzr r5482)
Diffstat (limited to 'src/dialogs/swatches.cpp')
-rw-r--r--src/dialogs/swatches.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/dialogs/swatches.cpp b/src/dialogs/swatches.cpp
index ea89be30f..72a85a43b 100644
--- a/src/dialogs/swatches.cpp
+++ b/src/dialogs/swatches.cpp
@@ -3,8 +3,10 @@
*
* Authors:
* Jon A. Cruz
+ * John Bintz
*
* Copyright (C) 2005 Jon A. Cruz
+ * Copyright (C) 2008 John Bintz
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
@@ -23,6 +25,8 @@
#include <glibmm/i18n.h>
#include <gdkmm/pixbuf.h>
#include "inkscape.h"
+#include "desktop.h"
+#include "message-stack.h"
#include "document.h"
#include "desktop-handles.h"
#include "extension/db.h"
@@ -236,6 +240,21 @@ static void handleSecondaryClick( GtkWidget* widget, gint arg1, gpointer callbac
}
}
+static void handleEnterNotify( GtkWidget* widget, GdkEventCrossing* event, gpointer callback_data ) {
+ ColorItem* item = reinterpret_cast<ColorItem*>(callback_data);
+ if ( item ) {
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ if ( desktop ) {
+ desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, g_strconcat(
+ _("Swatch info: <b>"),
+ item->def.descr.c_str(),
+ _("</b>"),
+ NULL
+ ));
+ }
+ }
+}
+
static GtkWidget* popupMenu = 0;
static ColorItem* bounceTarget = 0;
@@ -585,6 +604,11 @@ Gtk::Widget* ColorItem::getPreview(PreviewStyle style, ViewType view, ::PreviewS
G_CALLBACK(dragBegin),
this );
+ g_signal_connect( G_OBJECT(newBlot->gobj()),
+ "enter-notify-event",
+ G_CALLBACK(handleEnterNotify),
+ this);
+
// g_signal_connect( G_OBJECT(newBlot->gobj()),
// "drag-drop",
// G_CALLBACK(dragDropColorData),