[epiphany/overview: 18/30] ephy-location-controller: add a boolean "show-icon" property



commit 9aca3eb717a36b1faff38910846f4376572f3338
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Wed May 9 18:22:40 2012 +0300

    ephy-location-controller: add a boolean "show-icon" property
    
    When the overview is visible, we don't need to show the favicon

 src/ephy-location-controller.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/src/ephy-location-controller.c b/src/ephy-location-controller.c
index 1127055..a35be8b 100644
--- a/src/ephy-location-controller.c
+++ b/src/ephy-location-controller.c
@@ -54,6 +54,7 @@ struct _EphyLocationControllerPrivate
 	GdkPixbuf *icon;
 	char *lock_stock_id;
 	guint editable : 1;
+	guint show_icon : 1;
 	guint show_lock : 1;
 	gboolean sync_address_is_blocked;
 };
@@ -73,6 +74,7 @@ enum
 	PROP_ADDRESS,
 	PROP_EDITABLE,
 	PROP_ICON,
+	PROP_SHOW_ICON,
 	PROP_LOCK_STOCK,
 	PROP_SHOW_LOCK,
 	PROP_WINDOW,
@@ -242,6 +244,17 @@ sync_icon (EphyLocationController *controller,
 }
 
 static void
+sync_show_icon (EphyLocationController *controller,
+		GParamSpec *pspec,
+		GtkWidget *widget)
+{
+	EphyLocationControllerPrivate *priv = controller->priv;
+	EphyLocationEntry *entry = EPHY_LOCATION_ENTRY (widget);
+
+	ephy_location_entry_set_show_favicon (entry, priv->show_icon);
+}
+
+static void
 sync_lock_stock_id (EphyLocationController *controller,
 		    GParamSpec *pspec,
 		    GtkWidget *widget)
@@ -422,6 +435,9 @@ ephy_location_controller_constructed (GObject *object)
 	sync_icon (controller, NULL, widget);
 	g_signal_connect_object (controller, "notify::icon",
 				 G_CALLBACK (sync_icon), widget, 0);
+	sync_show_icon (controller, NULL, widget);
+	g_signal_connect_object (controller, "notify::show-icon",
+				 G_CALLBACK (sync_show_icon), widget, 0);
 	sync_lock_stock_id (controller, NULL, widget);
 	g_signal_connect_object (controller, "notify::lock-stock-id",
 				 G_CALLBACK (sync_lock_stock_id), widget, 0);
@@ -470,6 +486,9 @@ ephy_location_controller_set_property (GObject *object,
 			}
 			priv->icon = GDK_PIXBUF (g_value_dup_object (value));
 			break;
+		case PROP_SHOW_ICON:
+			priv->show_icon = g_value_get_boolean (value);
+			break;
 		case PROP_LOCK_STOCK:
 			g_free (priv->lock_stock_id);
 			priv->lock_stock_id = g_value_dup_string (value);
@@ -612,6 +631,19 @@ ephy_location_controller_class_init (EphyLocationControllerClass *class)
 							      G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
 
 	/**
+	* EphyLocationController:show-icon:
+	*
+	* If we should show the page icon.
+	*/
+	g_object_class_install_property (object_class,
+					 PROP_SHOW_ICON,
+					 g_param_spec_boolean ("show-icon",
+							       "Show Icon",
+							       "If we should show the favicon",
+							       TRUE,
+							       G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+
+	/**
 	* EphyLocationController:lock-stock-id:
 	*
 	* Stock id of the security icon.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]