[Pkg-mozext-commits] [tabmixplus] 54/61: New tooltip on multi-rows scroll button to show rows count and selected tab position

David Prévot taffit at moszumanska.debian.org
Fri Aug 28 19:09:23 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 1f987a18c860c437f5768a9b57dea898ac64cf5e
Author: onemen <tabmix.onemen at gmail.com>
Date:   Wed Aug 19 10:19:43 2015 +0300

    New tooltip on multi-rows scroll button to show rows count and selected tab position
---
 chrome/content/overlay/browsr.css     |  4 ++++
 chrome/content/tab/tab.js             | 16 +++++++++++++---
 chrome/content/tabmix.xul             |  8 ++++++++
 chrome/locale/en-US/tabmix.properties |  8 ++++++++
 4 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/chrome/content/overlay/browsr.css b/chrome/content/overlay/browsr.css
index 9d26fa9..8cb3125 100644
--- a/chrome/content/overlay/browsr.css
+++ b/chrome/content/overlay/browsr.css
@@ -340,3 +340,7 @@ so display: none !important; does not hide the button */
 #main-window[inFullscreen][inDOMFullscreen] #fullscr-bottom-toggler {
   visibility: collapse;
 }
+
+#tabmix-rows-tooltip:not([flowing="multibar"]) {
+  display: none;
+}
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index c1558c5..df0d31d 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -17,11 +17,11 @@ var TabmixTabbar = {
     Tabmix.setItem(gBrowser.tabContainer, "flowing", val);
     Tabmix.setItem(gBrowser.tabContainer.mTabstrip, "flowing", val);
 
-    let tabmixScrollBox = document.getElementById("tabmixScrollBox");
-    Tabmix.setItem(tabmixScrollBox, "flowing", val);
+    // update our broadcaster
+    Tabmix.setItem("tabmix_flowing", "flowing", val);
     // we have to set orient attribute for Linux theme,
     // maybe other themes need it for display the scroll arrow
-    Tabmix.setItem(tabmixScrollBox, "orient", val == "multibar" ? "vertical" : "horizontal");
+    Tabmix.setItem("tabmixScrollBox", "orient", val == "multibar" ? "vertical" : "horizontal");
     return val;
   },
 
@@ -992,6 +992,16 @@ Tabmix.tabsUtils = {
     return !this.tabBar.mTabstrip._scrollButtonDown.disabled;
   },
 
+  createTooltip: function(box) {
+    let rows = this.lastTabRowNumber;
+    let active = this.getTabRowNumber(gBrowser.selectedTab, this.topTabY);
+    let rowsStr = TabmixSvc.getString("rowsTooltip.rowscount");
+    let activeStr = TabmixSvc.getString("rowsTooltip.activetab");
+    let tooltip = PluralForm.get(rows, rowsStr).replace("#1", rows) +
+        "\n" + activeStr.replace("#1", active);
+    box.label = tooltip;
+  },
+
   isSingleRow: function(visibleTabs) {
     if (!this.tabBar.hasAttribute("multibar"))
       return true;
diff --git a/chrome/content/tabmix.xul b/chrome/content/tabmix.xul
index 1399c43..e12028c 100644
--- a/chrome/content/tabmix.xul
+++ b/chrome/content/tabmix.xul
@@ -377,6 +377,11 @@
       </menupopup >
       <!-- tabmix tooltip for button -->
       <tooltip id="tabmix-tooltip"/>
+      <!-- tabmix tooltip for tabmixScrollBox -->
+      <tooltip id="tabmix-rows-tooltip"
+               observes="tabmix_flowing"
+               onpopupshowing="Tabmix.tabsUtils.createTooltip(this);">
+      </tooltip>
     </popupset>
 
     <!-- hide Tab groups context menu in all-tabs list button -->
@@ -385,6 +390,8 @@
     <toolbar id="TabsToolbar">
       <box id="tabmixScrollBox" insertafter="tabbrowser-tabs"
                      class="tabbrowser-arrowscrollbox tabmix_scrollbuttons_box"
+                     observes="tabmix_flowing"
+                     tooltip="tabmix-rows-tooltip"
                      type="tabmix-box"
                      removable="false"/>
     </toolbar>
@@ -398,6 +405,7 @@
     <broadcaster id="tmp_undocloseButton"/>
     <broadcaster id="tmp_sessionmanagerButton"/>
     <broadcaster id="tmp_disableSave"/>
+    <broadcaster id="tabmix_flowing"/>
   </broadcasterset>
 
 </overlay>
diff --git a/chrome/locale/en-US/tabmix.properties b/chrome/locale/en-US/tabmix.properties
index cdc319a..d547e41 100644
--- a/chrome/locale/en-US/tabmix.properties
+++ b/chrome/locale/en-US/tabmix.properties
@@ -39,3 +39,11 @@ incompatible.button2.accesskey= E
 incompatible.chkbox.label= Show this alert when browser starts
 tabmixoption.error.title= Tab Mix Plus Error
 tabmixoption.error.msg= You must have one browser window to use Tab Mix Plus Options
+# LOCALIZATION NOTE (rowsTooltip.rowscount):
+# Semicolon-separated list of plural forms. See:
+# http://developer.mozilla.org/en/docs/Localization_and_Plurals
+# #1 is the total number of rows
+# The singular form is not considered since this string is used only for
+# multiple rows.
+rowsTooltip.rowscount=;#1 Rows
+rowsTooltip.activetab=Active tab on row #1

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