Closed Bug 80837 Opened 23 years ago Closed 21 years ago

Twisties and thread lines should not be selected with rows

Categories

(Core :: XUL, enhancement, P3)

x86
Windows 2000
enhancement

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: bugzilla, Assigned: janv)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 6 obsolete files)

Jan, giving this to you because I don't think hyatt will be able to get to 
these for awhile.  If you don't want them, reassign to hyatt, or perhaps I can 
take them.

Twisties and thread lines should not be selected with the rest of the rows.  
Attaching screenshot to clarify.
Attached image screenshot
Summary: Twisties and thread lines should not be selected with rows → [RFE] Twisties and thread lines should not be selected with rows
Priority: -- → P3
Target Milestone: --- → Future
Actually Windows supports two styles of lists:
1. Full row select (i.e. how Mozilla currently does it)
2. "Primary" text only select
My guess is that XUL authors would like to choose the highlight type.
Depends on: 120734
Yeah, that sounds reasonable to ne
[RFE] is deprecated in favor of severity: enhancement.  They have the same meaning.
Severity: normal → enhancement
Summary: [RFE] Twisties and thread lines should not be selected with rows → Twisties and thread lines should not be selected with rows
Latest ideas on IRC:
seltype="single" -> single selection
seltype="primary" -> single selection, but only highlighting primary cell text

Also, the selected and current properties will only reflect on the row or cell
text styles as appropriate for the seltype.
Attached patch Implement seltype="primary" (obsolete) — Splinter Review
Attachment #114211 - Flags: review?(varga)
This doesn't work; the cell text needs to know when either the cell or row is
selected for the text colour, but only when the cell is selected for the border.

Unless there's a way to persuade :-moz-tree-cell-text to inherit colour...
Wait, it's the border that threw me, but that's the "current" style. So, the
rule for "selected" should apply to the cell text for primary seltype, but to
both the row and the cell text for normal seltype, while the rule for "current"
is the either/or approach that I already have. I think that should work...
Attached patch Fixed issue with previous patch (obsolete) — Splinter Review
I also included the diff for folderPane.xul so you would have a tree to look
at.
Attachment #114211 - Attachment is obsolete: true
Attachment #114435 - Flags: review?(varga)
Attachment #114211 - Flags: review?(varga)
Attached patch Updated for bitrot (obsolete) — Splinter Review
Attachment #114435 - Attachment is obsolete: true
Attachment #115377 - Flags: review?(varga)
Attached patch More bitrot (obsolete) — Splinter Review
Attachment #115377 - Attachment is obsolete: true
Attachment #115637 - Flags: review?(varga)
Attachment #115377 - Flags: review?(varga)
Attachment #114435 - Flags: review?(varga)
I see a few issues here:

1. We might want to support multiple selection in primary column, so we should
create a new attribute for this purpose. selstyle ?
I just checked IE's Organize Favorities and I saw it there.

2. seltype="primary" is cached, but this attribute may change
There are two possibilities, check the attribute directly each time or update
cached value when attribute changes

3. lineContext, if I understand it properly, primary reason for this is that we
have a CSS rule -moz-tree-line(selected,focus) to invert line color when the row
is selected. I don't think it solves the problem in general
We can have similar rule for images or twisties (objects inside the cell), what
will we do then ? add lineContext to PaintImage and PaintTwisty too ?
anyway, PaintImage would not work using lineContext, which is actually a context
for row not cell.

I still wonder about pure CSS implementation of this feature.
I know we would have to use "not" selectors, etc
What about a new class instead of attribute ?

We should probably measure perf impact of using "not" in selectors.
Attachment #115637 - Flags: review?(varga) → review-
Attached patch example (obsolete) — Splinter Review
Jan, if you use attachment 115637 [details] [diff] [review] then twisties and images will see the selected
style when the text is selected. I don't know if that's an issue for twisties;
if it is then I would have to fetch the context early like I had to for lines.
If I do it any other way I will have to fetch two sets of cell properties, once
for the parts that are selected and once for the parts that are not selected.

Adding a new attribute is not a big issue apart from adding it to the atom list.

Dynamically watching the attribute is a problem because the tree has no frame.
Refetching the attribute at paint time would otherwise suffice.
Attached patch My go at using CSS (obsolete) — Splinter Review
These CSS rules make it so that <tree class="primary"> only displays the
selection on primary cell text.
Attachment #116082 - Flags: review?(varga)
This looks promising, I'll review it ASAP
The first thing I've noticed is that you forgot to update mac too.
I just checked with Joe, we tend to prefer selstyle="primary" as opposed to using
primary class.

Another issue, drop feedback does not highlight color of the underlying text.

And please update mac too, I'll try it on the mac then
Attachment #116082 - Flags: review?(varga) → review-
Neil, actually I don't understand how your patch works w/o using not selector.
I hope it doesn't count with a bug in our style system.

>.primary > treechildren:-moz-tree-row,
>treechildren:-moz-tree-row {
>}
Do you know why treechildren:-moz-tree-row and other rules don't apply to
.primary trees ?
Am I missing something here ?

Thanks.
.primary > increases the weight of the rule so that it overrules the
non-.primary rules.
Jan, thanks for catching that drop feedback bug.
Attachment #115637 - Attachment is obsolete: true
Attachment #115752 - Attachment is obsolete: true
Attachment #116082 - Attachment is obsolete: true
Attachment #116315 - Flags: superreview?(hewitt)
Attachment #116315 - Flags: review?(varga)
Comment on attachment 116315 [details] [diff] [review]
Patch with drop feedback, mac theme and tree[selstyle="primary"]

Neil, this looks awesome!
r=varga
Attachment #116315 - Flags: review?(varga) → review+
<jag> I would think that a class approach is cleaner...
<jag> If the purpose is purely for display style, class would be the thing to
use. If it's to convey information about the state of the object, then attribute
is more appropriate
<Jan> yeah

Jag is right, but I just found a reason why we need it as an attribute.
I think the tree click handler should be fixed to check for selstyle="primary"
and if that is true, change row selection only if the click targets at the text.
Otherwise it's a bit confusing from the usability point of view.

Neil, would you file a new bug for this issue ?
Thanks
Blocks: 196331
Attachment #116315 - Flags: superreview?(hewitt) → superreview?(jaggernaut)
I measured tree painting after applying this patch and I didn't see any
noticeable perf hit.
Comment on attachment 116315 [details] [diff] [review]
Patch with drop feedback, mac theme and tree[selstyle="primary"]

sr=jag
Attachment #116315 - Flags: superreview?(jaggernaut) → superreview+
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Did this break the highlighting of rows everywhere and folder icons in MailNews?
Bug 198642, bug 198656, bug 198653 etc.
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: