From f4539bc274ae006327de2da6d03c729747d568da Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Tue, 29 May 2007 19:55:11 +0000 Subject: [PATCH] Bug 362680: can't focus single item in a tree using the keyboard, patch by Ori Avtalion , r=enndeakin git-svn-id: svn://10.0.0.236/trunk@227182 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/toolkit/content/widgets/tree.xml | 477 ++++++++++++----------- 1 file changed, 242 insertions(+), 235 deletions(-) diff --git a/mozilla/toolkit/content/widgets/tree.xml b/mozilla/toolkit/content/widgets/tree.xml index 59ca932cc4e..baacbe870ce 100644 --- a/mozilla/toolkit/content/widgets/tree.xml +++ b/mozilla/toolkit/content/widgets/tree.xml @@ -389,6 +389,236 @@ + + + + + + 0 ? c > edge : c < edge) { + if (this.view.selection.isSelected(edge) && this.view.selection.count <= 1) + return; + c = edge; + } + + var cellSelType = this._cellSelType; + if (cellSelType) { + var column = this.view.selection.currentColumn; + if (!column) + return; + + while ((offset > 0 ? c <= edge : c >= edge) && !this.view.isSelectable(c, column)) + c += offset; + if (offset > 0 ? c > edge : c < edge) + return; + } + + if (!this._isAccelPressed(event)) + this.view.selection.timedSelect(c, this._selectDelay); + else // Ctrl+Up/Down moves the anchor without selecting + this.currentIndex = c; + this.treeBoxObject.ensureRowIsVisible(c); + ]]> + + + + + + + + + + + + + + + + + + 0) { + i += p - 1; + if (c >= i) { + i = c + p; + this.treeBoxObject.ensureRowIsVisible(i > edge ? edge : i); + } + i = i > edge ? edge : i; + + } else { + if (c <= i) { + i = c <= p ? 0 : c - p; + this.treeBoxObject.ensureRowIsVisible(i); + } + } + this.view.selection.timedSelect(i, this._selectDelay); + ]]> + + + + + + + + + 0) { + i += p - 1; + if (c >= i) { + i = c + p; + this.treeBoxObject.ensureRowIsVisible(i > edge ? edge : i); + } + // Extend the selection from the existing pivot, if any + this.view.selection.rangedSelect(-1, i > edge ? edge : i, this._isAccelPressed(event)); + + } else { + + if (c <= i) { + i = c <= p ? 0 : c - p; + this.treeBoxObject.ensureRowIsVisible(i); + } + // Extend the selection from the existing pivot, if any + this.view.selection.rangedSelect(-1, i, this._isAccelPressed(event)); + } + + ]]> + + + + + + + + + + + + + + + + + + @@ -553,252 +783,29 @@ ]]> - = 0 && !this.view.isSelectable(c, column)) - c--; - if (c < 0) - return; - } - - if (!this._isAccelPressed(event)) - this.view.selection.timedSelect(c, this._selectDelay); - else // Ctrl+Up moves the anchor without selecting - this.currentIndex = c; - this.treeBoxObject.ensureRowIsVisible(c); - ]]> - + modifiers="accel any" action="_moveByOffset(-1, 0, event);"/> - - + modifiers="accel any" action="_moveByOffset(1, this.view.rowCount - 1, event);"/> - - + modifiers="accel any, shift" action="_moveByOffsetShift(-1, 0, event);"/> - - + modifiers="accel any, shift" action="_moveByOffsetShift(1, this.view.rowCount - 1, event);"/> - - + modifiers="accel any" action="_moveByPage(-1, 0, event);"/> - = i) { - i = c + p; - this.treeBoxObject.ensureRowIsVisible(i > l ? l : i); - } - this.view.selection.timedSelect(i > l ? l : i, this._selectDelay); - ]]> - + modifiers="accel any" action="_moveByPage(1, this.view.rowCount - 1, event);"/> - - + modifiers="accel any, shift" action="_moveByPageShift(-1, 0, event);"/> - = i) { - i = c + p; - this.treeBoxObject.ensureRowIsVisible(i > l ? l : i); - } - // Extend the selection from the existing pivot, if any - this.view.selection.rangedSelect(-1, i > l ? l : i, this._isAccelPressed(event)); - ]]> - + modifiers="accel any, shift" action="_moveByPageShift(1, this.view.rowCount - 1, event);"/> - - + modifiers="accel any" action="_moveToEdge(0, event);"/> - - + modifiers="accel any" action="_moveToEdge(this.view.rowCount - 1, event);"/> - - + modifiers="accel any, shift" action="_moveToEdgeShift(0, event);"/> - - + modifiers="accel any, shift" action="_moveToEdgeShift(this.view.rowCount - 1, event);"/>