Bug 480953 - Identity button should appear pressed when opening the identity popup. r=gavin
authorDão Gottwald <dao@mozilla.com>
Mon, 02 Mar 2009 21:01:03 +0100
changeset 24045 86b0c8a3a9f1597e8d469c96129d70a009dc814b
parent 24044 2f46ff61816d4ab8afca66eb10584c01ea77602c
child 24046 d9ad53ed0e5890971d2f6df6c48695f81f3c21e0
push id1042
push userdgottwald@mozilla.com
push dateTue, 31 Mar 2009 18:16:24 +0000
reviewersgavin
bugs480953
milestone1.9.1b4pre
Bug 480953 - Identity button should appear pressed when opening the identity popup. r=gavin
browser/base/content/browser.js
browser/themes/pinstripe/browser/browser.css
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6714,16 +6714,24 @@ var gIdentityHandler = {
     this.setPopupMessages(this._identityBox.className);
     
     // Make sure the identity popup hangs toward the middle of the location bar
     // in RTL builds
     var position = 'after_start';
     if (gURLBar.getAttribute("chromedir") == "rtl")
       position = 'after_end';
 
+    // Add the "open" attribute to the identity box for styling
+    this._identityBox.setAttribute("open", "true");
+    var self = this;
+    this._identityPopup.addEventListener("popuphidden", function (e) {
+      e.currentTarget.removeEventListener("popuphidden", arguments.callee, false);
+      self._identityBox.removeAttribute("open");
+    }, false);
+
     // Now open the popup, anchored off the primary chrome element
     this._identityPopup.openPopup(this._identityBox, position);
   }
 };
 
 let DownloadMonitorPanel = {
   //////////////////////////////////////////////////////////////////////////////
   //// DownloadMonitorPanel Member Variables
--- a/browser/themes/pinstripe/browser/browser.css
+++ b/browser/themes/pinstripe/browser/browser.css
@@ -889,21 +889,16 @@ toolbar[iconsize="small"] #unified-back-
   opacity: 0.5;
 }
 
 #urlbar-throbber {
   list-style-image: url("chrome://browser/skin/places/searching_16.png");
 }
 
 
-#identity-box:active > #page-proxy-stack,
-#identity-box[open="true"] > #page-proxy-stack {
-  opacity: 0.75;
-}
-
 statusbarpanel#statusbar-display {
   -moz-padding-start: 0;
 }
 
 .statusbarpanel-text {
   margin-top: 2px;
   margin-bottom: 0;
 }
@@ -1931,26 +1926,29 @@ tabpanels.plain {
   -moz-box-pack: center;
 }
 
 #identity-box.verifiedDomain > hbox > #identity-icon-label {
   background: url("chrome://browser/skin/urlbar/startcap-secure-end.png") no-repeat center right;
 }
 
 /* - Active state */
+#identity-box.verifiedDomain[open="true"],
 #identity-box.verifiedDomain:hover:active {
   background-image: url("chrome://browser/skin/urlbar/startcap-secure-start-active.png");
 }
 
+#identity-box.verifiedDomain[open="true"] > hbox,
 #identity-box.verifiedDomain:hover:active > hbox {
   padding: 0;
   background: url("chrome://browser/skin/urlbar/startcap-secure-mid-active.png") repeat-x center center;
   -moz-box-pack: center;
 }
 
+#identity-box.verifiedDomain[open="true"] > hbox > #identity-icon-label,
 #identity-box.verifiedDomain:hover:active > hbox > #identity-icon-label {
   background: url("chrome://browser/skin/urlbar/startcap-secure-end-active.png") no-repeat center right;
 }
 
 /* - Focus state */
 #urlbar[focused="true"] > #identity-box.verifiedDomain {
   background-image: url("chrome://browser/skin/urlbar/startcap-secure-start-focused.png");
 }
@@ -1982,24 +1980,27 @@ tabpanels.plain {
   -moz-box-pack: center;
 }
 
 #identity-box.verifiedIdentity > hbox > #identity-icon-label {
   background: url("chrome://browser/skin/urlbar/startcap-verified-end.png") no-repeat center right;
 }
 
 /* - Active state */
+#identity-box.verifiedIdentity[open="true"],
 #identity-box.verifiedIdentity:hover:active {
   background-image: url("chrome://browser/skin/urlbar/startcap-verified-start-active.png");
 }
 
+#identity-box.verifiedIdentity[open="true"] > hbox,
 #identity-box.verifiedIdentity:hover:active > hbox {
   background: url("chrome://browser/skin/urlbar/startcap-verified-mid-active.png") repeat-x center center;
 }
 
+#identity-box.verifiedIdentity[open="true"] > hbox > #identity-icon-label,
 #identity-box.verifiedIdentity:hover:active > hbox > #identity-icon-label {
   background: url("chrome://browser/skin/urlbar/startcap-verified-end-active.png") no-repeat center right;
 }
 
 /* - Focus state */
 #urlbar[focused="true"] > #identity-box.verifiedIdentity {
   background-image: url("chrome://browser/skin/urlbar/startcap-verified-start-focused.png");
 }