[Pkg-mozext-commits] [tabmixplus] 90/107: Can't customize tab bar at the bottom

David Prévot taffit at moszumanska.debian.org
Tue Dec 29 19:02:54 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit 7a00c2dcbc4c96a27d63beb1280a2089f22de0c1
Author: onemen <tabmix.onemen at gmail.com>
Date:   Fri Dec 4 15:41:01 2015 +0200

    Can't customize tab bar at the bottom
---
 chrome.manifest                     |  3 ++
 chrome/content/overlay/browsr.css   | 16 --------
 chrome/content/overlay/firefox.css  | 17 ++++++++
 chrome/content/overlay/palemoon.css | 21 ++++++++++
 chrome/content/tab/scrollbox.xml    | 82 +++++++++----------------------------
 chrome/content/tab/tab.js           | 66 +++++++++++++++++++++++++++++
 chrome/content/tabmix.js            |  1 +
 7 files changed, 127 insertions(+), 79 deletions(-)

diff --git a/chrome.manifest b/chrome.manifest
index 04a1bbe..ad6b8a3 100644
--- a/chrome.manifest
+++ b/chrome.manifest
@@ -90,4 +90,7 @@ skin      tabmix-os    classic/1.0   chrome://tabmix-version/skin/linux/ os=Linu
 style     chrome://global/content/customizeToolbar.xul              chrome://tabmixplus/skin/tab.css
 style     chrome://browser/content/preferences/preferences.xul      chrome://tabmixplus/skin/preferencesOverlay.css
 
+style     chrome://browser/content/browser.xul chrome://tabmixplus/content/overlay/firefox.css  application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+style     chrome://browser/content/browser.xul chrome://tabmixplus/content/overlay/palemoon.css application={8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}
+
 manifest  test.manifest
diff --git a/chrome/content/overlay/browsr.css b/chrome/content/overlay/browsr.css
index ade36fd..556c302 100644
--- a/chrome/content/overlay/browsr.css
+++ b/chrome/content/overlay/browsr.css
@@ -157,10 +157,6 @@ label.text-link, label[onclick] {
   vertical-align: bottom;
 }
 
-#main-window[title_normal="Pale Moon"] .tabbrowser-arrowscrollbox[flowing="multibar"] > toolbarbutton {
-  vertical-align: bottom;
-}
-
 #TabsToolbar[tabmix-show-newtabbutton="aftertabs"]:not([customizing="true"]) >
    #tabbrowser-tabs:not([overflow="true"]) > .tabbrowser-arrowscrollbox > .tabs-newtab-button[command="cmd_newNavigatorTab"] {
   display: -moz-box;
@@ -286,18 +282,6 @@ so display: none !important; does not hide the button */
   width: 0 !important;
 }
 
-/* :::: tabbar on bottom :::: */
-/* we don't need rule for toolbar-drag - when tabbar on bottom */
-#TabsToolbar[tabbaronbottom] {
-  -moz-binding: url("chrome://tabmixplus/content/tab/scrollbox.xml#toolbar") !important;
-  position: fixed !important;
-  -moz-appearance: none !important;
-/* look at browser.css for each platform
-  background-image: none !important;
-*/
-  margin-top: 1px !important;
-}
-
 /* for tabbar on bottom with australis */
 #TabsToolbar[tabbaronbottom] .titlebar-placeholder {
   display: none;
