Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/main.js

Issue 4744516900749312: issue #1155 - Don't allow displaying icon text with Australis theme (Closed)
Patch Set: Created July 30, 2014, 10:52 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« chrome/content/noToolbarIconDisplay.css ('K') | « chrome/content/settings.xul ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/main.js
===================================================================
--- a/lib/main.js
+++ b/lib/main.js
@@ -9,6 +9,13 @@
let {Prefs} = require("prefs");
let {WindowObserver} = require("windowObserver");
+var isAustralis = false;
+try
+{
+ Cu.import("resource:///modules/CustomizableUI.jsm", null);
+ isAustralis = true;
+} catch(e) {}
+
var WindowFeature =
{
observer: null,
@@ -124,6 +131,12 @@
stylesheet: "chrome://abpcustomization/content/noActionButton.css"
};
+var RemoveToolbarIconDisplayOption =
+{
+ __proto__: StylesheetFeature,
+ stylesheet: "chrome://abpcustomization/content/noToolbarIconDisplay.css"
+};
+
var ToolbarIconDisplay =
{
__proto__: StylesheetFeature,
@@ -172,6 +185,7 @@
"preferences-one-line-subscriptions": OneLineSubscriptions,
"preferences-remove-actions-button": RemoveActionsButton,
"toolbar-icon-display": ToolbarIconDisplay,
+ "remove-toolbar-icon-display-option": RemoveToolbarIconDisplayOption,
saroyanm 2014/07/30 10:56:23 Have little doubt regarding the naming, hope we wi
Wladimir Palant 2014/07/30 11:34:08 It's probably better to name it AddonPageAustralis
saroyanm 2014/07/30 12:50:35 Done.
"green-icon": GreenIcon,
"remove-menus": RemoveMenus
};
@@ -183,6 +197,10 @@
let enabled;
if (name == "addon-page-styles")
enabled = true;
+ else if (name == "toolbar-icon-display")
+ enabled = !isAustralis;
Wladimir Palant 2014/07/30 11:34:08 I don't think we want to have |enabled = true| for
saroyanm 2014/07/30 12:50:35 Make, sense. Thanks.
+ else if (name == "remove-toolbar-icon-display-option")
+ enabled = isAustralis;
else
enabled = Prefs[name];
@@ -193,7 +211,6 @@
}
}
-
// Initialize features and make sure to update them on changes
for (let feature in features)
updateFeature(feature);
« chrome/content/noToolbarIconDisplay.css ('K') | « chrome/content/settings.xul ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld