Author: post
Date: 2011-11-24 16:48:07 +0100 (Thu, 24 Nov 2011)
New Revision: 4059

Modified:
   trunk/src/gtk-interface.c
Log:
Check if GTK version is older than 2.20 and enable another error notification 
(blinking text instead of blinking background).

Modified: trunk/src/gtk-interface.c
===================================================================
--- trunk/src/gtk-interface.c   2011-11-20 21:18:33 UTC (rev 4058)
+++ trunk/src/gtk-interface.c   2011-11-24 15:48:07 UTC (rev 4059)
@@ -122,7 +122,6 @@
 static gboolean
 gui_statusbar_blink_helper(guint *msgid)
 {
-       const static GdkColor red = {0, 0xffff, 0x6666, 0x6666 };
        gdk_threads_enter();
        if (msgid[1] == 0)
        {
@@ -133,10 +132,23 @@
        }
        else
        {
+#if GTK_CHECK_VERSION(2,20,0)
+               const static GdkColor red = {0, 0xffff, 0x2222, 0x2222 };
                if ((msgid[1] & 1) == 0)
                        
gtk_widget_modify_bg(gtk_statusbar_get_message_area(statusbar)->parent, 
GTK_STATE_NORMAL, &red);
                else
                        
gtk_widget_modify_bg(gtk_statusbar_get_message_area(statusbar)->parent, 
GTK_STATE_NORMAL, NULL);
+#else
+               if (msgid[2] == 0)
+               {
+                       msgid[2] = gui_status_push("");
+               }
+               else
+               {
+                       gui_status_pop(msgid[2]);
+                       msgid[2] = 0;
+               }
+#endif
                g_timeout_add(500, (GSourceFunc) gui_statusbar_blink_helper, 
msgid);
                msgid[1] --;
        }
@@ -162,9 +174,10 @@
 {
        guint *msgid;
        blinking_error = TRUE;
-       msgid = g_new(guint, 2);
+       msgid = g_new(guint, 3);
        *msgid = gtk_statusbar_push(statusbar, 
gtk_statusbar_get_context_id(statusbar, "generic"), text);
        msgid[1] = 10;
+       msgid[2] = 0;
        g_timeout_add(500, (GSourceFunc) gui_statusbar_blink_helper, msgid);
        return;
 }


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to