Closed Bug 161387 Opened 23 years ago Closed 23 years ago

Patch: Improved label truncating for tabs

Categories

(Camino Graveyard :: Tabbed Browsing, enhancement)

PowerPC
macOS
enhancement
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: max, Assigned: sfraser_bugs)

Details

Attachments

(4 files, 1 obsolete file)

This patch implemented improved truncating for overlong tab labels in Chimera by taking into account the real character widths.
Attached patch The patch (obsolete) — Splinter Review
patch available - cc: pinkerton
Status: UNCONFIRMED → NEW
Ever confirmed: true
-> simon for a look
Assignee: saari → sfraser
Comment on attachment 94265 [details] [diff] [review] The patch In discussion with Max, the code needs work.
Attachment #94265 - Flags: needs-work+
Attached patch Improved patchSplinter Review
As discussed on IRC, here's a new improved patch. Besides optimizing the truncate method, it also works around a speed barrier in NSTabViewItem: for very long labels, it will cause extreme slow down - since we were basically doing everything label related ourselves anyway, I simply don't pass the label thru to the super class anymore. Also, the truncated string is cached. In total, Chimera now is a lot *faster* for pages with very long titles than it used to be (e.g. loading an otherwise empty page with a 300 char title into a tab is now instant, whereas it used to take 2-3 secs over here to display).
Attachment #94265 - Attachment is obsolete: true
Gah, there is a small redrawing problem now. Seems that the tab view system relays on setLabel being called. There is a simple fix, luckily: in my custom setLabel method, insert this inside the if: [super setLabel:@"foo"]; @"foo" is just random, it doesn't matter what text we pass (as long as it is short, long text will cause slowdowns again). With that, all works perfect, as far as I can tell.
Severity: normal → enhancement
Keywords: patch
Keywords: review
Are there any issues left with this Simon? I only ask because from a discussion on IRC last week or so I had the impression you were trying my latest patch, but since then nothing happend. If there are any issues, please tell me so that I can fix 'em, but if you just had no time so far that's alright of course :-)
Sorry, just haven't had the cycles to test it and check in.
Status: NEW → ASSIGNED
This patch breaks setting the label on tabs, even if I call [super setLabel:@"foo"];
The tab updating issue was my own. Ignore me ;)
Patch has been checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Component: General → Tabbed Browsing
QA Contact: winnie → sairuh
vrfy'd fixed using 2002.11.19.11 on 10.2.2.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: