Bug 518859 - Lightweight theme not applied to titlebar. r=enn
authorDão Gottwald <dao@mozilla.com>
Thu, 01 Oct 2009 20:57:37 +0200
changeset 33347 24d3ef55e542d81ce6c2c6eeef6169012966ac0b
parent 33346 8a43f01f1d6478ad072c1f4a41fb633f8a5e3a32
child 33348 59a6c227df8638124dbf0050790984b3dc0b5857
push idunknown
push userunknown
push dateunknown
reviewersenn
bugs518859
milestone1.9.3a1pre
Bug 518859 - Lightweight theme not applied to titlebar. r=enn
toolkit/content/LightweightThemeConsumer.jsm
toolkit/themes/pinstripe/global/globalBindings.xml
toolkit/themes/pinstripe/global/jar.mn
--- a/toolkit/content/LightweightThemeConsumer.jsm
+++ b/toolkit/content/LightweightThemeConsumer.jsm
@@ -91,27 +91,24 @@ LightweightThemeConsumer.prototype = {
       let footer = this._doc.getElementById(this._footerId);
       _setImage(footer, active, aData.footerURL);
       if (active && aData.footerURL)
         footer.setAttribute("lwthemefooter", "true");
       else
         footer.removeAttribute("lwthemefooter");
     }
 
-    if (root.hasAttribute("activetitlebarcolor")) {
-      if (!root.hasAttribute("originalactivetitlebarcolor")) {
-        root.setAttribute("originalactivetitlebarcolor",
-                          root.getAttribute("activetitlebarcolor"));
-        root.setAttribute("originalinactivetitlebarcolor",
-                          root.getAttribute("inactivetitlebarcolor"));
+    if (/^Mac/.test(this._doc.defaultView.navigator.platform)) {
+      if (active && aData.accentcolor) {
+        root.setAttribute("activetitlebarcolor", aData.accentcolor);
+        root.setAttribute("inactivetitlebarcolor", aData.accentcolor);
+      } else {
+        root.removeAttribute("activetitlebarcolor");
+        root.removeAttribute("inactivetitlebarcolor");
       }
-      root.setAttribute("activetitlebarcolor", (active && aData.accentcolor)
-                          || root.getAttribute("originalactivetitlebarcolor"));
-      root.setAttribute("inactivetitlebarcolor", (active && aData.accentcolor)
-                          || root.getAttribute("originalinactivetitlebarcolor"));
     }
   }
 }
 
 function _setImage(aElement, aActive, aURL) {
   aElement.style.backgroundImage =
     (aActive && aURL) ? 'url("' + aURL.replace('"', '\\"', "g") + '")' : "";
 }
deleted file mode 100644
--- a/toolkit/themes/pinstripe/global/globalBindings.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE bindings SYSTEM "chrome://global/locale/preferences.dtd">
-
-<bindings id="globalBindings"
-          xmlns="http://www.mozilla.org/xbl"
-          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-          xmlns:xbl="http://www.mozilla.org/xbl">
-  <binding id="unifiedWindow"
-           extends="chrome://global/content/bindings/general.xml#root-element">
-    <content activetitlebarcolor="#C9C9C9" inactivetitlebarcolor="#E4E4E4"/>
-  </binding>
-
-  <binding id="unifiedDialog"
-           extends="chrome://global/content/bindings/dialog.xml#dialog">
-    <content activetitlebarcolor="#C9C9C9" inactivetitlebarcolor="#E4E4E4">
-      <xul:vbox class="box-inherit dialog-content-box" flex="1">
-        <children/>
-      </xul:vbox>
-          
-      <xul:hbox class="dialog-button-box" anonid="buttons"
-                xbl:inherits="pack=buttonpack,align=buttonalign,dir=buttondir,orient=buttonorient">
-        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
-        <xul:button dlgtype="help" class="dialog-button" hidden="true"/>
-        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
-        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
-        <xul:spacer anonid="spacer" flex="1"/>
-        <xul:button dlgtype="cancel" class="dialog-button"/>
-        <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
-      </xul:hbox>
-    </content>
-  </binding>
-
-  <binding id="unifiedWizard"
-           extends="chrome://global/content/bindings/wizard.xml#wizard">
-    <content activetitlebarcolor="#C9C9C9" inactivetitlebarcolor="#E4E4E4">
-      <xul:hbox class="wizard-header" anonid="Header"/>
-      <xul:deck class="wizard-page-box" flex="1" anonid="Deck">
-        <children includes="wizardpage"/>
-      </xul:deck>
-      <children/>
-      <xul:hbox class="wizard-buttons" anonid="Buttons" xbl:inherits="pagestep,firstpage,lastpage"/>
-    </content>
-  </binding>
-
-  <binding id="unifiedPrefwindow"
-           extends="chrome://global/content/bindings/preferences.xml#prefwindow">
-    <content dlgbuttons="accept,cancel"
-             persist="lastSelected screenX screenY"
-             closebuttonlabel="&preferencesCloseButton.label;"
-             closebuttonaccesskey="&preferencesCloseButton.accesskey;"
-             role="dialog"
-             title="&preferencesDefaultTitleMac.title;"
-             activetitlebarcolor="#BBBBBB"
-             inactivetitlebarcolor="#E4E4E4">
-      <xul:radiogroup anonid="selector" orient="horizontal" class="paneSelector chromeclass-toolbar"
-                      role="listbox"/> <!-- Expose to accessibility APIs as a listbox -->
-      <xul:hbox flex="1" class="paneDeckContainer">
-        <xul:deck anonid="paneDeck" flex="1">
-          <children includes="prefpane"/>
-        </xul:deck>
-      </xul:hbox>
-      <xul:hbox anonid="dlg-buttons" class="prefWindow-dlgbuttons">
-        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
-        <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/>
-        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
-        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
-        <xul:spacer anonid="spacer" flex="1"/>
-        <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/>
-        <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
-      </xul:hbox>
-      <xul:hbox>
-        <children/>
-      </xul:hbox>
-    </content>
-  </binding>
-</bindings>
--- a/toolkit/themes/pinstripe/global/jar.mn
+++ b/toolkit/themes/pinstripe/global/jar.mn
@@ -43,17 +43,16 @@ toolkit.jar:
 +  skin/classic/global/textbox.css
 +  skin/classic/global/datetimepicker.css
 +  skin/classic/global/toolbar.css
 +  skin/classic/global/toolbarbutton.css
 +  skin/classic/global/tree.css
 *  skin/classic/global/viewbuttons.css
 +  skin/classic/global/wizard.css
 +  skin/classic/global/wizardOverlay.css
-+  skin/classic/global/globalBindings.xml
 +  skin/classic/global/arrow/arrow-dn-dis.gif                         (arrow/arrow-dn-dis.gif)
 +  skin/classic/global/arrow/arrow-dn-dis.png                         (arrow/arrow-dn-dis.png)
 +  skin/classic/global/arrow/arrow-dn-sharp.gif                       (arrow/arrow-dn-sharp.gif)
 +  skin/classic/global/arrow/arrow-dn.gif                             (arrow/arrow-dn.gif)
 +  skin/classic/global/arrow/arrow-dn.png                             (arrow/arrow-dn.png)
 +  skin/classic/global/arrow/arrow-lft-dis.gif                        (arrow/arrow-lft-dis.gif)
 +  skin/classic/global/arrow/arrow-lft-hov.gif                        (arrow/arrow-lft-hov.gif)
 +  skin/classic/global/arrow/arrow-lft-sharp-end.gif                  (arrow/arrow-lft-sharp-end.gif)