[Xfce4-commits] <midori:master> Security with background color and secondary icon

Christian Dywan noreply at xfce.org
Wed Apr 21 02:50:01 CEST 2010


Updating branch refs/heads/master
         to 0d4b041de3bde92fdc1c05af938a9b822a41ee4a (commit)
       from aaf0d4b39574b24e5f9e7117ca511c23900d3d45 (commit)

commit 0d4b041de3bde92fdc1c05af938a9b822a41ee4a
Author: Christian Dywan <christian at twotoasts.de>
Date:   Tue Apr 20 23:32:28 2010 +0200

    Security with background color and secondary icon

 midori/midori-browser.c        |    5 +++--
 midori/midori-locationaction.c |   30 ++++++++++++++++++++++++------
 2 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 65647f0..e280c26 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -365,8 +365,6 @@ _midori_browser_update_interface (MidoriBrowser* browser)
     #endif
 
     action = _action_by_name (browser, "Location");
-    midori_location_action_set_security_hint (
-        MIDORI_LOCATION_ACTION (action), midori_view_get_security (view));
     if (g_object_get_data (G_OBJECT (view), "news-feeds"))
     {
         midori_location_action_set_secondary_icon (
@@ -379,6 +377,9 @@ _midori_browser_update_interface (MidoriBrowser* browser)
             MIDORI_LOCATION_ACTION (action), GTK_STOCK_JUMP_TO);
         gtk_action_set_sensitive (_action_by_name (browser, "AddNewsFeed"), FALSE);
     }
+    midori_location_action_set_security_hint (
+        MIDORI_LOCATION_ACTION (action), midori_view_get_security (view));
+
 }
 
 static void
diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c
index b4b1daf..9434e1c 100644
--- a/midori/midori-locationaction.c
+++ b/midori/midori-locationaction.c
@@ -1700,27 +1700,45 @@ void
 midori_location_action_set_security_hint (MidoriLocationAction* location_action,
                                           MidoriSecurity        hint)
 {
-    #if !HAVE_HILDON
     GSList* proxies;
     GtkWidget* entry;
     GtkWidget* child;
-    #endif
 
     g_return_if_fail (MIDORI_IS_LOCATION_ACTION (location_action));
 
-    #if !HAVE_HILDON
     proxies = gtk_action_get_proxies (GTK_ACTION (location_action));
 
     for (; proxies != NULL; proxies = g_slist_next (proxies))
     if (GTK_IS_TOOL_ITEM (proxies->data))
     {
+        GdkColor bg_color = { 0, 1 };
+        GdkColor fg_color = { 0, 1 };
+
         entry = midori_location_action_entry_for_proxy (proxies->data);
         child = gtk_bin_get_child (GTK_BIN (entry));
 
         if (hint == MIDORI_SECURITY_UNKNOWN)
-            gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (child), GTK_ICON_ENTRY_PRIMARY, GTK_STOCK_INFO);
+        {
+            gdk_color_parse ("#ef7070", &bg_color);
+            gdk_color_parse ("#000", &fg_color);
+            #if !HAVE_HILDON
+            gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (child),
+                GTK_ICON_ENTRY_SECONDARY, GTK_STOCK_INFO);
+            #endif
+        }
         else if (hint == MIDORI_SECURITY_TRUSTED)
-            gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (child), GTK_ICON_ENTRY_PRIMARY, "lock");
+        {
+            gdk_color_parse ("#fcf19a", &bg_color);
+            gdk_color_parse ("#000", &fg_color);
+            #if !HAVE_HILDON
+            gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (child),
+                GTK_ICON_ENTRY_SECONDARY, GTK_STOCK_DIALOG_AUTHENTICATION);
+            #endif
+        }
+
+        gtk_widget_modify_base (child, GTK_STATE_NORMAL,
+            bg_color.red == 1 ? NULL : &bg_color);
+        gtk_widget_modify_text (child, GTK_STATE_NORMAL,
+            bg_color.red == 1 ? NULL : &fg_color);
     }
-    #endif
 }



More information about the Xfce4-commits mailing list