diff --git a/chrome/content/overlay/firefox.css b/chrome/content/overlay/firefox.css
new file mode 100644
index 0000000..e27341a
--- /dev/null
+++ b/chrome/content/overlay/firefox.css
@@ -0,0 +1,17 @@
+/**
+    Firefox
+
+    All platform
+**/
+
+/* :::: tabbar on bottom :::: */
+/* we don't need rule for toolbar-drag - when tabbar on bottom */
+#TabsToolbar[tabbaronbottom] {
+  -moz-binding: url("chrome://tabmixplus/content/tab/scrollbox.xml#firefox-bottom-toolbar") !important;
+  position: fixed !important;
+  -moz-appearance: none !important;
+  /* look at browser.css for each platform
+  background-image: none !important;
+  */
+  margin-top: 1px !important;
+}
diff --git a/chrome/content/overlay/palemoon.css b/chrome/content/overlay/palemoon.css
new file mode 100644
index 0000000..d102f07
--- /dev/null
+++ b/chrome/content/overlay/palemoon.css
@@ -0,0 +1,21 @@
+/**
+    Pale Moon
+
+    All platform
+**/
+
+/* :::: tabbar on bottom :::: */
+/* we don't need rule for toolbar-drag - when tabbar on bottom */
+#TabsToolbar[tabbaronbottom] {
+  -moz-binding: url("chrome://tabmixplus/content/tab/scrollbox.xml#palemoon-bottom-toolbar") !important;
+  position: fixed !important;
+  -moz-appearance: none !important;
+  /* look at browser.css for each platform
+  background-image: none !important;
+  */
+  margin-top: 1px !important;
+}
+
+.tabbrowser-arrowscrollbox[flowing="multibar"] > toolbarbutton {
+  vertical-align: bottom;
+}
diff --git a/chrome/content/tab/scrollbox.xml b/chrome/content/tab/scrollbox.xml
index 319f538..1893f0a 100644
--- a/chrome/content/tab/scrollbox.xml
+++ b/chrome/content/tab/scrollbox.xml
@@ -582,8 +582,8 @@
   </binding>
 
   <!-- for tabbar on the bottom of the screen -->
-  <binding id="toolbar"
-           extends="chrome://global/content/bindings/toolbar.xml#toolbar">
+  <binding id="firefox-bottom-toolbar"
+           extends="chrome://browser/content/customizableui/toolbar.xml#toolbar">
     <content>
         <xul:hbox flex="1"
                   xbl:inherits="orient,width"
@@ -595,72 +595,28 @@
     <implementation implements="nsIDOMEventListener">
       <constructor>
         <![CDATA[
-          //XXX we don't check for aEvent.target != window to catch changs in browser-bottombox
-          // try to improve it
-          window.addEventListener("resize", this.tabmixHandleEvent, false);
-          this.updatePosition();
+          Tabmix.bottomToolbarUtils.init();
         ]]>
       </constructor>
+    </implementation>
+  </binding>
 
-      <destructor>
+  <binding id="palemoon-bottom-toolbar"
+           extends="chrome://global/content/bindings/toolbar.xml#toolbar">
+    <content>
+      <xul:hbox flex="1"
+                xbl:inherits="orient,width"
+                anonid="toolbar-innerbox"
+                class="tabmixplus-toolbar-inner-box">
+        <xbl:children/>
+      </xul:hbox>
+    </content>
+    <implementation implements="nsIDOMEventListener">
+      <constructor>
         <![CDATA[
-          window.removeEventListener("resize", this.tabmixHandleEvent, false);
+          Tabmix.bottomToolbarUtils.init();
         ]]>
-      </destructor>
-
-      <field name="tabmixToolbarInnerBox" readonly="true">
-        document.getAnonymousElementByAttribute(this, 'anonid', 'toolbar-innerbox');
-      </field>
-
-      <method name="updatePosition">
-        <body><![CDATA[
-          var updateFullScreen, tabBar = gBrowser.tabContainer;
-          Tabmix.setItem(tabBar.mTabstrip, "flowing", TabmixTabbar.flowing);
-          Tabmix.tabsUtils.tabstripInnerbox = document.getAnonymousElementByAttribute(
-            tabBar.mTabstrip._scrollbox, "class", "box-inherit scrollbox-innerbox");
-          var bottomToolbox = document.getElementById("tabmix-bottom-toolbox");
-          if (!bottomToolbox) {
-            bottomToolbox = document.createElement("toolbox");
-            bottomToolbox.setAttribute("id", "tabmix-bottom-toolbox");
-            bottomToolbox.collapsed = !gBrowser.tabContainer.visible;
-            // if we decide to move this box into browser-bottombox
-            // remember to fix background css rules for all platform
-            let referenceNode = document.getElementById("content-deck");
-            referenceNode = referenceNode ? referenceNode.nextSibling :
-              document.getElementById("browser-bottombox");
-            referenceNode.parentNode.insertBefore(bottomToolbox, referenceNode);
-            updateFullScreen = window.fullScreen;
-          }
-          if (tabBar.visible)
-            gTMPprefObserver.updateTabbarBottomPosition();
-          else {
-            // the tabbar is hidden on startup
-            let height = tabBar.mTabstrip.scrollClientRect.height;
-            bottomToolbox.style.setProperty("height", height + "px", "important");
-            let tabsToolbar = document.getElementById("TabsToolbar");
-            tabsToolbar.style.setProperty("top", screen.availHeight + "px", "important");
-            tabsToolbar.setAttribute("width", screen.availWidth);
-          }
-          // force TabmixTabbar.setHeight to set tabbar height
-          TabmixTabbar.visibleRows = 1;
-          if (updateFullScreen) {
-            TMP_eventListener.toggleTabbarVisibility(false);
-            TabmixTabbar.updateSettings(false);
-          }
-        ]]></body>
-      </method>
-
-      <method name="tabmixHandleEvent">
-        <parameter name="aEvent"/>
-        <body><![CDATA[
-          switch (aEvent.type) {
-            case "resize":
-              gTMPprefObserver.updateTabbarBottomPosition(aEvent);
-              break;
-          }
-        ]]></body>
-      </method>
-
+      </constructor>
     </implementation>
   </binding>
 
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index e9579e7..7ef9b02 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -1074,6 +1074,72 @@ Tabmix.tabsUtils = {
   }
 };
 
