Bug 1128177 - Dialog to clear data when exiting Firefox needs more space between two columns (in-content preferences). r=Gijs

--HG--
extra : rebase_source : 6e348fb56dfdd0cb7e6ea80a4a02464792655c71
This commit is contained in:
Jared Wein 2015-02-05 09:09:23 -05:00
Родитель 5447ea3b46
Коммит ffe427c125
4 изменённых файлов: 27 добавлений и 4 удалений

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

@ -110,6 +110,9 @@ let gSubDialog = {
this.injectXMLStylesheet(styleSheetURL);
}
// Provide the ability for the dialog to know that it is being loaded "in-content".
this._frame.contentDocument.documentElement.setAttribute("subdialog", "true");
// Make window.close calls work like dialog closing.
let oldClose = this._frame.contentWindow.close;
this._frame.contentWindow.close = function() {

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

@ -4,6 +4,15 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
let gSanitizeDialog = Object.freeze({
init: function() {
let customWidthElements = document.getElementsByAttribute("dialogWidth", "*");
let isInSubdialog = document.documentElement.hasAttribute("subdialog");
for (let element of customWidthElements) {
element.style.width = element.getAttribute(isInSubdialog ? "subdialogWidth" : "dialogWidth");
}
onClearHistoryChanged();
},
onClearHistoryChanged: function () {
let downloadsPref = document.getElementById("privacy.clearOnShutdown.downloads");
let historyPref = document.getElementById("privacy.clearOnShutdown.history");

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

@ -19,9 +19,10 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
dlgbuttons="accept,cancel,help"
ondialoghelp="openPrefsHelp()"
style="width: &dialog.width2;;"
dialogWidth="&dialog.width2;"
subdialogWidth="&inContentDialog.width;"
title="&sanitizePrefs2.title;"
onload="gSanitizeDialog.onClearHistoryChanged();">
onload="gSanitizeDialog.init();">
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/javascript" src="chrome://browser/content/preferences/sanitize.js"/>
@ -48,7 +49,8 @@
<caption label="&historySection.label;"/>
<grid flex="1">
<columns>
<column style="width: &column.width2;"/>
<column dialogWidth="&column.width2;"
subdialogWidth="&inContentColumn.width;"/>
<column flex="1"/>
</columns>
<rows>
@ -80,7 +82,8 @@
<caption label="&dataSection.label;"/>
<grid flex="1">
<columns>
<column style="width: &column.width2;"/>
<column dialogWidth="&column.width2;"
subdialogWidth="&inContentColumn.width;"/>
<column flex="1"/>
</columns>
<rows>

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

@ -60,3 +60,11 @@ that require it. -->
at half of the dialog width. -->
<!ENTITY dialog.width2 "34em">
<!ENTITY column.width2 "17em">
<!-- LOCALIZATION NOTE (inContentDialog.width): width of the Clear Recent History and
Clear History on Shutdown subdialogs in the in-content preferences. Should be
large enough to contain the item* strings above on a single line. The column
width adjusts the width of the first column in the dialog. You can set the
column width to a value that makes the dialog look visually balanced, or at half
of the dialog width if unsure. -->
<!ENTITY inContentDialog.width "34em">
<!ENTITY inContentColumn.width "24em">