From c080509d541fa2d3ad4b867b753180a04df96911 Mon Sep 17 00:00:00 2001 From: Richard Marti Date: Sat, 11 Aug 2018 14:40:58 +0200 Subject: [PATCH] Bug 1482439 - Add a titlebar checkbox in customize dialog. r=mkmelin --- common/src/customizeToolbar.js | 19 +++++++++++++++++++ common/src/customizeToolbar.xul | 3 +++ .../chrome/messenger/customizeToolbar.dtd | 1 + 3 files changed, 23 insertions(+) diff --git a/common/src/customizeToolbar.js b/common/src/customizeToolbar.js index afcc919c5a..da2fb42978 100644 --- a/common/src/customizeToolbar.js +++ b/common/src/customizeToolbar.js @@ -81,6 +81,16 @@ function initDialog() { if (mode == "text") smallIconsCheckbox.disabled = true; + if (AppConstants.MOZ_APP_NAME == "thunderbird") { + let titlebarCheckbox = document.getElementById("showTitlebar"); + if (window.opener && + (window.opener.document.documentElement.getAttribute("windowtype") == + "mail:3pane")) { + titlebarCheckbox.hidden = false; + titlebarCheckbox.checked = !Services.prefs.getBoolPref("mail.tabs.drawInTitlebar"); + } + } + // Build up the palette of other items. buildPalette(); @@ -532,6 +542,15 @@ function updateIconSize(aSize) { return updateToolboxProperty("iconsize", aSize, "large"); } +function updateTitlebar() { + let titlebarCheckbox = document.getElementById("showTitlebar"); + Services.prefs.setBoolPref("mail.tabs.drawInTitlebar", !titlebarCheckbox.checked); + + // Bring the customizeToolbar window to front (on linux it's behind the main + // window). Otherwise the customization window gets left in the background. + setTimeout(function() { window.focus() }, 100); +} + function updateToolbarMode(aModeValue) { var mode = updateToolboxProperty("mode", aModeValue, "icons"); diff --git a/common/src/customizeToolbar.xul b/common/src/customizeToolbar.xul index fece3d72e2..e3028a3958 100644 --- a/common/src/customizeToolbar.xul +++ b/common/src/customizeToolbar.xul @@ -92,6 +92,9 @@