Open Bug 120771 Opened 23 years ago Updated 2 years ago

[RFE] expanding should scroll new items into view

Categories

(Core :: XUL, enhancement, P3)

x86
All
enhancement

Tracking

()

Future

People

(Reporter: neil, Unassigned)

References

Details

(Keywords: polish)

Attachments

(2 files, 2 obsolete files)

<method name="_toggleOpenState">
        <parameter name="row"/>
        <body>
          <![CDATA[
            var box = this.outlinerBoxObject;
            var c = box.view.rowCount;
            box.view.toggleOpenState(row);
            var l = box.view.rowCount - c;
            if (l > 0) {
              var p = box.getPageCount();
              if (l >= p)
                box.ensureRowIsVisible(row + p - 1);
              else
                box.ensureRowIsVisible(row + l);
            }
          ]]>
        </body>
      </method>
Attached patch Proposed patch (obsolete) — Splinter Review
Sorry for the delay :-(
Keywords: patch, polish, review
Attached patch More readable (obsolete) — Splinter Review
Attachment #69241 - Attachment is obsolete: true
Neil, this patch is really more readble and now I understand it better.
But let me think about it a bit.
reassigning
Assignee: hewitt → varga
Severity: minor → enhancement
OS: Windows 95 → All
Priority: -- → P3
Summary: expanding should scroll new items into view → [RFE] expanding should scroll new items into view
Target Milestone: --- → Future
Any progress on that in the meantime?
*** Bug 255618 has been marked as a duplicate of this bug. ***
Is there something wrong with this patch? Why has it not been checked in, nor
commented on in 2 and a half years?
Attached patch update patchSplinter Review
Assignee: Jan.Varga → enndeakin
Attachment #69247 - Attachment is obsolete: true
Status: NEW → ASSIGNED
My original patch assumed that the row to be toggled was already visible.
This one does not. Instead it follows Windows behaviour. Of course you may not want to follow windows behaviour, but here's a description:
* If you're collapsing, then always ensure the row is visible
* If the row to expand is off the top, then do nothing else
* If all the rows will fit, then make them fit
* Otherwise scroll the row to the top
Neil, did you want someone to review this?
(In reply to comment #11)
>Neil, did you want someone to review this?
Depends. I slavishly copied what appears to be Windows behaviour, but you may want to go with something conceptually simpler, e.g. a) toggled row should always be made visible b) as many new rows as possible should be made visible.
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
The description in comment 10 suggests that the row the user just toggled can move to a new position visibly. That seems odd to me, thinking about it. Nothing special seems to happen on Mac (at least in Finder and Safari) when toggling treeitems, so maybe this should be Windows only.
Although usually I am an opponent of trying to predict what the user wants, this is an edge case. I can't think of a time when you'd be expanding a tree node and NOT want to see the children. As it is now, if your parent node is the bottom line in a window, expanding the node appears to do nothing because the children appear outside of the window. Your next move will have to be to scroll them into view, so there's no reason I can think of not to do it automatically.
Assignee: enndeakin → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: