On 24/07/12 10:18, Neil wrote:
> Axel Grude wrote:
>
>> Like I said, I would like to affect the behavior in the sense that I get a separate
>> click event, when the _icon_ on the toolbarbutton is clicked (the toolbarbutton
>> itself acts as tab, representing a mail folder - the default click drops down a
>> dynamic popup menu with mail folder commands and subfolders, which also pops up when
>> a message is dropped onto it), so all fairly complex behavior.
>
> OK, so you have two approaches:
>
> 1. You could use a dual menubutton. This combines a button with a
> dropdown arrow; the icon triggers the button while the arrow opens
> the popup. You can even switch a button between a regular and a
> dual menubutton. (SeaMonkey does something similar with its Reply
> button which turns into a dual menubutton when you're reading a
> newsgroup.)
I have seen this also in the Saved Password Editor addon, but it is not a solution for
me as it is too finicky. The main action will always be to show the dropdown with the
subfolders, and that should also 'take the most space'. The default action is actually
something that would be needed less often than just a simple click to get the
dropdown. However, a simple click on the icon (for advanced users) would be a
perfectly minimized UI (especially since the icons can be :hover styled to represent
the default action - green arrow into inbox = get mail - sweeping brush on junk =
purge junk, etc.).
> 2. I think you could style the image with the (svg) pointer-events
> CSS style, which would allow mouse events to target the image
> (normally child elements of buttons aren't allowed to be the
> target of events).
>
I do like the second approach (if it works), I need to learn about these (svg) pointer
events; svg is also an image format is this correct?
Let's see:
https://developer.mozilla.org/en/CSS/pointer-events/
I will give it a read...
Alternatively, could you imagine cloning the image to an unstyled "picture only
button" which "hovers above" the button by replication its relative position from that
of the contained image via Javascript?
thanks
Axel