简体   繁体   English

如何删除XUL Firefox扩展中按钮上的下拉菜单指示器?

[英]How to remove drop down menu indicator on a button in a XUL Firefox extension?

I'm working on a Firefox extension that creates a toolbar in the browser. 我正在使用Firefox扩展程序,该扩展程序可在浏览器中创建工具栏。 I'm using a with type="menu" to create a menu that pops up when the button is clicked. 我正在使用带有type =“ menu”的菜单来创建一个菜单,当单击按钮时该菜单会弹出。

By default, setting type="menu" creates a little menu indicator triangle, like in this image: 默认情况下,设置type="menu"会创建一个小的菜单指示器三角形,如下图所示:

示例按钮

Is there any way, either in XUL or in the CSS, to get rid of this indicator triangle? 在XUL或CSS中,是否有任何方法可以消除该指标三角形?

You could try with another approach. 您可以尝试其他方法。 Insert a regular button and use the popup property to make a menupopup appear when clicking on it. 插入一个常规按钮,并使用popup属性使menupopup在单击时出现。

<popupset>
    <menupopup position="after_start" id="testPopup">
        <menuitem label="test"/>
    </menupopup>
</popupset>
<button label="test" type="menu" popup="testPopup"/>

You can play around with the position property to get the desired result 您可以使用position属性来获得所需的结果

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM