summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Dywan <christian@twotoasts.de>2018-09-06 20:22:18 +0200
committerGitHub <noreply@github.com>2018-09-06 20:22:18 +0200
commit73eaedf46c63d5845269e13c1310dade95caed52 (patch)
treefa58ee6c161041d7565c12f2ba578363534dff9e
parent3660540a1d1562a109848f5963cdb58c780ff395 (diff)
downloadmidori-git-73eaedf46c63d5845269e13c1310dade95caed52.tar.gz
Don't reset Urlbar.secure on uri change (#45)
Update the icon instead so the caller doesn't have to know in what order state is updated.
-rw-r--r--core/urlbar.vala18
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;