Fixing Bug 454632 - Resizing tree widget always re-scrolls to current index. r=enndeakin,sr=bz. Patch by Stephen Lau <steve@grommit.com>.

This commit is contained in:
Nick Kreeger 2009-01-13 10:50:26 -08:00
Родитель 9e4c216172
Коммит 77cbc0d00a
3 изменённых файлов: 20 добавлений и 9 удалений

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

@ -459,6 +459,7 @@ GK_ATOM(isindex, "isindex")
GK_ATOM(ismap, "ismap")
GK_ATOM(kbd, "kbd")
GK_ATOM(noautofocus, "noautofocus")
GK_ATOM(keepcurrentinview, "keepcurrentinview")
GK_ATOM(key, "key")
GK_ATOM(keycode, "keycode")
GK_ATOM(keydown, "keydown")

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

@ -451,6 +451,10 @@ nsTreeBodyFrame::ReflowFinished()
if (mTopRowIndex > lastPageTopRow)
ScrollToRowInternal(parts, lastPageTopRow);
nsIContent *treeContent = GetBaseElement();
if (treeContent->AttrValueIs(kNameSpaceID_None,
nsGkAtoms::keepcurrentinview,
nsGkAtoms::_true, eCaseMatters)) {
// make sure that the current selected item is still
// visible after the tree changes size.
nsCOMPtr<nsITreeSelection> sel;
@ -461,6 +465,7 @@ nsTreeBodyFrame::ReflowFinished()
if (currentIndex != -1)
EnsureRowIsVisibleInternal(parts, currentIndex);
}
}
if (!FullScrollbarsUpdate(PR_FALSE)) {
return PR_FALSE;

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

@ -105,6 +105,11 @@
true
#endif
</field>
<property name="keepCurrentInView"
onget="return (this.getAttribute('keepcurrentinview') == 'true');"
onset="if (val) this.setAttribute('keepcurrentinview', 'true');
else this.removeAttribute('keepcurrentinview'); return val;"/>
<property name="enableColumnDrag"
onget="return this.hasAttribute('enableColumnDrag');"
onset="if (val) this.setAttribute('enableColumnDrag', 'true');