开发者

firefox : why no change in my statusbar?

开发者 https://www.devze.com 2023-01-30 22:01 出处:网络
edit I have a statusbar that can be used to enable and disable addons. <popupset> <menupopup id=\"inlinetransContextMenu\" position=\"end_after\">

edit I have a statusbar that can be used to enable and disable addons.

  <popupset>
  <menupopup id="inlinetransContextMenu" position="end_after">
    <image id="preficon" value="pref" />
    <menuitem id="translator-context-menuitem-preferences"
    label="preferences" onclick="alert('horay')" />
  </menupopup>
</popupset>

<!-开发者_Go百科- ========================================= -->


When you define:

<menupopup id="inlinetransContextMenu" position="end_after">
    <image id="preficon" value="pref" />
    <menuitem id="translator-context-menuitem-preferences"
    label="preferences" onclick="alert('horay')" />
</menupopup>

Your popup consists of two element, an image and a menuitem. Items in a popup a laid out vertically so the image is above the menu item.

If you want to associate the image with the menu item, you have to do it differently, as described in the documentation:
A menuitem as a property image which should hold the path to the icon. Furthermore you have to give the it the class menuitem-iconic for the icon to show up (it is a predefined style class (probably an XBL binding)):

image
Type: image URL
The URL of the image to appear on the element. If this attribute is empty or left out, no image appears. The position of the image is determined by the dir and orient attributes.

Note: The menuitem must have a class of menuitem-iconic for the image to appear.

So your definition should look like:

<menupopup id="inlinetransContextMenu" position="end_after">
    <menuitem id="translator-context-menuitem-preferences"
              image="chrome://inlinetrans/skin/pref.png"
              class="menuitem-iconic"
              label="preferences" 
              onclick="alert('horay')" />
</menupopup>

I don't understand your other problem: why when I try to suppress the image on the statusbar is no change at all with my statusbar. What does suppress mean in this context? Do you want to remove the icon? Or change?

Update:

You have to set image and label as attributes:

<statusbarpanel id="status-bar-intrans"
   context="inlinetransContextMenu"
   onclick="overlay.clickIcon(event)"
   onmouseover="var elmt=document.getElementById('status-bar-intrans');if ('enabled' == overlay.status) { elmt.tooltipText= 'inlinetrans dalam kondisi aktif';} else { elmt.tooltipText='inlinetrans dalam kondisi tidak aktif'; }">
   image="chrome://youraddon/skin/image.png"
   label="inlinetrans" />

and change the attribute image. Or via src and CSS. It is all described in the documentation.

0

精彩评论

暂无评论...
验证码 换一张
取 消