From d4a5cbb369726a68a4de3de14ea0884644f23e8d Mon Sep 17 00:00:00 2001 From: buliabyak Date: Wed, 17 Jan 2007 22:53:02 +0000 Subject: [PATCH] add new message type for urgent immediate statusbar display --- src/message-stack.cpp | 3 +++ src/message.h | 1 + src/widgets/desktop-widget.cpp | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/src/message-stack.cpp b/src/message-stack.cpp index ae65e3421..877d8edeb 100644 --- a/src/message-stack.cpp +++ b/src/message-stack.cpp @@ -70,6 +70,9 @@ MessageId MessageStack::flash(MessageType type, gchar const *message) { case WARNING_MESSAGE: // a bit less important than error return _push(type, 2000 + 40*strlen(message), message); break; + case IMMEDIATE_MESSAGE: // same length as normal, higher priority + return _push(type, 1000 + 20*strlen(message), message); + break; case NORMAL_MESSAGE: // something ephemeral default: return _push(type, 1000 + 20*strlen(message), message); diff --git a/src/message.h b/src/message.h index 24a61fea7..b9b38b613 100644 --- a/src/message.h +++ b/src/message.h @@ -21,6 +21,7 @@ namespace Inkscape { */ enum MessageType { NORMAL_MESSAGE, + IMMEDIATE_MESSAGE, WARNING_MESSAGE, ERROR_MESSAGE, INFORMATION_MESSAGE diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index f91fc3b81..d7e5891c6 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -105,6 +105,13 @@ SPDesktopWidget::setMessage (Inkscape::MessageType type, const gchar *message) { GtkLabel *sb=GTK_LABEL(this->select_status); gtk_label_set_markup (sb, message ? message : ""); + + // make sure the important messages are displayed immediately! + if (type == Inkscape::IMMEDIATE_MESSAGE && GTK_WIDGET_DRAWABLE (GTK_WIDGET(sb))) { + gtk_widget_queue_draw(GTK_WIDGET(sb)); + gdk_window_process_updates(GTK_WIDGET(sb)->window, TRUE); + } + // FIXME: TODO: remove before displaying as tooltip gtk_tooltips_set_tip (this->tt, this->select_status_eventbox, message ? message : "", NULL); } -- 2.30.2