Closed Bug 467360 Opened 16 years ago Closed 16 years ago

support buttons with child panels

Categories

(Toolkit :: UI Widgets, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: enndeakin, Assigned: enndeakin)

References

Details

(Keywords: dev-doc-needed, fixed1.9.1)

Attachments

(1 file, 2 obsolete files)

Attached patch implement this (obsolete) — Splinter Review
There was a request by mano at one point to support putting panels inside buttons, as in:

<button id="button" type="panel" label="Button">
  <panel>
    <textbox/>
  </panel>
</button>

that would work just like type="menu".
Attachment #350769 - Flags: review?(neil)
Dao, an issue I found with this is that in this example:

<toolbarbutton id="button" type="panel" label="Button">
  <panel>
    <textbox/>
  </panel>
</toolbarbutton>

On Mac, the text-shadow defined on the toolbarbutton is messing up the textbox in the panel. Characters typed aren't being drawn correctly, instead they seem to be just a few pixels of garbage at the left edge of the textbox. Is there still an issue with text-shadow inheritance?
(In reply to comment #1)
> On Mac, the text-shadow defined on the toolbarbutton is messing up the textbox
> in the panel.

Sure that it's text-shadow and not something else? Should be easy to investigate this (at least, exclude text-shadow) using DOMi, e.g. by looking a the computed style, setting style="text-shadow:none" on the toolbarbutton, etc.

By the way, it's also a little strange that popups inherit text-shadow.
Actually, it seems more work may be necessary to support this. Another issue is that the button key event handling is also interfering.
Comment on attachment 350769 [details] [diff] [review]
implement this

I guess this works at least as well as <button type="menu"><menupopup ignorekeys="true"> ;-)
Anyway, I have no objection to it.
Attachment #350769 - Flags: review?(neil) → review+
Depends on: 467817
- changes the popup manager so that it keeps track of the popup type for menu opens, so that focus is cleared in FirePopupShowingEvent.
- disables button key navigation when a button's popup is open or is a popup type of menu.
Blocks: 393884
Whats needed (aside from review) to get this patch in for 1.9.1? I'm playing with panels and it seems they solve at least some of my problems with popup-in-popups. I think since the text-shadow issue can be worked around quite easily, this bug should go in soon.
Flags: blocking1.9.1?
I also think all other elements that support menupopups should support panels.
Attachment #351248 - Flags: review?(neil)
Comment on attachment 351248 [details] [diff] [review]
updated patch, also fixes bug 393884

OK, yes I think only the text shadow issue remains, which is bug 467817.
(In reply to comment #7)
> I also think all other elements that support menupopups should support panels.

What other elements? The only other elements are all menu related and it doesn't make sense to support panels for them.
Comment on attachment 351248 [details] [diff] [review]
updated patch, also fixes bug 393884

>+        if (this.open)
>           return;
> 
>+        var type = this.type;
>+        if (type != "menu" && type != "menu-button" && type != "panel") {
Just skimming this: I'm not sure these tests are correct, in particular the open test is incorrect for non-menu buttons and the type test isn't generic. My suggestions would be something like this:
if (this.boxObject instanceof Components.interfaces.nsIMenuBoxObject) {
  if (this.open)
    return;
} else {
  /* arrow key processing here */
}
Comment on attachment 351248 [details] [diff] [review]
updated patch, also fixes bug 393884

OK, r=me with comment #10 fixed.
Attachment #351248 - Flags: review?(neil) → review+
Attachment #357801 - Flags: superreview?(neil)
Attachment #357801 - Flags: review?(neil)
Attachment #357801 - Flags: superreview?(neil)
Attachment #357801 - Flags: superreview+
Attachment #357801 - Flags: review?(neil)
Attachment #357801 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
Comment on attachment 357801 [details] [diff] [review]
like so? also adds a button test
[Checkin: Comment 16]

I'd like to see this in 1.9.1, calendar could make use of this patch.
(In reply to comment #13)
> (From update of attachment 357801 [details] [diff] [review])
> I'd like to see this in 1.9.1, calendar could make use of this patch.

Phillip, can you explain what UI or feature would make use of this?
Not blocking. Enn says he doesn't think we want this for 1.9.1, but wants to know why calendar wants/needs it.
Flags: blocking1.9.1? → blocking1.9.1-
Depends on: 475451
Target Milestone: --- → mozilla1.9.2a1
Version: unspecified → Trunk
Attachment #351248 - Attachment is obsolete: true
Comment on attachment 357801 [details] [diff] [review]
like so? also adds a button test
[Checkin: Comment 16]


http://hg.mozilla.org/mozilla-central/rev/31d411bd26bc
Attachment #357801 - Attachment description: like so? also adds a button test → like so? also adds a button test [Checkin: Comment 16]
Attachment #350769 - Attachment is obsolete: true
From the point of view of just making XUL apps more capable on 1.9.1 I'd like to see this on branch.
Attachment #357801 - Flags: approval1.9.1? → approval1.9.1+
Comment on attachment 357801 [details] [diff] [review]
like so? also adds a button test
[Checkin: Comment 16]

a191=beltzner
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: