Bug 1482439 - Add a titlebar checkbox in customize dialog. r=mkmelin

This commit is contained in:
Richard Marti 2018-08-11 14:40:58 +02:00
Родитель cc9429d77b
Коммит c080509d54
3 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -81,6 +81,16 @@ function initDialog() {
if (mode == "text") if (mode == "text")
smallIconsCheckbox.disabled = true; 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. // Build up the palette of other items.
buildPalette(); buildPalette();
@ -532,6 +542,15 @@ function updateIconSize(aSize) {
return updateToolboxProperty("iconsize", aSize, "large"); 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) { function updateToolbarMode(aModeValue) {
var mode = updateToolboxProperty("mode", aModeValue, "icons"); var mode = updateToolboxProperty("mode", aModeValue, "icons");

Просмотреть файл

@ -92,6 +92,9 @@
<button id="newtoolbar" label="&addNewToolbar.label;" oncommand="addNewToolbar();" icon="add"/> <button id="newtoolbar" label="&addNewToolbar.label;" oncommand="addNewToolbar();" icon="add"/>
<button id="restoreDefault" label="&restoreDefaultSet.label;" oncommand="restoreDefaultSet();" icon="revert"/> <button id="restoreDefault" label="&restoreDefaultSet.label;" oncommand="restoreDefaultSet();" icon="revert"/>
#ifndef MOZ_SUITE
<checkbox id="showTitlebar" oncommand="updateTitlebar();" label="&showTitltbar.label;" hidden="true"/>
#endif
</box> </box>
<separator class="groove"/> <separator class="groove"/>

Просмотреть файл

@ -13,5 +13,6 @@
<!ENTITY useSmallIcons.label "Use Small Icons"> <!ENTITY useSmallIcons.label "Use Small Icons">
<!ENTITY restoreDefaultSet.label "Restore Default Set"> <!ENTITY restoreDefaultSet.label "Restore Default Set">
<!ENTITY addNewToolbar.label "Add New Toolbar"> <!ENTITY addNewToolbar.label "Add New Toolbar">
<!ENTITY showTitltbar.label "Show Title Bar">
<!ENTITY saveChanges.label "Done"> <!ENTITY saveChanges.label "Done">
<!ENTITY undoChanges.label "Undo Changes"> <!ENTITY undoChanges.label "Undo Changes">