From f2d83992cd16271996a09460fac2aaf5b58c984c Mon Sep 17 00:00:00 2001 From: Johann Hofmann Date: Thu, 3 Aug 2017 10:31:26 +0200 Subject: [PATCH] Bug 1384541 - Add a UI migration from compact themes to compact mode. r=dao MozReview-Commit-ID: A6kr1QM5Nxu --HG-- extra : rebase_source : c7065dc43723a3e086238ebaaa5b2413f75f9b53 --- browser/components/nsBrowserGlue.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 4dd48a69a1d2..020903095084 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -1735,7 +1735,7 @@ BrowserGlue.prototype = { // eslint-disable-next-line complexity _migrateUI: function BG__migrateUI() { - const UI_VERSION = 50; + const UI_VERSION = 51; const BROWSER_DOCURL = "chrome://browser/content/browser.xul"; let currentUIVersion; @@ -2095,6 +2095,16 @@ BrowserGlue.prototype = { } } + if (currentUIVersion < 51) { + // Switch to compact UI density if the user is using a formerly compact + // dark or light theme. + let currentTheme = Services.prefs.getCharPref("lightweightThemes.selectedThemeID", ""); + if (currentTheme == "firefox-compact-dark@mozilla.org" || + currentTheme == "firefox-compact-light@mozilla.org") { + Services.prefs.setIntPref("browser.uidensity", 1); + } + } + // Update the migration version. Services.prefs.setIntPref("browser.migration.version", UI_VERSION); },