Bug 1475817 - Part 3: Convert simple <listbox> to <richlistbox>. r=jorgk DONTBUILD
--- a/editor/ui/dialogs/content/EdDictionary.js
+++ b/editor/ui/dialogs/content/EdDictionary.js
@@ -91,19 +91,19 @@ function ReplaceWord()
try {
gSpellChecker.RemoveWordFromDictionary(selItem.label);
} catch (e) {}
try {
// Add to the dictionary list
gSpellChecker.AddWordToDictionary(gWordToAdd);
- // Just change the text on the selected item
- // instead of rebuilding the list
- selItem.label = gWordToAdd;
+ // Just change the text on the selected item instead of rebuilding the list.
+ // The items are richlist items, so the label sits in the first child.
+ selItem.firstChild.setAttribute("value", gWordToAdd);
} catch (e) {
// Rebuild list and select the word - it was probably already in the list
dump("Exception occurred adding word in ReplaceWord\n");
FillDictionaryList();
SelectWordToAddInList();
}
}
}
--- a/editor/ui/dialogs/content/EdDictionary.xul
+++ b/editor/ui/dialogs/content/EdDictionary.xul
@@ -34,17 +34,20 @@
</row>
<row>
<label value="&DictionaryList.label;"
control="DictionaryList"
accesskey="&DictionaryList.accessKey;"/>
<spacer/>
</row>
<row>
- <listbox rows="8" id="DictionaryList" flex="1"/>
+ <richlistbox id="DictionaryList"
+ class="theme-listbox"
+ flex="1"
+ height="150px"/>
<vbox flex="1">
<button id="ReplaceWord" oncommand="ReplaceWord()" label="&ReplaceButton.label;"
accesskey="&ReplaceButton.accessKey;"/>
<spacer class="spacer"/>
<button id="RemoveWord" oncommand="RemoveWord()" label="&RemoveButton.label;"
accesskey="&RemoveButton.accessKey;"/>
<spacer class="spacer"/>
<spacer flex="1"/>
--- a/editor/ui/dialogs/content/EdSpellCheck.js
+++ b/editor/ui/dialogs/content/EdSpellCheck.js
@@ -261,17 +261,17 @@ function CheckWord()
function SelectSuggestedWord()
{
if (gAllowSelectWord)
{
var selectedItem
if (gDialog.SuggestedList.selectedItem)
{
- var selValue = gDialog.SuggestedList.selectedItem.getAttribute("label");
+ var selValue = gDialog.SuggestedList.selectedItem.label;
gDialog.ReplaceWordInput.value = selValue;
gPreviousReplaceWord = selValue;
}
else
{
gDialog.ReplaceWordInput.value = gPreviousReplaceWord;
}
SetReplaceEnable();
@@ -289,17 +289,17 @@ function ChangeReplaceWord()
var newIndex = -1;
var newSelectedItem;
var replaceWord = TrimString(gDialog.ReplaceWordInput.value);
if (replaceWord)
{
for (var i = 0; i < gDialog.SuggestedList.getRowCount(); i++)
{
var item = gDialog.SuggestedList.getItemAtIndex(i);
- if (item.getAttribute("label") == replaceWord)
+ if (item.label == replaceWord)
{
newSelectedItem = item;
break;
}
}
}
gDialog.SuggestedList.selectedItem = newSelectedItem;
--- a/editor/ui/dialogs/content/EdSpellCheck.xul
+++ b/editor/ui/dialogs/content/EdSpellCheck.xul
@@ -53,18 +53,20 @@
<label id="SuggestedListLabel" value="&suggestions.label;"
control="SuggestedList"
accesskey="&suggestions.accessKey;"/>
<grid flex="1">
<columns><column flex="1"/><column/></columns>
<rows>
<row flex="1">
<!-- BUG! setting class="MinWidth20em" on tree doesn't work (width=0) -->
- <listbox rows="6" id="SuggestedList" onselect="SelectSuggestedWord()"
- ondblclick="if (gAllowSelectWord) Replace(event.target.getAttribute('label'));"/>
+ <richlistbox id="SuggestedList"
+ class="theme-listbox"
+ onselect="SelectSuggestedWord()"
+ ondblclick="if (gAllowSelectWord) Replace(event.target.label);"/>
<vbox>
<grid>
<columns><column class="spell-check" flex="1"/><column class="spell-check" flex="1"/></columns>
<rows>
<row>
<button id="Replace" label="&replaceButton.label;"
oncommand="Replace(gDialog.ReplaceWordInput.value);"
accesskey="&replaceButton.accessKey;"/>
--- a/mailnews/base/prefs/content/am-identities-list.js
+++ b/mailnews/base/prefs/content/am-identities-list.js
@@ -45,18 +45,21 @@ function refreshIdentityList(aSelectInde
// Build the list from the identities array.
let identities = gAccount.identities;
for (let identity of fixIterator(identities,
Ci.nsIMsgIdentity))
{
if (identity.valid)
{
- let listitem = document.createElement("listitem");
- listitem.setAttribute("label", identity.identityName);
+ let label = document.createElement("label");
+ label.setAttribute("value", identity.identityName);
+
+ let listitem = document.createElement("richlistitem");
+ listitem.appendChild(label);
listitem.setAttribute("key", identity.key);
gIdentityListBox.appendChild(listitem);
}
}
// Ensure one identity is always selected.
if (!aSelectIndex || aSelectIndex < 0)
aSelectIndex = 0;
--- a/mailnews/base/prefs/content/am-identities-list.xul
+++ b/mailnews/base/prefs/content/am-identities-list.xul
@@ -36,22 +36,22 @@
<key keycode="VK_DELETE" command="cmd_delete"/>
</keyset>
<label control="identitiesList">&identitiesListManageDesc.label;</label>
<separator class="thin"/>
<hbox flex="1">
- <listbox id="identitiesList"
- ondblclick="onEdit(event);"
- onselect="updateButtons();"
- seltype="single"
- flex="1"
- style="height: 0px;"/>
+ <richlistbox id="identitiesList"
+ class="theme-listbox"
+ ondblclick="onEdit(event);"
+ onselect="updateButtons();"
+ seltype="single"
+ flex="1"/>
<vbox>
<button id="addButton"
command="cmd_add" label="&identitiesListAdd.label;"
accesskey="&identitiesListAdd.accesskey;"/>
<button id="editButton" disabled="true"
command="cmd_edit" label="&identitiesListEdit.label;"
accesskey="&identitiesListEdit.accesskey;"/>
--- a/mailnews/base/search/content/CustomHeaders.js
+++ b/mailnews/base/search/content/CustomHeaders.js
@@ -166,20 +166,17 @@ function GetListItemAttributeStr(listite
if (listitem)
return TrimString(listitem.getAttribute("label"));
return "";
}
function addRow(newHdr)
{
- var listitem = document.createElement("listitem");
- listitem.setAttribute("label", newHdr);
- gHdrsList.appendChild(listitem);
- return listitem;
+ return gHdrsList.appendItem(newHdr, "");
}
function updateAddButton(aDisable)
{
// only update the button if the disabled state changed
if (aDisable == gAddButton.disabled)
return;
--- a/mailnews/base/search/content/CustomHeaders.xul
+++ b/mailnews/base/search/content/CustomHeaders.xul
@@ -1,13 +1,17 @@
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+#ifdef MOZ_THUNDERBIRD
+<?xml-stylesheet href="chrome://messenger/skin/" type="text/css"?>
+#else
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
+#endif
<!DOCTYPE dialog SYSTEM "chrome://messenger/locale/CustomHeaders.dtd">
<dialog id="customHeadersDialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();"
ondialogaccept="return onOk();"
ondialogextra1="onAddHeader();"
ondialogextra2="onRemoveHeader();"
@@ -33,17 +37,20 @@
<label accesskey="&newMsgHeader.accesskey;" control="headerInput" value="&newMsgHeader.label;"/>
</row>
<row>
<textbox id="headerInput" onfocus="this.select();" oninput="onTextInput();"/>
</row>
<row flex="1">
<vbox>
- <listbox id="headerList" flex="1" onselect="updateRemoveButton();" />
+ <richlistbox id="headerList"
+ class="theme-listbox"
+ flex="1"
+ onselect="updateRemoveButton();" />
</vbox>
<vbox>
<button id="addButton"
label="&addButton.label;"
accesskey="&addButton.accesskey;"
dlgtype="extra1"/>
<button id="removeButton"
--- a/mailnews/jar.mn
+++ b/mailnews/jar.mn
@@ -97,17 +97,17 @@ messenger.jar:
content/messenger/junkLog.js (base/content/junkLog.js)
content/messenger/jsTreeView.js (base/content/jsTreeView.js)
#ifndef MOZ_THUNDERBIRD
content/messenger/searchTermOverlay.js (base/search/content/searchTermOverlay.js)
content/messenger/searchTermOverlay.xul (base/search/content/searchTermOverlay.xul)
#else
content/messenger/searchTerm.js (base/search/content/searchTermOverlay.js)
#endif
- content/messenger/CustomHeaders.xul (base/search/content/CustomHeaders.xul)
+* content/messenger/CustomHeaders.xul (base/search/content/CustomHeaders.xul)
content/messenger/CustomHeaders.js (base/search/content/CustomHeaders.js)
* content/messenger/FilterEditor.xul (base/search/content/FilterEditor.xul)
content/messenger/FilterEditor.js (base/search/content/FilterEditor.js)
content/messenger/searchWidgets.xml (base/search/content/searchWidgets.xml)
content/messenger/viewLog.xul (base/search/content/viewLog.xul)
content/messenger/viewLog.js (base/search/content/viewLog.js)
content/messenger/messengercompose/askSendFormat.js (compose/content/askSendFormat.js)
content/messenger/messengercompose/askSendFormat.xul (compose/content/askSendFormat.xul)