From 94a0031fc35edf7ba35b153693eff03292ac776b Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Sun, 22 Feb 2009 16:31:03 +0000 Subject: ephy-location-entry: fix security icon visibility. GtkEntry has no distinction between the visibility of the icons and the icon to be used, meaning that the way to make them invisible is to unset them. Keep a private boolean with the visibility status so we can update our icon type without altering its visibility. svn path=/trunk/; revision=8802 --- lib/widgets/ephy-location-entry.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c index d8df730af..422de48b9 100644 --- a/lib/widgets/ephy-location-entry.c +++ b/lib/widgets/ephy-location-entry.c @@ -71,6 +71,7 @@ struct _EphyLocationEntryPrivate guint secure : 1; guint apply_colours : 1; guint needs_reset : 1; + guint show_lock : 1; }; static const GtkTargetEntry url_drag_types [] = @@ -975,6 +976,7 @@ ephy_location_entry_init (EphyLocationEntry *le) p->block_update = FALSE; p->saved_text = NULL; p->search_terms = NULL; + p->show_lock = FALSE; ephy_location_entry_construct_contents (le); @@ -1576,6 +1578,8 @@ ephy_location_entry_set_show_lock (EphyLocationEntry *entry, priv = entry->priv; + priv->show_lock = show_lock != FALSE; + gtk_entry_set_icon_from_stock (GTK_ENTRY (priv->entry), GTK_ENTRY_ICON_SECONDARY, show_lock ? priv->lock_stock_id : NULL); @@ -1599,9 +1603,10 @@ ephy_location_entry_set_lock_stock (EphyLocationEntry *entry, entry->priv->lock_stock_id = (char*)stock_id; - gtk_entry_set_icon_from_stock (GTK_ENTRY (entry->priv->entry), - GTK_ENTRY_ICON_SECONDARY, - stock_id); + if (entry->priv->show_lock) + gtk_entry_set_icon_from_stock (GTK_ENTRY (entry->priv->entry), + GTK_ENTRY_ICON_SECONDARY, + stock_id); } /** -- cgit v1.2.3