]> spindle.queued.net Git - midori/commitdiff
Security with background color and secondary icon
authorChristian Dywan <christian@twotoasts.de>
Tue, 20 Apr 2010 21:32:28 +0000 (23:32 +0200)
committerChristian Dywan <christian@twotoasts.de>
Wed, 21 Apr 2010 00:47:21 +0000 (02:47 +0200)
midori/midori-browser.c
midori/midori-locationaction.c

index 65647f0f34b2e95fd3b8469854c811fcd6aa851d..e280c263d7a68047eabd8d680af8a5cf921c7ea3 100644 (file)
@@ -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
index b4b1dafe9f1d5c2718318ee0e98f4458adc1bbd1..9434e1cd58ff44fca83a2dc59c4527f771f94bd5 100644 (file)
@@ -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
 }