+Tabmix.bottomToolbarUtils = {
+  initialized: false,
+
+  init: function() {
+    this.updatePosition();
+    if (this.initialized) {
+      return;
+    }
+    this.initialized = true;
+    //XXX we don't check for aEvent.target != window to catch changs in
+    // browser-bottombox. try to improve it...
+    window.addEventListener("resize", this, false);
+  },
+
+  onUnload: function() {
+    if (!this.initialized) {
+      return;
+    }
+    window.removeEventListener("resize", this, false);
+  },
+
+  updatePosition: function() {
+    var updateFullScreen,
+        tabBar = gBrowser.tabContainer;
+    Tabmix.setItem(tabBar.mTabstrip, "flowing", TabmixTabbar.flowing);
+    var bottomToolbox = document.getElementById("tabmix-bottom-toolbox");
+    if (!bottomToolbox) {
+      bottomToolbox = document.createElement("toolbox");
+      bottomToolbox.setAttribute("id", "tabmix-bottom-toolbox");
+      bottomToolbox.collapsed = !gBrowser.tabContainer.visible;
+      // if we decide to move this box into browser-bottombox
+      // remember to fix background css rules for all platform
+      let referenceNode = document.getElementById("content-deck");
+      referenceNode = referenceNode ? referenceNode.nextSibling :
+      document.getElementById("browser-bottombox");
+      referenceNode.parentNode.insertBefore(bottomToolbox, referenceNode);
+      updateFullScreen = window.fullScreen;
+    }
+    if (tabBar.visible)
+      gTMPprefObserver.updateTabbarBottomPosition();
+    else {
+      // the tabbar is hidden on startup
+      let height = tabBar.mTabstrip.scrollClientRect.height;
+      bottomToolbox.style.setProperty("height", height + "px", "important");
+      let tabsToolbar = document.getElementById("TabsToolbar");
+      tabsToolbar.style.setProperty("top", screen.availHeight + "px", "important");
+      tabsToolbar.setAttribute("width", screen.availWidth);
+    }
+    // force TabmixTabbar.setHeight to set tabbar height
+    TabmixTabbar.visibleRows = 1;
+    if (updateFullScreen) {
+      TMP_eventListener.toggleTabbarVisibility(false);
+      TabmixTabbar.updateSettings(false);
+    }
+  },
+
+  handleEvent: function(aEvent) {
+    switch (aEvent.type) {
+      case "resize": {
+        gTMPprefObserver.updateTabbarBottomPosition(aEvent);
+        break;
+      }
+    }
+  },
+};
+
 Tabmix.visibleTabs = {
   get first() {
     var tabs = gBrowser.tabs;
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index b4fbb76..b75ce1e 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -1119,6 +1119,7 @@ var TMP_eventListener = {
     }
 
     Tabmix.tabsUtils.onUnload();
+    Tabmix.bottomToolbarUtils.onUnload();
   },
 
   // some theme not useing up to date Tabmix tab binding

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list