diff options
author | Xan Lopez <xan@src.gnome.org> | 2009-02-23 00:31:03 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2009-02-23 00:31:03 +0800 |
commit | 94a0031fc35edf7ba35b153693eff03292ac776b (patch) | |
tree | cfab2854834c1420b4c9d7641ac16eed8efe504c /lib/widgets/ephy-location-entry.c | |
parent | 4258f8b222d90ade63d5dc545ebf52ce6fa208a5 (diff) | |
download | gsoc2013-epiphany-94a0031fc35edf7ba35b153693eff03292ac776b.tar.gz gsoc2013-epiphany-94a0031fc35edf7ba35b153693eff03292ac776b.tar.zst gsoc2013-epiphany-94a0031fc35edf7ba35b153693eff03292ac776b.zip |
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
Diffstat (limited to 'lib/widgets/ephy-location-entry.c')
-rw-r--r-- | lib/widgets/ephy-location-entry.c | 11 |
1 files changed, 8 insertions, 3 deletions
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); } /** |