Bug 520637 - Draw lightweight themes in the titlebar. r=dao, r=enndeakin
authorMarkus Stange <mstange@themasta.com>
Wed, 21 Oct 2009 18:02:43 +0200
changeset 34071 aefbd5d5df5b56699bdb61bda59fddd4da2d4f13
parent 34070 2fbbdaa5f1d75d4030847cb56da92ecc663922ba
child 34072 a90ee28cac5ff8f395e460a7df4338f8e204c4f6
push idunknown
push userunknown
push dateunknown
reviewersdao, enndeakin
bugs520637
milestone1.9.3a1pre
Bug 520637 - Draw lightweight themes in the titlebar. r=dao, r=enndeakin
toolkit/content/LightweightThemeConsumer.jsm
toolkit/content/xul.css
--- a/toolkit/content/LightweightThemeConsumer.jsm
+++ b/toolkit/content/LightweightThemeConsumer.jsm
@@ -92,23 +92,20 @@ LightweightThemeConsumer.prototype = {
       _setImage(footer, active, aData.footerURL);
       if (active && aData.footerURL)
         footer.setAttribute("lwthemefooter", "true");
       else
         footer.removeAttribute("lwthemefooter");
     }
 
 #ifdef XP_MACOSX
-    if (active && aData.accentcolor) {
-      root.setAttribute("activetitlebarcolor", aData.accentcolor);
-      root.setAttribute("inactivetitlebarcolor", aData.accentcolor);
-    } else {
-      root.removeAttribute("activetitlebarcolor");
-      root.removeAttribute("inactivetitlebarcolor");
-    }
+    if (active)
+      root.setAttribute("drawintitlebar", "true");
+    else
+      root.removeAttribute("drawintitlebar");
 #endif
   }
 }
 
 function _setImage(aElement, aActive, aURL) {
   aElement.style.backgroundImage =
     (aActive && aURL) ? 'url("' + aURL.replace('"', '\\"', "g") + '")' : "";
 }
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -17,16 +17,22 @@
   -moz-box-sizing: border-box;
 }
 
 :root {
   text-rendering: optimizeLegibility;
   -moz-binding: url("chrome://global/content/bindings/general.xml#root-element");
 }
 
+%ifdef XP_MACOSX
+:root[drawintitlebar="true"] {
+  padding-top: 22px;
+}
+%endif
+
 :root:-moz-locale-dir(rtl) {
   direction: rtl;
 }
 
 /* hide the content and destroy the frame */
 [hidden="true"] {
   display: none;
 }