зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
9e4c216172
Коммит
77cbc0d00a
|
@ -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');
|
||||
|
|
Загрузка…
Ссылка в новой задаче