1

Am using the following code to attach a panel to a toolbar button.

<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="test-toolbar-button" 
label="test" 
class="toolbarbutton-1 chromeclass-toolbar-additional" 
tooltiptext="test" 
type="panel"
>
<panel class="test-panel" id="test-panel" position="after_end" onpopupshown=""     width="643px" >
<iframe id="test-panel-iframe" src ="chrome://url.html" 
style="height:568px;width:343px;border:none;padding-left:3px;background-color:white;" >
</iframe>
</panel>
</toolbarbutton>

As per the documentation we need to specify two icons for Firefox toolbar button - 16x16 and 24x24

This is the CSS am using,

#test-toolbar-button {
  list-style-image: url("chrome://test-24.png");
  -moz-image-region: rect(0px 24px 24px 0px);
}

#test-button:hover {
}

#test-toolbar-button[disabled="true"] {
   -moz-image-region: rect(0px 48px 24px 24px);
}

toolbar[iconsize="small"] #test-toolbar-button 
{
    list-style-image: url("chrome://test-16.png");
    -moz-image-region: rect(0px 16px 16px 0px);
}

But the toolbar height increases since its having a down arrow which indicates its a panel attached to the toolbar button, there by screwing the whole toolbar.

Screenshot of the sample is attached.

http://postimage.org/image/sqwtwbfip/

Can anyone help me out of this.

6
  • What about the CSS styles you are applying to this button? These are definitely not the default styles in your screenshot... Jun 18 '12 at 15:06
  • @WladimirPalant I have added the CSS in my question.
    – Jeevan
    Jun 19 '12 at 4:29
  • 2
    Weird. Don't know why the theme doesn't take care of it but I guess that you will have to add -moz-box-orient: horizontal !important; style to this button yourself. Jun 19 '12 at 5:48
  • @WladimirPalant What does this actually do?
    – Jeevan
    Jun 19 '12 at 5:55
  • 1
    See MDN, it's basically the same thing as orient="horizontal" XUL attribute. The default theme already defines that for type="menu-button" so that the actual button and the dropdown arrow are laid out horizontally. I don't see any such rule for type="panel" however, in your screenshot they are clearly laid out vertically. Jun 19 '12 at 5:58
1
-moz-box-orient: horizontal !important;

This worked . Thanks @WladimirPalant

2
  • I've got exactly this problem with Modify Headers addon and now it's fixed! Thanks @WladimirPalant for the fix and thanks Jeevan for asking the question.
    – baptx
    Sep 1 '13 at 21:16
  • A bug has already been reported and like you, it only happens on Linux: mozdev.org/bugs/show_bug.cgi?id=25195
    – baptx
    Sep 2 '13 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.