Bug 1655014 - use "medium" as default font size, and clear font size when that is used. r=henry

Differential Revision: https://phabricator.services.mozilla.com/D112472

--HG--
extra : rebase_source : 8a8aeb0af5e1a3d3e983586a88a0f1270d1247f1
This commit is contained in:
Magnus Melin 2021-04-17 20:13:33 +03:00
Родитель 3c62620b1d
Коммит 49d051571c
3 изменённых файлов: 18 добавлений и 3 удалений

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

@ -8753,7 +8753,7 @@ function loadHTMLMsgPrefs() {
doStatefulCommand("cmd_fontFace", fontFace, true);
}
let fontSize = Services.prefs.getCharPref("msgcompose.font_size", "");
let fontSize = Services.prefs.getCharPref("msgcompose.font_size", "3");
EditorSetFontSize(fontSize);
let bodyElement = GetBodyElement();

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

@ -661,8 +661,23 @@ function onFontFaceChange() {
fontFaceMenuList.selectedItem = foundFont;
}
/**
* Changes the font size for the selection or at the insertion point. This
* requires an integer from 1-7 as a value argument (x-small - xxx-large)
*
* @param {"1"|"2"|"3"|"4"|"5"|"6"|"7"} size - The font size.
*/
function EditorSetFontSize(size) {
GetCurrentEditor().document.execCommand("fontSize", false, size);
// For normal/medium size (that is 3), we clear size.
if (size == "3") {
EditorRemoveTextProperty("font", "size");
// Also remove big and small,
// else it will seem like size isn't changing correctly
EditorRemoveTextProperty("small", "");
EditorRemoveTextProperty("big", "");
} else {
GetCurrentEditor().document.execCommand("fontSize", false, size);
}
// Enable or Disable the toolbar buttons according to the font size.
goUpdateCommand("cmd_decreaseFontStep");
goUpdateCommand("cmd_increaseFontStep");

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

@ -934,7 +934,7 @@ pref("mailnews.customHeaders", "");
// default msg compose font prefs
pref("msgcompose.font_face", "");
pref("msgcompose.font_size", "");
pref("msgcompose.font_size", "3");
// If true, let the user agent use default colors (don't set text_color and
// background_color on the message body).
pref("msgcompose.default_colors", true);