Make autocomplete work using selection without the extra hacky property.

This commit is contained in:
hyatt%netscape.com 2002-10-11 00:28:28 +00:00
Родитель 8aaafdccf0
Коммит 424961c55a
5 изменённых файлов: 15 добавлений и 12 удалений

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

@ -402,13 +402,15 @@ nsAutoCompleteController::GetRowProperties(PRInt32 index, nsISupportsArray *prop
PRInt32 currentIndex;
mSelection->GetCurrentIndex(&currentIndex);
/*
if (index == currentIndex) {
nsCOMPtr<nsIAtomService> atomSvc = do_GetService("@mozilla.org/atom-service;1");
nsCOMPtr<nsIAtom> atom;
atomSvc->GetAtom(NS_LITERAL_STRING("menuactive").get(), getter_AddRefs(atom));
properties->AppendElement(atom);
}
*/
return NS_OK;
}

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

@ -382,6 +382,7 @@
<binding id="autocomplete-result-popup" extends="chrome://global/content/bindings/popup.xml#popup">
<resources>
<stylesheet src="chrome://global/skin/tree.css"/>
<stylesheet src="chrome://global/skin/autocomplete.css"/>
</resources>
@ -417,7 +418,7 @@
<property name="selectedIndex"
onget="return this.tree.currentIndex;">
<setter><![CDATA[
this.tree.currentIndex = val;
this.tree.treeBoxObject.selection.select(val);
if (this.tree.treeBoxObject.height > 0)
this.tree.treeBoxObject.ensureRowIsVisible(val < 0 ? 0 : val);
return val;
@ -643,9 +644,9 @@
<handler event="mousemove"><![CDATA[
if (new Date() - this.mLastMoveTime > 30) {
var rc = this.getHoverCell(event);
if (rc && rc.row != this.parentNode.currentIndex)
this.parentNode.currentIndex = rc.row;
this.mLastMoveTime = new Date();
if (rc && rc.row != this.parentNode.currentIndex)
this.parentNode.treeBoxObject.selection.select(rc.row);
this.mLastMoveTime = new Date();
}
]]></handler>
</handlers>

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

@ -836,4 +836,4 @@ wizardpage {
.wizard-buttons {
-moz-binding: url("chrome://global/content/bindings/wizard.xml#wizard-buttons");
}
}

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

@ -113,10 +113,10 @@ textbox {
padding-left: 8px;
}
.autocomplete-treebody:-moz-tree-row(menuactive) {
background-color: Highlight;
treechildren.autocomplete-treebody:-moz-tree-row(selected) {
background-color: Highlight;
}
.autocomplete-treebody:-moz-tree-cell-text(menuactive) {
treechildren.autocomplete-treebody:-moz-tree-cell-text(selected) {
color: HighlightText !important;
}

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

@ -102,11 +102,11 @@ popup[type="autocomplete"],
padding-left: 8px;
}
.autocomplete-treebody:-moz-tree-row(menuactive) {
background-color: Highlight;
treechildren.autocomplete-treebody:-moz-tree-row(selected) {
background-color: Highlight;
}
.autocomplete-treebody:-moz-tree-cell-text(menuactive) {
treechildren.autocomplete-treebody:-moz-tree-cell-text(selected) {
color: HighlightText !important;
}