mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-06 14:44:26 +00:00
Bug 1096469 - Make devedition theme work with custom devtools themes;r=Gijs
This commit is contained in:
parent
8a1e12656a
commit
3a75421f43
@ -53,8 +53,11 @@ let DevEdition = {
|
||||
_updateDevtoolsThemeAttribute: function() {
|
||||
// Set an attribute on root element to make it possible
|
||||
// to change colors based on the selected devtools theme.
|
||||
document.documentElement.setAttribute("devtoolstheme",
|
||||
Services.prefs.getCharPref(this._devtoolsThemePrefName));
|
||||
let devtoolsTheme = Services.prefs.getCharPref(this._devtoolsThemePrefName);
|
||||
if (devtoolsTheme != "dark") {
|
||||
devtoolsTheme = "light";
|
||||
}
|
||||
document.documentElement.setAttribute("devtoolstheme", devtoolsTheme);
|
||||
ToolbarIconColor.inferFromText();
|
||||
this._updateStyleSheetFromPrefs();
|
||||
},
|
||||
|
@ -65,6 +65,11 @@ function testDevtoolsTheme() {
|
||||
is (document.documentElement.getAttribute("devtoolstheme"), "dark",
|
||||
"The documentElement has an attribute based on devtools theme.");
|
||||
ok (DevEdition.styleSheet, "The devedition stylesheet is still there with the dark devtools theme.");
|
||||
|
||||
Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "foobar");
|
||||
is (document.documentElement.getAttribute("devtoolstheme"), "light",
|
||||
"The documentElement has 'light' as a default for the devtoolstheme attribute");
|
||||
ok (DevEdition.styleSheet, "The devedition stylesheet is still there with the foobar devtools theme.");
|
||||
}
|
||||
|
||||
function dummyLightweightTheme(id) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user