diff options
| author | Christian Dywan <christian@twotoasts.de> | 2018-09-05 10:52:47 +0200 |
|---|---|---|
| committer | Christian Dywan <christian@twotoasts.de> | 2018-09-05 11:08:04 +0200 |
| commit | 1b2cc6d960cd8f941fb1882f730560f22ff9a864 (patch) | |
| tree | 780f634536e52020f50782767f87d5305402405c | |
| parent | 76f9abf9fd257ddc7b83a18dc80b98735c24b13a (diff) | |
| download | midori-git-dont-reset-secure-but-icon.tar.gz | |
Don't reset Urlbar.secure on uri changedont-reset-secure-but-icon
Update the icon instead so the caller doesn't have to know
in what order state is updated.
| -rw-r--r-- | core/urlbar.vala | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/core/urlbar.vala b/core/urlbar.vala index 7f54cb88..3a211d27 100644 --- a/core/urlbar.vala +++ b/core/urlbar.vala @@ -23,17 +23,12 @@ namespace Midori { location = value; // Treat about:blank specially text = blank ? "" : value; - secure = false; + update_icon (); } } bool _secure = false; public bool secure { get { return _secure; } set { _secure = value; - if (blank) { - primary_icon_name = null; - } else { - primary_icon_name = value ? "channel-secure-symbolic" : "channel-insecure-symbolic"; - } - primary_icon_activatable = !blank; + update_icon (); } } bool blank { get { return uri == "about:blank" || uri == "internal:speed-dial"; } } @@ -291,6 +286,15 @@ namespace Midori { suggestions.grab_focus (); } + void update_icon () { + if (blank) { + primary_icon_name = null; + } else { + primary_icon_name = secure ? "channel-secure-symbolic" : "channel-insecure-symbolic"; + } + primary_icon_activatable = !blank; + } + void icon_pressed (Gtk.EntryIconPosition position, Gdk.Event event) { TlsCertificate tls; TlsCertificateFlags flags; |
