Closed Bug 249141 Opened 22 years ago Closed 17 years ago

Incorrect header cropping on narrow tree columns (ellipsis in wrong column)

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9.2a1

People

(Reporter: mnyromyr, Assigned: neil)

References

Details

(Keywords: verified1.9.1, Whiteboard: [fixed1.9.1b3])

Attachments

(6 files, 1 obsolete file)

When narrowing tree columns, the header text gets cropped eventually and substituted by an ellipsis. But before reaching the minimal width, the ellipsis "jumps" to the left into another column... (see attached screenshot) Example: "Total" column in the MailNews folder pane tree. Found in: Mozilla 1.3 on Win2k, Mozilla 1.8a2/20040627 on Win2k, Thunderbird 0.7 on Win2k, Mozilla 1.8a2/20040629 on Linux Debian Woody. Theme does not matter (tested Classic, Modern, Noia).
Attached image Incorrect cropping
WFM Thunderbird version 0.7+ (20040630)
Mmh I can see it for some header columns and not all. Affected columns are Unread and Total.
It seems as if only the folder and thread pane trees in MailNews and Thunderbird are affected, and only the columns Unread, Total and Size...
Summary: Incorrect header cropping on narrow tree columns → Incorrect header cropping on narrow tree columns (ellipsis in wrong column)
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: xptoolkit.widgets
I can confirm this on both, Thunderbird 2.0 and 3.0. The problem here is that those columns #folderUnreadCol, #folderTotalCol, #folderSizeCol on folder pane and #sizeCol, #unreadCol, #totalCol on message window have text-align: right but the property "crop" has a value "right" (they should be "left").
This patch adds the property crop="left" for those columns on messenger.xul. I'm not sure if this columns follow rtl, ltr directions...
Attachment #354908 - Flags: review?(mkmelin+mozilla)
Assignee: Jan.Varga → pardal
Attachment #354908 - Flags: ui-review?(clarkbw)
Comment on attachment 354908 [details] [diff] [review] proposed patch [Backout: Comment 13] looks good
Attachment #354908 - Flags: ui-review?(clarkbw) → ui-review+
Attachment #354908 - Flags: review?(mkmelin+mozilla) → review+
Comment on attachment 354908 [details] [diff] [review] proposed patch [Backout: Comment 13] This should be crop="start" instead. (treecol should handle rtl vs ltr), and the part for the folder pane is now obsolete - as we don't have those columns for tb3. I'll make those changes and check this in for you
changeset: 1528:ba1e5bafe929 http://hg.mozilla.org/comm-central/rev/ba1e5bafe929 New bug for seamonkey, please.
Status: NEW → RESOLVED
Closed: 17 years ago
Component: XUL → Mail Window Front End
Product: Core → Thunderbird
QA Contact: xptoolkit.widgets → front-end
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 3.0b2
> New bug for seamonkey, please. Nonsens, why should I refile my own bug?
Status: RESOLVED → REOPENED
Component: Mail Window Front End → XUL
Product: Thunderbird → Core
Resolution: FIXED → ---
Target Milestone: Thunderbird 3.0b2 → ---
I don't think the patch is right. Changing the crop value changes the way the columns get cropped when they become too small. While it is debatable on which side you should crop a number, cropping eg. "Total in Thread" to "...Thread" is not desirable. Basically, I do think the bug is in the tree column cropping code - cropping and positioning of the ellipsis is done right until all of the text is gone. Only then the ellipsis "jumps" to the wrong position...
I backed this out due to the unwanted side effects Karsten describes. changeset: 1529:a554aabedc5d http://hg.mozilla.org/comm-central/rev/a554aabedc5d
I don't see a problem here. Ellipsis indicates that a part of a text lacks, and where the ellipsis is positioned shows in which direction it lacks. For example a quote like "...the columns get cropped when they become too small" indicates that there is more text before the citation and "Changing the crop value changes the way..." indicates more text after it. Also the visual effect when I make the place for the text smaller - the ellipsis shows the direction I'm really cropping the text.
The problem is that mTitleWidth wasn't being set in the case of an early return. I had the choice of two approaches. One of the other cases used a break rather than a return, however this means that it ends up recomputing the ellipse width in the case that it can't get any text at all to fit, so I decided to compute the ellipse width directly into mTitleWidth to allow for both early returns. I also decided to set mTitleWidth to zero when even the ellipse does not fit inside the width, as that seems to match the behaviour in other cases.
Assignee: pardal → neil
Status: REOPENED → ASSIGNED
Attachment #355054 - Flags: superreview?(roc)
Attachment #355054 - Flags: review?(enndeakin)
Comment on attachment 355054 [details] [diff] [review] Proposed patch [Checkin: Comment 23 & 27] > if (i == length-1) >- break; >+ return; Doesn't this mean that mTitleWidth will be the width of an ellipsis here? Don't you want it to remain the width of the text?
(In reply to comment #16) >(From update of attachment 355054 [details] [diff] [review]) >> if (i == length-1) >>- break; >>+ return; >Doesn't this mean that mTitleWidth will be the width of an ellipsis here? Don't >you want it to remain the width of the text? No, this is in the left cropping case, and we haven't been able to use any of the characters from the right end of the text. (The right cropping case already has the early return, and it's the incorrect mTitleWidth that causes this bug.)
Does this patch fix bug 344579?
(In reply to comment #16) >(From update of attachment 355054 [details] [diff] [review] [details]) >> if (i == length-1) >>- break; >>+ return; >Doesn't this mean that mTitleWidth will be the width of an ellipsis here? Don't >you want it to remain the width of the text? No, this is in the left cropping case, and we haven't been able to use any of the characters from the right end of the text. (The right cropping case already has the early return, and it's the incorrect mTitleWidth that causes this bug.) (In reply to comment #18) > Does this patch fix bug 344579? It looks to be a very similar bug.
Attached file reftest testcase
Attached file reftest reference file
Attachment #355054 - Flags: superreview?(roc) → superreview+
QA Contact: front-end → xptoolkit.widgets
Attached file testcase
(In reply to comment #12) > I don't think the patch is right. > > Basically, I do think the bug is in the tree column cropping code - cropping > and positioning of the ellipsis is done right until all of the text is gone. > Only then the ellipsis "jumps" to the wrong position... You are absolutely right. The real problem here AFAICS is that the ellipsis for text-align=right with crop=end is rendering wrong. For the other cases is right like this testcase demonstrate. I'm marking my patch as OBSOLETE. But I still thinking the crop for text-align=right should have crop=start, so if someone else agree with this, I could open a new bug and attach that patch to it...
Attachment #354908 - Attachment is obsolete: true
Attachment #355054 - Flags: review?(enndeakin) → review+
Pushed changeset cd085064b5d1 to mozilla-central.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
Blocks: 344579
Attachment #355054 - Flags: approval1.9.1?
Comment on attachment 355054 [details] [diff] [review] Proposed patch [Checkin: Comment 23 & 27] Fixes painting issue reproducible easily in trees but also in other cases (see dependent bug). I can write a simpler branch patch if desired.
Target Milestone: --- → mozilla1.9.2a1
Verified on trunk with the reftest files: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090129 Minefield/3.2a1pre ID:20090129020336 Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2a1pre) Gecko/20090129 Minefield/3.2a1pre ID:20090129033611 Can we checkin the reftest too, please?
Status: RESOLVED → VERIFIED
Flags: in-testsuite?
Hardware: x86 → All
Attachment #355054 - Flags: approval1.9.1? → approval1.9.1+
Pushed changeset 772c508564ee to releases/mozilla1.9.1
Keywords: fixed1.9.1
Verified fixed on 1.9.1 branch with builds on OS X and Windows: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090211 Shiretoko/3.1b3pre Ubiquity/0.1.5 ID:20090211020510 Karsten, were you able to figure out how to get a patch for the reftest?
Attachment #362108 - Flags: review? → review?(roc)
The longer I stare at the trunk tree, the redder it gets - setting checkin-needed.
Keywords: checkin-needed
Whiteboard: [reftest #362108 needs checkin]
Attachment #354908 - Attachment description: proposed patch → proposed patch [Backout: Comment 13]
Attachment #355054 - Attachment description: Proposed patch → Proposed patch [Checkin: Comment 23 & 27]
Comment on attachment 362108 [details] [diff] [review] reftest as a patch [Checkin: See comment 33+34+35] That's the second patch which qimportbz gives me { UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 15: ordinal not in range(128) } for :-/
(In reply to comment #31) > UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position > 15: ordinal not in range(128) Mnyromyr suggested this is triggered by the 'ü' in his name, and he was right: see bug 476994 comment 8. Nothing wrong with the patch.
Attachment #362108 - Attachment description: reftest as a patch → reftest as a patch [Checkin: See comment 33]
Comment on attachment 362108 [details] [diff] [review] reftest as a patch [Checkin: See comment 33+34+35] http://hg.mozilla.org/mozilla-central/rev/57a0f015a43d after fixing context for { patching file layout/reftests/bugs/reftest.list Hunk #1 FAILED at 190 1 out of 1 hunks FAILED } *** I tried to save the qimportbz patch file as UTF-8, which looks fine on Windows GUI, but not in Hg web pages :-/
Flags: in-testsuite? → in-testsuite+
Whiteboard: [reftest #362108 needs checkin] → [needs 1.9.1 landing: reftest #362108] [fixed1.9.1b3]
Comment on attachment 362108 [details] [diff] [review] reftest as a patch [Checkin: See comment 33+34+35] http://hg.mozilla.org/releases/mozilla-1.9.1/rev/4071ed824459 after fixing (back !?) context for { patching file layout/reftests/bugs/reftest.list Hunk #1 FAILED at 203 1 out of 1 hunks FAILED } and removing extra whitespace
Attachment #362108 - Attachment description: reftest as a patch [Checkin: See comment 33] → reftest as a patch [Checkin: See comment 33+34]
Keywords: checkin-needed
Whiteboard: [needs 1.9.1 landing: reftest #362108] [fixed1.9.1b3] → [fixed1.9.1b3]
Comment on attachment 362108 [details] [diff] [review] reftest as a patch [Checkin: See comment 33+34+35] (In reply to comment #34) > and removing extra whitespace http://hg.mozilla.org/mozilla-central/rev/a750a4ebe950 (no bug) Removing ending whitespaces
Attachment #362108 - Attachment description: reftest as a patch [Checkin: See comment 33+34] → reftest as a patch [Checkin: See comment 33+34+35]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: