[Pkg-mozext-commits] [tabmixplus] 31/44: Disable close tab button on left side when the button is not inside tab-content

David Prévot taffit at moszumanska.debian.org
Wed Oct 15 02:10:04 UTC 2014


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit a3c6137255ceab182c714d0f5112c4629330d971
Author: onemen <tabmix.onemen at gmail.com>
Date:   Tue Oct 7 21:01:07 2014 +0300

    Disable close tab button on left side when the button is not inside tab-content
---
 chrome/content/preferences/appearance.js  | 3 +++
 chrome/content/preferences/appearance.xul | 2 ++
 chrome/content/tab/tab.js                 | 3 ++-
 chrome/content/tab/tabbrowser_4.xml       | 8 +++++++-
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/chrome/content/preferences/appearance.js b/chrome/content/preferences/appearance.js
index a786f90..13f9ccb 100644
--- a/chrome/content/preferences/appearance.js
+++ b/chrome/content/preferences/appearance.js
@@ -18,6 +18,9 @@ var gAppearancePane = {
       window.treeStyleTab = true;
     }
 
+    Tabmix.setItem("tabXLeft", "disabled", !browserWindow.Tabmix.defaultCloseButtons || null);
+    Tabmix.setItem("onLeftDisabled", "hidden", browserWindow.Tabmix.defaultCloseButtons || null);
+
     // browser.allTabs.previews
     if (Tabmix.isVersion(210) && !TabmixSvc.isPaleMoon) {
       gPrefWindow.removeChild("pref_allTabsPpreviews");
diff --git a/chrome/content/preferences/appearance.xul b/chrome/content/preferences/appearance.xul
index 27d6cca..bd51fcb 100644
--- a/chrome/content/preferences/appearance.xul
+++ b/chrome/content/preferences/appearance.xul
@@ -229,6 +229,8 @@
                 <label value="&widthPixels.label;" observes="obs_showTabX"/>
               </hbox>
             </hbox>
+            <label id="onLeftDisabled" value="Can't place button on left side with the current theme" hidden="true"
+                   style="text-decoration: underline; color: #CC0000;"/>
           </groupbox>
           <groupbox flex="1">
             <!-- Tab width -->
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index 2d7c994..ecb7960 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -780,7 +780,8 @@ var gTMPprefObserver = {
         }
         break;
       case "extensions.tabmix.tabs.closeButtons.onLeft":
-        gBrowser.tabContainer.setAttribute("closebuttons-side", Services.prefs.getBoolPref(prefName) ? "left" : "right");
+        let onLeft = Tabmix.defaultCloseButtons && Services.prefs.getBoolPref(prefName);
+        gBrowser.tabContainer.setAttribute("closebuttons-side", onLeft ? "left" : "right");
         break;
       case "extensions.tabmix.tabs.closeButtons.enable":
         prefValue = Services.prefs.getBoolPref(prefName)
diff --git a/chrome/content/tab/tabbrowser_4.xml b/chrome/content/tab/tabbrowser_4.xml
index 8ea6f83..859e438 100644
--- a/chrome/content/tab/tabbrowser_4.xml
+++ b/chrome/content/tab/tabbrowser_4.xml
@@ -373,7 +373,13 @@
           });
           XPCOMUtils.defineLazyGetter(Tabmix, "ltr", function () !Tabmix.rtl);
 
-          this.setAttribute("closebuttons-side", Tabmix.prefs.getBoolPref("tabs.closeButtons.onLeft") ? "left" : "right");
+          // don't set button to left side if it is not inside tab-content
+          let button = document.getAnonymousElementByAttribute(this.firstChild, "anonid", "tmp-close-button") ||
+                       document.getAnonymousElementByAttribute(this.firstChild, "anonid", "close-button");
+          Tabmix.defaultCloseButtons = button && button.parentNode.className == "tab-content";
+          let onLeft = Tabmix.defaultCloseButtons && Tabmix.prefs.getBoolPref("tabs.closeButtons.onLeft");
+          this.setAttribute("closebuttons-side", onLeft ? "left" : "right");
+
           this._keepLastTab = Tabmix.prefs.getBoolPref("keepLastTab");
           this.closeButtonsEnabled = Tabmix.prefs.getBoolPref("tabs.closeButtons.enable");
           this.mCloseButtons = Tabmix.prefs.getIntPref("tabs.closeButtons");

-- 
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