Closed Bug 372206 Opened 17 years ago Closed 6 years ago

Horizontal Scrolling for XUL Trees with only a Single Primary Column

Categories

(Core :: XUL, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: mimecuvalo, Assigned: janv)

References

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2
Build Identifier: 

Opening this bug by Martijn Wargers as an offshoot of bug 212789 which also deals with horizontal scrolling.  I'll just repeat what I said there:

I think a lot of users have an issue with the tree columns that have primary="true" and not being able to see the hierarchy if you go too deep into the tree (e.g. FireFTP or DOM Inspector or the Bookmarks Manager).  I'll attach a screenshot of what I'm talking about - the Folder pane in the Windows File Explorer has horizontal scrolling that would be great to have.  I know primary type columns aren't necessarily lone columns (as in DOM Inspector) so it would look like crap to add scrolling to an individual primary column.  But would it be feasible maybe to perhaps "shift" the contents of a column to the left as you went deeper into the tree?  Or maybe have a special type of horizontal scrolling tree to accommodate trees that just have a single primary column?  I suppose that's asking a bit much - but I thought I'd throw the idea out there.

Reproducible: Always
Well, the dom inspector needing a horizontal scrollbar is bug 112832.
The bookmarks manager needing a horizontal scrollbar is bug 371592.
FireFTP is an extension, so that should be done by the extension author, so doesn't need a bug.
So I'm not completely sure what this bug is about.
You want tree columns that have primary="true" to always have horizontal scrollbars?
I examined the bugs regarding the Dom inspector and Bookmarks manager but those bugs seems to want to throw out the tree view altogether for something totally different. (according to this attachment: https://bugzilla.mozilla.org/attachment.cgi?id=248210 that is in a related bug 363403 to bug 112832)

I am the author of FireFTP so, believe me, I would like to add horizontal scrolling to the directory tree but I cannot.  It's simply not possible to do so.  
Attached image Better depiction
Notice the bookmarks manager can't scroll to see the entire tree whereas in Windows File Explorer you may do so.
Attachment #256872 - Attachment is obsolete: true
Hmm, ok, I (hopefully) think what I know what you mean.
Basically, you never want a treecell to be cropped, right? Instead, you want the horizontal scrollbar to appear in the tree, when there isn't enough room.
Status: UNCONFIRMED → NEW
Ever confirmed: true
> Basically, you never want a treecell to be cropped, right? Instead, you want
> the horizontal scrollbar to appear in the tree, when there isn't enough room.

Yes.  But again, for treecols with the attribute 'primary' set to true.  Obviously, treecells would still be cropped for regular columns.

I am implementing a hack to work around this.

So, basically I go through each of the items in the tree and programmatically try to find the row that is farthest out to the right.  With that, I adjust the width of the column manually.  This happens every time an item in the tree is collapsed/expanded.

For anybody else out there that would like this (*cough* bookmarks manager *cough*):

var max = 100;
for (var z = 0; z < this.rowCount; ++z) {
  var x = {}; var y = {}; var width = {}; var height = {};
  this.treebox.getCoordsForCellItem(z, this.treebox.columns["localdirname"], "text", x, y, width, height);

  if (x.value + 100 > max) {
    max = x.value + 100;
  }
}

$('localdirname').setAttribute('width', max);
Status: NEW → RESOLVED
Closed: 17 years ago
Depends on: 399961
Resolution: --- → FIXED
I'm sorry, this can't be fixed, unless you know what bug did fix this.
Resolution: FIXED → WORKSFORME
Oh, sorry - I guess I wasn't clear.  This isn't fixed on the trunk or anything - this is in my extension's code (FireFTP) - my own javascript works around it - that's what I'm saying.
Ok, thanks, this bug still needs to be open then, because this might be something that should be fixed in Firefox itself.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: xptoolkit.trees → xptoolkit.widgets
This is a problem for a lot of applications/extensions that are using a nsITreeView to display hierarchical items, especially common when trying to show a drive explorer tree.

Komodo hits this problem when trying to display a directory contents and it's sub-folders are too deep to fit within a side-bar, so everything becomes cropped and eventually you cannot dig deeper into the tree.

It would be nice to be able to set an attribute on the treecol (i.e. "autoadjustwidth=true" or similar) to specify that the width of the treecol auto-adjusts itself, enabling all items to be seen without being cropped. I don't believe this feature needs to be limited to the primary column.
Bug 647704 covers something similar but broader than this bug.  (It doesn't only concern single, multi-level columns.)  I suggest changing the scope of this bug to what comment 7 attempts to deal with: autosizing the primary column when a container is expanded, so that the newly-revealed rows' cell contents can be shown in their entirety, without ellipsis (although a horizontal scrollbar may get involved.)
(And I can't remember the bug/newsgroup thread where someone is talking about adding the necessary API to be able to get the dimensions that a cell *would* be without cropping.)
I don't think anyone is going to work on this given the plan to remove the XUL "tree" widget (bug 1446335).
Status: REOPENED → RESOLVED
Closed: 17 years ago6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: