From: johncoswell Date: Mon, 21 Apr 2008 22:26:43 +0000 (+0000) Subject: Show the name of the swatch that is currently under the pointer in the status bar... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f5ff1ea83a1f87881159bb0f7aa6e593f478c355;p=inkscape.git 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. --- 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 #include #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(callback_data); + if ( item ) { + SPDesktop *desktop = SP_ACTIVE_DESKTOP; + if ( desktop ) { + desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, g_strconcat( + _("Swatch info: "), + item->def.descr.c_str(), + _(""), + 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),