Closed Bug 380087 Opened 17 years ago Closed 17 years ago

Address Book has wrong icon in customize toolbars dialog

Categories

(Thunderbird :: Mail Window Front End, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3

People

(Reporter: shermandickman, Assigned: philor)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3
Build Identifier: version 2.0.0.0 (20070326)

The address book icon is wrong when you drag it from the tool bar to the "customize toolbar palette".

Reproducible: Always

Steps to Reproduce:
1. Open message composition window.
2. Right click on toolbar to customize
3. Drag "contacts" icon to customize toolbar window.  You will see that it displays the ABC icon.


Expected Results:  
Should have seen the contacts icon instead.
Do you mean while dragging? On linux I don't see an icon then (just the generic drag), and when it reaches the destination, it's the correct one.
The behavior appears with Mac OS X, but not on Windows XP.  I haven't tried it on Linux, so perhaps it is only on the Mac.
Or as we describe that, "so perhaps it's Phil's bug."
Assignee: mscott → philringnalda
Status: UNCONFIRMED → NEW
Component: Message Compose Window → Mail Window Front End
Depends on: 358446
Ever confirmed: true
QA Contact: message-compose → front-end
Summary: Address Book Icon Wrong → Address Book has wrong icon in customize toolbars dialog
Target Milestone: --- → Thunderbird 3
Version: unspecified → Trunk
Attached patch Fix v.1Splinter Review
In too much detail, because I keep forgetting this stuff and having to relearn it from my own bug comments (cf bug 366842 comment 28):

There are actually two bugs: Pinstripe shows the spellcheck icon (from the compose window) when you drag the address book icon from the 3pane window to the customize dialog, and Qute shows the contacts icon (an open address book) rather than the icon it uses on the toolbar.

Because we don't know which window we are customizing, we apply all the CSS files to the customize window, so what rule applies depends on specificity, !important, and which file comes last. The two rules that matter most are list-style-image, which decides which combined image to use, and -moz-image-region, which decides which part of the image to use. In the simplest case (say, Firefox, with just one window), the toolbarbutton-1 class specifies the list-style-image, and the id for the button specifies the -moz-image-region. Since the 3pane's CSS file comes last, it can get away with just that, while other windows need to ensure that their buttons get the right list-style-image another way, generally by respecifying list-style-image in the rule for the button's id, where it's more specific than the toolbarbutton-1 class from the 3pane.

In this case, though, both the 3pane address book button and the compose contacts button have the same id, button-address, so when compose's CSS specifies a list-style-image for the id, that's the most specific one, while the 3pane's -moz-image-region for #button-address, which comes last, is used, since it and compose's rule are of equal specificity. That means that for Pinstripe, we use the part of the compose toolbar image which corresponds to the part of the 3pane's image which has the address book icon, which gives us the spellcheck image.

This was fixed for Qute in bug 241601, in a sort of suboptimal way, by making the compose -moz-image-regions !important, which not only leads to the usual complications of having !important rules get in the way, it also makes the 3pane address book use the slightly different (open, instead of closed) icon for the contacts panel when it's in the customize dialog. That works, and apparently doesn't bother anyone, since I don't see where anyone's filed on it in the three years it's been that way, but the right fix is just to not have two different buttons, with different labels, icons, and actions, have the same id.
Attachment #269813 - Flags: review?(mscott)
The more-or-less branch-safe fix is to copy Qute's !important, but since Pinstripe's been like this since at least 1.5, I'm not entirely sure it's that important.
Comment on attachment 269813 [details] [diff] [review]
Fix v.1

thanks for cleaning up my hack Phil.

can we ditch some !important style rules along the way here too for qute?
Attachment #269813 - Flags: review?(mscott) → review+
Filed bug 386007 on Doing The Right Thing, since for all my talk, I'm still not sure what it is.

mail/themes/pinstripe/mail/compose/messengercompose.css 1.6
mail/themes/qute/mail/compose/messengercompose.css 1.14
mail/components/compose/content/messengercompose.xul 1.103
Status: NEW → RESOLVED
Closed: 17 years ago
OS: Mac OS X → All
Hardware: Macintosh → All
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: