From 284a977eafe471f7be66997eabb94b5d9549535e Mon Sep 17 00:00:00 2001 From: johncoswell Date: Tue, 22 Apr 2008 23:09:01 +0000 Subject: [PATCH] Keep swatch status messages visible while hovering --- src/dialogs/swatches.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/dialogs/swatches.cpp b/src/dialogs/swatches.cpp index 3b62f0186..667149916 100644 --- a/src/dialogs/swatches.cpp +++ b/src/dialogs/swatches.cpp @@ -26,7 +26,7 @@ #include #include "inkscape.h" #include "desktop.h" -#include "message-stack.h" +#include "message-context.h" #include "document.h" #include "desktop-handles.h" #include "extension/db.h" @@ -245,10 +245,12 @@ static gboolean handleEnterNotify( GtkWidget* widget, GdkEventCrossing* event, g if ( item ) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; if ( desktop ) { - desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, g_strconcat( + desktop->tipsMessageContext()->set(Inkscape::INFORMATION_MESSAGE, g_strconcat( _("Swatch info: "), item->def.descr.c_str(), _(""), + _(" - "), + _("Click to set fill, Shift+click to set stroke"), NULL )); } @@ -256,6 +258,17 @@ static gboolean handleEnterNotify( GtkWidget* widget, GdkEventCrossing* event, g return FALSE; } +static gboolean handleLeaveNotify( GtkWidget* widget, GdkEventCrossing* event, gpointer callback_data ) { + ColorItem* item = reinterpret_cast(callback_data); + if ( item ) { + SPDesktop *desktop = SP_ACTIVE_DESKTOP; + if ( desktop ) { + desktop->tipsMessageContext()->clear(); + } + } + return FALSE; +} + static GtkWidget* popupMenu = 0; static ColorItem* bounceTarget = 0; @@ -610,6 +623,11 @@ Gtk::Widget* ColorItem::getPreview(PreviewStyle style, ViewType view, ::PreviewS G_CALLBACK(handleEnterNotify), this); + g_signal_connect( G_OBJECT(newBlot->gobj()), + "leave-notify-event", + G_CALLBACK(handleLeaveNotify), + this); + // g_signal_connect( G_OBJECT(newBlot->gobj()), // "drag-drop", // G_CALLBACK(dragDropColorData), -- 2.30.2