Bug 1475817 - Part 3: Convert simple <listbox> to <richlistbox>. r=jorgk DONTBUILD

This commit is contained in:
Richard Marti 2018-07-16 21:26:11 +02:00
Родитель aa3c096a11
Коммит bb6ba557c4
9 изменённых файлов: 34 добавлений и 22 удалений

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

@ -96,9 +96,9 @@ function ReplaceWord()
// 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");

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

@ -39,7 +39,10 @@
<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;"/>

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

@ -266,7 +266,7 @@ function SelectSuggestedWord()
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;
}
@ -294,7 +294,7 @@ function ChangeReplaceWord()
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;

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

@ -58,8 +58,10 @@
<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>

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

@ -50,8 +50,11 @@ function refreshIdentityList(aSelectIndex)
{
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);
}

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

@ -41,12 +41,12 @@
<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"

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

@ -171,10 +171,7 @@ function GetListItemAttributeStr(listitem)
function addRow(newHdr)
{
var listitem = document.createElement("listitem");
listitem.setAttribute("label", newHdr);
gHdrsList.appendChild(listitem);
return listitem;
return gHdrsList.appendItem(newHdr, "");
}
function updateAddButton(aDisable)

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

@ -2,7 +2,11 @@
<!-- 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"
@ -38,7 +42,10 @@
<row flex="1">
<vbox>
<listbox id="headerList" flex="1" onselect="updateRemoveButton();" />
<richlistbox id="headerList"
class="theme-listbox"
flex="1"
onselect="updateRemoveButton();" />
</vbox>
<vbox>

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

@ -102,7 +102,7 @@ messenger.jar:
#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)