Stig Bjørlykke wrote:
> On Wed, Nov 4, 2009 at 1:02 AM, <gerald@xxxxxxxxxxxxx> wrote:
>> Log:
>> Add the ability to push temporary (and highlighted) messages onto the
>> statusbar.
>
> Hi,
>
> I don't get a highlighted statusbar, tested on both Ubuntu 9.10 (GTK+
> 2.18.3) and OSX (GTK+ 2.18.2). Does anyone get this working?
It works here for GTK+ 2.16.6 / Windows 7, GTK+ 2.14.7 / OS X 10.4.11,
and GTK+ 2.12.9 / Ubuntu 8.04.3. Can you try the attached patch?
> Should we use yellow for warnings and red for errors?
Maybe. I assumed that if the message was important enough to color red
then it deserved a dialog. Do we have any error messages that belong in
the status bar?
Index: gtk/main_statusbar.c
===================================================================
--- gtk/main_statusbar.c (revision 30810)
+++ gtk/main_statusbar.c (working copy)
@@ -106,9 +106,11 @@
static void
statusbar_reset_colors(void)
{
+ GtkWidget *w = GTK_WIDGET_NO_WINDOW(info_bar) ? info_bar_event : info_bar;
/* Extra credit for adding a fade effect */
- gtk_widget_modify_text(info_bar, GTK_STATE_NORMAL, NULL);
- gtk_widget_modify_bg(info_bar_event, GTK_STATE_NORMAL, NULL);
+ gtk_widget_modify_text(w, GTK_STATE_NORMAL, NULL);
+ gtk_widget_modify_bg(w, GTK_STATE_NORMAL, NULL);
+ gtk_widget_modify_base(w, GTK_STATE_NORMAL, NULL);
}
/*
@@ -223,14 +225,16 @@
void
statusbar_push_temporary_msg(const gchar *msg)
{
+ GtkWidget *w = GTK_WIDGET_NO_WINDOW(info_bar) ? info_bar_event : info_bar;
guint msg_id;
GdkColor black = { 0, 0, 0, 0 };
GdkColor yellow = { 0, 0xFFFF, 0xFFFF, 0xAFFF };
msg_id = gtk_statusbar_push(GTK_STATUSBAR(info_bar), main_ctx, msg);
- gtk_widget_modify_text(info_bar, GTK_STATE_NORMAL, &black);
- gtk_widget_modify_bg(info_bar_event, GTK_STATE_NORMAL, &yellow);
-
+ gtk_widget_modify_text(w, GTK_STATE_NORMAL, &black);
+ gtk_widget_modify_bg(w, GTK_STATE_NORMAL, &yellow);
+ gtk_widget_modify_base(w, GTK_STATE_NORMAL, &yellow);
+
g_timeout_add(TEMPORARY_MSG_TIMEOUT, statusbar_remove_temporary_msg, GUINT_TO_POINTER(msg_id));
}