From 265ade2e8415013bd43a1def2a878d2f34b3e410 Mon Sep 17 00:00:00 2001 From: Etienne Segonzac Date: Thu, 16 Jan 2014 15:52:30 +0100 Subject: [PATCH] Bug 849223 - Make the CSS3 system color module customizable via mozSettings to enable gaia themes. r=vingtetun --- b2g/app/b2g.js | 16 +++++++++------- b2g/chrome/content/settings.js | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index a14ed6c1ec4..e5f0beae409 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -243,21 +243,23 @@ pref("ui.buttonshadow", "#aea194"); pref("ui.buttontext", "#101010"); pref("ui.captiontext", "#101010"); pref("ui.graytext", "#b1a598"); -pref("ui.highlight", "#fad184"); pref("ui.highlighttext", "#1a1a1a"); -pref("ui.infobackground", "#f5f5b5"); -pref("ui.infotext", "#000"); -pref("ui.menu", "#f7f5f3"); -pref("ui.menutext", "#101010"); pref("ui.threeddarkshadow", "#000"); pref("ui.threedface", "#ece7e2"); pref("ui.threedhighlight", "#fff"); pref("ui.threedlightshadow", "#ece7e2"); pref("ui.threedshadow", "#aea194"); -pref("ui.window", "#efebe7"); -pref("ui.windowtext", "#101010"); pref("ui.windowframe", "#efebe7"); +// Themable via mozSettings +pref("ui.menu", "#f97c17"); +pref("ui.menutext", "#ffffff"); +pref("ui.infobackground", "#343e40"); +pref("ui.infotext", "#686868"); +pref("ui.window", "#ffffff"); +pref("ui.windowtext", "#000000"); +pref("ui.highlight", "#b2f2ff"); + // replace newlines with spaces on paste into single-line text boxes pref("editor.singleLine.pasteNewlines", 2); diff --git a/b2g/chrome/content/settings.js b/b2g/chrome/content/settings.js index aa3f4107f48..03f2a107fed 100644 --- a/b2g/chrome/content/settings.js +++ b/b2g/chrome/content/settings.js @@ -608,3 +608,17 @@ SettingsListener.observe("accessibility.screenreader", false, function(value) { AccessFu.attach(window); } }); + +// ================ Theming ============ +(function themingSettingsListener() { + let themingPrefs = ['ui.menu', 'ui.menutext', 'ui.infobackground', 'ui.infotext', + 'ui.window', 'ui.windowtext', 'ui.highlight']; + + themingPrefs.forEach(function(pref) { + SettingsListener.observe('gaia.' + pref, null, function(value) { + if (value) { + Services.prefs.setCharPref(pref, value); + } + }); + }); +})();