[Pkg-mozext-commits] [tabmixplus] 95/123: When scrollButtonsMode is in one row and there are pinned tabs we don't need to change radius for selected or hovered tab when it is last pinned or first non-pinned tab

David Prévot taffit at moszumanska.debian.org
Wed Sep 17 21:16:30 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 2aab2b5758242f4740e811da7e3b69cc7aca7bb6
Author: onemen <tabmix.onemen at gmail.com>
Date:   Wed Sep 10 21:08:57 2014 +0300

    When scrollButtonsMode is in one row and there are pinned tabs we don't need to change radius for selected or hovered tab when it is last pinned or first non-pinned tab
---
 chrome/content/tab/tab.js               | 27 +++++++++++++++++++---
 chrome/skin/app_version/4.0/general.css | 40 ++++++++++++++++-----------------
 2 files changed, 44 insertions(+), 23 deletions(-)

diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index 3b15943..10d80de 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -443,10 +443,30 @@ var TabmixTabbar = {
     let multibar = tabBar.hasAttribute("multibar");
     let selected = tabBar.selectedItem;
     let tabRow, top;
+
+    let numPinnedTabs = gBrowser._numPinnedTabs;
+    let isSpecial = TabmixSvc.australis &&
+        this.scrollButtonsMode != this.SCROLL_BUTTONS_MULTIROW &&
+        numPinnedTabs > 0;
     // Firefox don't have beforeselected-visible attribute (bug 585558 didn't
     // include it), we add tabmix-beforeselected-visible here and use it for
     // Firefox with australis UI
     let updateAtt = function(tab, type, attrib, visible, prefix) {
+      // special case is when scrollButtonsMode is in one row and
+      // selected or hovered tab is last pinned or first non-pinned tab
+      let isSpecialTab = function() {
+        if (!tab || !isSpecial)
+          return false;
+        if (/^before/.test(attrib))
+          return tab._tPos == numPinnedTabs - 1 ? "before" : false;
+        return tab._tPos == numPinnedTabs ? "after" : false;
+      }
+      let getAttVal = function(val, hoverAttr) {
+        if (!specialTab || hoverAttr && visible && /selected/.test(attrib))
+          return val;
+        return val ? "special" : val;
+      }
+
       let removed = "tabmix-removed-" + attrib;
       let oldTab = tabBar._tabmixPositionalTabs[type];
       if (oldTab && tab != oldTab) {
@@ -454,13 +474,14 @@ var TabmixTabbar = {
         oldTab.removeAttribute(removed);
       }
       tabBar._tabmixPositionalTabs[type] = tab;
+      let specialTab = isSpecialTab();
       if (tab && (TabmixSvc.australis && attrib == "beforeselected" ||
-          multibar || tab.hasAttribute(removed))) {
+          multibar || tab.hasAttribute(removed) || specialTab)) {
         let sameRow = multibar ? tabRow == tabBar.getTabRowNumber(tab, top) || null : true;
         Tabmix.setItem(tab, removed, !sameRow || null);
-        Tabmix.setItem(tab, attrib, sameRow);
+        Tabmix.setItem(tab, attrib, getAttVal(sameRow, true));
         if (visible)
-          Tabmix.setItem(tab, prefix + attrib + "-visible", sameRow);
+          Tabmix.setItem(tab, prefix + attrib + "-visible", getAttVal(sameRow));
       }
     }
 
diff --git a/chrome/skin/app_version/4.0/general.css b/chrome/skin/app_version/4.0/general.css
index 6036444..1b51c00 100644
--- a/chrome/skin/app_version/4.0/general.css
+++ b/chrome/skin/app_version/4.0/general.css
@@ -134,53 +134,53 @@
 }
 
 /* fix radios for tabs before and after the selected or hovered tab */
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"]):not(:hover)[tabmix_tabStyle*="bg"][afterselected-visible] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(ltr),
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterhovered] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(ltr),
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"]):not(:hover)[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(rtl),
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][beforehovered] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(rtl) {
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"]):not(:hover)[tabmix_tabStyle*="bg"][afterselected-visible="true"] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(ltr),
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterhovered="true"] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(ltr),
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"]):not(:hover)[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible="true"] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(rtl),
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][beforehovered="true"] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(rtl) {
   border-bottom-left-radius: 15px;
 }
 
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"]):not(:hover)[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(ltr),
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][beforehovered] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(ltr),
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"]):not(:hover)[tabmix_tabStyle*="bg"][afterselected-visible] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(rtl),
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterhovered] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(rtl) {
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"]):not(:hover)[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible="true"] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(ltr),
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][beforehovered="true"] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(ltr),
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"]):not(:hover)[tabmix_tabStyle*="bg"][afterselected-visible="true"] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(rtl),
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterhovered="true"] > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(rtl) {
   border-bottom-right-radius: 15px;
 }
 
 /* fix for hoverd tab that is before or after selected tab */
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterselected-visible]:hover > .tab-stack > .tab-background > .tab-background-start,
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterselected-visible]:hover > .tab-stack > .tab-background > .tab-background-start::before,
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible]:hover > .tab-stack > .tab-background > .tab-background-end,
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible]:hover > .tab-stack > .tab-background > .tab-background-end::before {
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterselected-visible="true"]:hover > .tab-stack > .tab-background > .tab-background-start,
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterselected-visible="true"]:hover > .tab-stack > .tab-background > .tab-background-start::before,
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible="true"]:hover > .tab-stack > .tab-background > .tab-background-end,
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible="true"]:hover > .tab-stack > .tab-background > .tab-background-end::before {
   width: 0px !important;
 }
 
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterselected-visible]:hover > .tab-stack > .tab-background:-moz-locale-dir(ltr),
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible]:hover > .tab-stack > .tab-background:-moz-locale-dir(rtl) {
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterselected-visible="true"]:hover > .tab-stack > .tab-background:-moz-locale-dir(ltr),
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible="true"]:hover > .tab-stack > .tab-background:-moz-locale-dir(rtl) {
   background-position: left bottom, left bottom, right bottom;
   background-size: 0% 0%, calc(100% - (1 * 30px)) 100%, 30px 100%;
   border-radius: 16px 0 0 20px;
   margin-left: 0px;
 }
 
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterselected-visible]:hover > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(ltr),
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible]:hover > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(rtl) {
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterselected-visible="true"]:hover > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(ltr),
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible="true"]:hover > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(rtl) {
   border-left: 2px solid rgba(26 ,26, 26, 0.25);
   border-radius: 16px 0 0 20px;
   margin-left: 0px;
 }
 
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible]:hover > .tab-stack > .tab-background:-moz-locale-dir(ltr),
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterselected-visible]:hover > .tab-stack > .tab-background:-moz-locale-dir(rtl) {
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible="true"]:hover > .tab-stack > .tab-background:-moz-locale-dir(ltr),
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterselected-visible="true"]:hover > .tab-stack > .tab-background:-moz-locale-dir(rtl) {
   background-position: left bottom, 30px bottom, right bottom;
   background-size: 30px 100%, calc(100% - (1 * 30px)) 100%, 0% 0%;
   border-radius: 0 16px 20px 0;
   margin-right: 0px;
 }
 
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible]:hover > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(ltr),
-#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterselected-visible]:hover > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(rtl) {
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][tabmix-beforeselected-visible="true"]:hover > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(ltr),
+#tabbrowser-tabs:not([movingtab])[tabmix_australis="true"] > .tabbrowser-tab:not([selected="true"])[tabmix_tabStyle*="bg"][afterselected-visible="true"]:hover > .tab-stack > .tab-background > .tab-background-middle:-moz-locale-dir(rtl) {
   border-right: 2px solid rgba(26, 26, 26, 0.25);
   border-radius: 0 16px 20px 0;
   margin-right: 0px;

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