[Pkg-mozext-commits] [tabmixplus] 60/147: Follow up bug 658467 - Fade out tab label on overflow instead of ellipsis

David Prévot taffit at moszumanska.debian.org
Sat Aug 5 15:27:36 UTC 2017


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 470d5ca332408a226d913251580946e4962a02f1
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sat Dec 10 20:47:27 2016 +0200

    Follow up bug 658467 - Fade out tab label on overflow instead of ellipsis
---
 chrome/content/click/click.js       |  2 +-
 chrome/content/minit/tablib.js      |  8 ++++----
 chrome/content/places/places.js     |  8 ++++++--
 chrome/content/tab/tabbrowser_4.xml | 16 ++++++++++++++++
 4 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/chrome/content/click/click.js b/chrome/content/click/click.js
index 9b7bd07..e5fe3d8 100644
--- a/chrome/content/click/click.js
+++ b/chrome/content/click/click.js
@@ -1032,7 +1032,7 @@ var TabmixAllTabs = {
       return;
 
     aMenuitem.setAttribute("label", aMenuitem.getAttribute("count") + aTab.label);
-    aMenuitem.setAttribute("crop", aTab.getAttribute("crop"));
+    aMenuitem.setAttribute("crop", Tabmix.isVersion(530) ? "end" : aTab.getAttribute("crop"));
 
     if (aTab.hasAttribute("busy")) {
       aMenuitem.setAttribute("busy", aTab.getAttribute("busy"));
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index ee3fa68..5290302 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -339,7 +339,7 @@ var tablib = { // eslint-disable-line
       'if (aTab.label == title',
       'if (aTab.hasAttribute("mergeselected"))\
          title = "(*) " + title;\
-       var noChange = aTab.label == title && aTab.crop == crop;\
+       const noChange = aTab.label == title && (Tabmix.isVersion(530) || aTab.crop == crop);\
        if (aTab.hasAttribute("tabmix_changed_label")) {\
          aTab.removeAttribute("tabmix_changed_label");\
          if (noChange)\
@@ -349,9 +349,9 @@ var tablib = { // eslint-disable-line
          TMP_Places.currentTab = null;\
        $&'
     )._replace(
-      'aTab.crop = crop;',
-      '$&\
-       tablib.onTabTitleChanged(aTab, browser, title == urlTitle);'
+      'this._tabAttrModified',
+      `tablib.onTabTitleChanged(aTab, browser, title == urlTitle);
+            $&`
     ).toCode();
 
     // after bug 347930 - change Tab strip to be a toolbar
diff --git a/chrome/content/places/places.js b/chrome/content/places/places.js
index 695650a..896c6a3 100644
--- a/chrome/content/places/places.js
+++ b/chrome/content/places/places.js
@@ -331,9 +331,13 @@ var TMP_Places = {
     let title = this.getTabTitle(aTab, aUrl, aTab.label);
     if (title != aTab.label) {
       aTab.label = title;
-      aTab.crop = title != aUrl || aUrl == TabmixSvc.aboutBlank ? "end" : "center";
       aTab.setAttribute("tabmix_changed_label", title);
-      gBrowser._tabAttrModified(aTab, ["label", "crop"]);
+      if (Tabmix.isVersion(530)) {
+        gBrowser._tabAttrModified(aTab, ["label"]);
+      } else {
+        aTab.crop = title != aUrl || aUrl == TabmixSvc.aboutBlank ? "end" : "center";
+        gBrowser._tabAttrModified(aTab, ["label", "crop"]);
+      }
       if (aTab.selected)
         gBrowser.updateTitlebar();
       if (!aTab.hasAttribute("faviconized"))
diff --git a/chrome/content/tab/tabbrowser_4.xml b/chrome/content/tab/tabbrowser_4.xml
index 2594fe0..9c50b61 100644
--- a/chrome/content/tab/tabbrowser_4.xml
+++ b/chrome/content/tab/tabbrowser_4.xml
@@ -139,7 +139,17 @@
                      anonid="overlay-icon"
                      class="tab-icon-overlay"
                      role="presentation"/>
+          <xul:hbox class="tab-label-container"
+                    xbl:inherits="pinned,selected=visuallyselected"
+                    onoverflow="this.setAttribute('textoverflow', 'true');"
+                    onunderflow="this.removeAttribute('textoverflow');"
+                    flex="1">
+            <xul:label class="tab-text tab-label"
+                       xbl:inherits="xbl:text=label,accesskey,fadein,pinned,selected=visuallyselected,attention"
+                       role="presentation"/>
+          </xul:hbox>
           <xul:label flex="1"
+                     hidden="true"
                      anonid="tab-label" tabmix="true"
                      xbl:inherits="value=label,visibleLabel,crop,accesskey,fadein,pinned,selected=visuallyselected,attention"
                      class="tab-text tab-label"
@@ -168,6 +178,12 @@
           let context = document.getElementById('context_closeTab');
           this.setAttribute('closetabtext', context.getAttribute('label'));
         }
+        if (Tabmix.isVersion(510) && !Tabmix.isVersion(530)) {
+          const tabLabel = document.getAnonymousElementByAttribute(this, "anonid", "tab-label");
+          tabLabel.hidden = false;
+          const tabLabelContainer = document.getAnonymousElementByAttribute(this, "class", "tab-label-container");
+          tabLabelContainer.hidden = true;
+        }
         this.tabmix_inited = true;
       ]]>
     </constructor>

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