Cache toolbar items as they are created



12 years ago
9 years ago


(Reporter: stuart.morgan+bugzilla, Unassigned)




(1 attachment)



12 years ago
Created attachment 278325 [details] [diff] [review]

While investigating bug 235910 I wrote a toolbar item cache, and while it didn't fix that bug it's still what the docs recommend, so there's no real reason not to go ahead and land it.
Attachment #278325 - Flags: review?(murph)
Comment on attachment 278325 [details] [diff] [review]

Need to declare mCachedToolbarItems in the header file.

More importantly though, there's some weirdness with our custom back/forward icons (probably related to the fact that the version that gets cached is explicitly 32x32).  STR:

1. Make the toolbar have small icons
2. Customize toolbar

What happens: back/fwd buttons both in the customize sheet and on the real toolbar are too big, and get clipped at the edges.
Attachment #278325 - Flags: review?(murph) → review-

Comment 2

11 years ago
So that the reason this bug exists is here, rather than just in bug 235910:

The docs for toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar: say:
"This method is called lazily on behalf of a toolbar instance, which must be the sole owner of the toolbar item. A toolbar may ask again for a kind of toolbar item already supplied to it, in which case this method can and should return the same toolbar item it returned before."
Assignee: stuart.morgan → nobody
You need to log in before you can comment on or make changes to this bug.