зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1466335: Automatically apply the dark theme on startup if the OS is in dark mode. r=dao
This commit is contained in:
Родитель
1f2e716a79
Коммит
49fcbb81cb
|
@ -22,7 +22,7 @@ var CompactTheme = {
|
|||
},
|
||||
|
||||
get isThemeCurrentlyApplied() {
|
||||
let theme = LightweightThemeManager.currentTheme;
|
||||
let theme = LightweightThemeManager.currentThemeForDisplay;
|
||||
return theme && (
|
||||
theme.id == "firefox-compact-dark@mozilla.org" ||
|
||||
theme.id == "firefox-compact-light@mozilla.org");
|
||||
|
|
|
@ -140,8 +140,15 @@ var LightweightThemeManager = {
|
|||
|
||||
get currentThemeForDisplay() {
|
||||
var data = this.currentTheme;
|
||||
if ((!data || data.id == DEFAULT_THEME_ID) && _fallbackThemeData)
|
||||
data = _fallbackThemeData;
|
||||
|
||||
if (!data || data.id == DEFAULT_THEME_ID) {
|
||||
if (_fallbackThemeData) {
|
||||
return _fallbackThemeData;
|
||||
}
|
||||
if (_defaultThemeIsInDarkMode) {
|
||||
return this.getUsedTheme(DARK_THEME_ID);
|
||||
}
|
||||
}
|
||||
|
||||
if (data && PERSIST_ENABLED) {
|
||||
for (let key in PERSIST_FILES) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче