[Pkg-mozext-commits] [tabmixplus] 37/107: New preference in Options>Display>Tab>Styles - 'Disable custom background colors'
David Prévot
taffit at moszumanska.debian.org
Tue Dec 29 19:02:48 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 0dd0aff1decf86f6562342a54879a1f691a36300
Author: onemen <tabmix.onemen at gmail.com>
Date: Thu Oct 29 15:49:54 2015 +0200
New preference in Options>Display>Tab>Styles - 'Disable custom background colors'
---
chrome/content/preferences/appearance.xul | 3 +++
chrome/content/tab/tab.js | 28 ++++++++++++++++++++++------
chrome/locale/en-US/pref-appearance.dtd | 1 +
defaults/preferences/tabmix.js | 1 +
4 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/chrome/content/preferences/appearance.xul b/chrome/content/preferences/appearance.xul
index 422a2d3..75d11df 100644
--- a/chrome/content/preferences/appearance.xul
+++ b/chrome/content/preferences/appearance.xul
@@ -46,6 +46,7 @@
<preference id="pref_unreadTabreload" name="extensions.tabmix.unreadTabreload" type="bool"/>
<preference id="pref_unloadedTab" name="extensions.tabmix.unloadedTab" type="bool"/>
<preference id="pref_otherTab" name="extensions.tabmix.otherTab" type="bool"/>
+ <preference id="pref_disableBackground" name="extensions.tabmix.disableBackground" type="bool"/>
<preference id="pref_lockedIcon" name="extensions.tabmix.extraIcons.locked" type="bool"/>
<preference id="pref_protectedIcon" name="extensions.tabmix.extraIcons.protected" type="bool"/>
<preference id="pref_autoreloadIcon" name="extensions.tabmix.extraIcons.autoreload" type="bool"/>
@@ -194,6 +195,8 @@
<label id="treeStyleTab.bg.msg" class="header" hidden="true"
value="&backgroundDisabled.label;"
style="text-decoration: underline; color: #CC0000; margin-top: 10px;"/>
+ <checkbox_tmp id="disableBackground" label="&disableBackground.label;"
+ preference="pref_disableBackground"/>
</groupbox>
<groupbox flex="1">
<caption label="&show.ontab.label;"/>
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index 6b6b461..0c21804 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -1261,6 +1261,9 @@ var gTMPprefObserver = {
case "extensions.tabmix.progressMeter":
this.setProgressMeter();
break;
+ case "extensions.tabmix.disableBackground":
+ this.updateStyleAttributes();
+ break;
case "browser.tabs.tabMaxWidth":
case "browser.tabs.tabMinWidth":
var currentVisible = Tabmix.tabsUtils.isElementVisible(gBrowser.mCurrentTab);
@@ -1804,9 +1807,15 @@ var gTMPprefObserver = {
}
},
- updateTabsStyle: function(ruleName) {
+ updateStyleAttributes: function() {
+ let styles = ["current", "unloaded", "unread", "other"];
+ styles.forEach(styleName => {
+ this.updateStyleAttribute(styleName + "Tab", styleName);
+ });
+ },
+
+ updateStyleAttribute: function(ruleName, styleName) {
let attribValue = null;
- let styleName = ruleName.replace("Tab", "");
let enabled = Tabmix.prefs.getBoolPref(ruleName);
if (enabled) {
let prefValues = TabmixSvc.tabStylePrefs[ruleName];
@@ -1818,7 +1827,7 @@ var gTMPprefObserver = {
];
if (prefValues.text)
attribValue.push("text");
- if (prefValues.bg) {
+ if (prefValues.bg && !Tabmix.prefs.getBoolPref("disableBackground")) {
attribValue.push("bg");
if (TabmixSvc.australis && !Tabmix.extensions.treeStyleTab)
attribValue.push("aus");
@@ -1826,9 +1835,16 @@ var gTMPprefObserver = {
attribValue = attribValue.join(" ");
}
- let tabBar = gBrowser.tabContainer;
- let currentAttrib = tabBar.getAttribute("tabmix_" + styleName + "Style") || "";
- Tabmix.setItem(tabBar, "tabmix_" + styleName + "Style", attribValue);
+ let attName = "tabmix_" + styleName + "Style";
+ Tabmix.setItem(gBrowser.tabContainer, attName, attribValue);
+ return attribValue;
+ },
+
+ updateTabsStyle: function(ruleName) {
+ let styleName = ruleName.replace("Tab", "");
+ let attName = "tabmix_" + styleName + "Style";
+ let currentAttrib = gBrowser.tabContainer.getAttribute(attName) || "";
+ let attribValue = this.updateStyleAttribute(ruleName, styleName);
/** style on non-selected tab are unloaded, unread or other, unloaded and
* unread are only set on tab if the corresponded preference it on. if user
diff --git a/chrome/locale/en-US/pref-appearance.dtd b/chrome/locale/en-US/pref-appearance.dtd
index c118861..b32dcda 100644
--- a/chrome/locale/en-US/pref-appearance.dtd
+++ b/chrome/locale/en-US/pref-appearance.dtd
@@ -6,6 +6,7 @@
<!ENTITY hideRGB.label "Hide RGB">
<!ENTITY showRGB.label "Show RGB">
<!ENTITY unreadAfterReload.label "set tab as unread after reload">
+<!ENTITY disableBackground.label "Disable custom background colors">
<!ENTITY squaredTabs.label "Apply background color for squared tabs">
<!ENTITY backgroundDisabled.label "Tabs background colors are disabled when TreeStyleTabs is installed">
<!ENTITY otherTabs.label "Other Tabs">
diff --git a/defaults/preferences/tabmix.js b/defaults/preferences/tabmix.js
index 58bdf6d..d9ad983 100644
--- a/defaults/preferences/tabmix.js
+++ b/defaults/preferences/tabmix.js
@@ -92,6 +92,7 @@ pref("extensions.tabmix.currentTab", false);
pref("extensions.tabmix.unloadedTab", true);
pref("extensions.tabmix.unreadTab", true);
pref("extensions.tabmix.unreadTabreload", true);
+pref("extensions.tabmix.disableBackground", false);
pref("extensions.tabmix.otherTab", false);
pref("extensions.tabmix.progressMeter", true);
--
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