[Pkg-mozext-commits] [tabmixplus] 38/147: Miscellaneous updates for Pale Moon 27
David Prévot
taffit at moszumanska.debian.org
Sat Aug 5 15:27:34 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 ee3d7c4337a1836606f0df62c06f81df9de31996
Author: onemen <tabmix.onemen at gmail.com>
Date: Tue Nov 29 23:30:59 2016 +0200
Miscellaneous updates for Pale Moon 27
---
chrome/content/preferences/bindings.xml | 2 +-
chrome/content/tab/scrollbox.xml | 14 ++++++++++++--
chrome/content/tab/tab.js | 10 +++++++++-
chrome/content/tabmix.js | 5 +++++
modules/DynamicRules.jsm | 4 +++-
5 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/chrome/content/preferences/bindings.xml b/chrome/content/preferences/bindings.xml
index 28e5dbd..22505e1 100644
--- a/chrome/content/preferences/bindings.xml
+++ b/chrome/content/preferences/bindings.xml
@@ -38,7 +38,7 @@
<implementation>
<constructor>
<![CDATA[
- var update = Tabmix.isVersion(320) ? "" : " && aUpdate";
+ var update = Tabmix.isVersion(320, 270) ? "" : " && aUpdate";
Tabmix.changeCode(this, "_setValue")._replace(
'return aValue;',
'else if (!this.instantApply' + update + ' && this.value === aValue) {' +
diff --git a/chrome/content/tab/scrollbox.xml b/chrome/content/tab/scrollbox.xml
index 8c038a4..0b77dce 100644
--- a/chrome/content/tab/scrollbox.xml
+++ b/chrome/content/tab/scrollbox.xml
@@ -211,13 +211,13 @@
'Math.abs(distance * (this.scrollbox.isMultiRow ? this.scrollbox._verticalAnimation : 1))'
).toCode();
- if (Tabmix.isVersion(320)) {
+ if (Tabmix.isVersion(320, 270)) {
Tabmix.changeCode(this, "scrollbox._updateScrollButtonsDisabledState")._replace(
// when theme or extension add negative margin-bottom to the tab or
// tab content the scrollHeight can be larger than the actual
// inner-box height
'this.scrollSize',
- '(this.orient == "vertical" && this.isMultiRow ? this.innerbox.getBoundingClientRect().height : $&)'
+ 'this.tabmixScrollSize'
)._replace(
/(})(\)?)$/,
' var box = document.getElementById("tabmixScrollBox");\n' +
@@ -321,6 +321,16 @@
]]></getter>
</property>
+ <property name="tabmixScrollSize" readonly="true">
+ <getter><![CDATA[
+ if (this.orient == "vertical" && this.isMultiRow) {
+ const height = this.innerbox.getBoundingClientRect().height;
+ return Math.round(height);
+ }
+ return this.scrollSize;
+ ]]></getter>
+ </property>
+
<property name="singleRowHeight" readonly="true">
<getter><![CDATA[
if (this._singleRowHeight)
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index 55dd9a3..41815c6 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -285,6 +285,10 @@ var TabmixTabbar = {
for (let row = 2; row < aRows; row++)
this._heights[tabsPosition][row] = rowHeight * row;
}
+
+ // make sure our scroll buttons box height is no more than 2 rows
+ const box = document.getElementById("tabmixScrollBox");
+ box.style.setProperty("max-height", this._heights[tabsPosition][2] + "px", "important");
}
if (tabstrip.style.maxHeight != tabstrip.style.height || tabstrip.style.maxHeight != newHeight + "px")
@@ -1059,7 +1063,7 @@ Tabmix.tabsUtils = {
document.getAnonymousElementByAttribute(tabstrip, "anonid", "scrollbutton-up");
tabstrip._updateScrollButtonsDisabledState();
- if (!Tabmix.isVersion(320)) {
+ if (!Tabmix.isVersion(320, 270)) {
let overflow = this.overflow;
tabstrip._scrollButtonUp.collapsed = !overflow;
tabstrip._scrollButtonDown.collapsed = !overflow;
@@ -1855,6 +1859,10 @@ gTMPprefObserver = {
this.insertRule(newRule);
}
+ if (TabmixSvc.isPaleMoon && Tabmix.isVersion(0, 270)) {
+ this.insertRule('#tabmixScrollBox{ margin-top: -1px;}');
+ }
+
// we don't show icons on menu on Mac OS X
if (TabmixSvc.isMac)
return;
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index fdbe6a4..f7b3def 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -115,6 +115,11 @@ Tabmix.getButtonsHeight = function(setDefault) {
} else {
this._buttonsHeight = 24;
}
+
+ if (TabmixSvc.isPaleMoon && this.isVersion(0, 270)) {
+ this._buttonsHeight = Math.round(this._buttonsHeight);
+ }
+
return this._buttonsHeight;
};
diff --git a/modules/DynamicRules.jsm b/modules/DynamicRules.jsm
index 9438cfe..7f25cee 100644
--- a/modules/DynamicRules.jsm
+++ b/modules/DynamicRules.jsm
@@ -71,7 +71,9 @@ this.DynamicRules = {
observe: function(subject, topic, data) {
switch (topic) {
case "browser-window-before-show":
- this.registerMutationObserver(subject);
+ if (!TabmixSvc.isPaleMoon) {
+ this.registerMutationObserver(subject);
+ }
break;
case "nsPref:changed":
this.onPrefChange(data);
--
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