[英]Firefox XUL Toolbar background image
I have my own toolbar with toolbox and toolbarpalette. 我有自己的工具栏,其中包含工具箱和工具栏调色板。
I have followed this https://developer.mozilla.org/en/Skinning_XUL_Files_by_Hand 我遵循了这个https://developer.mozilla.org/en/Skinning_XUL_Files_by_Hand
and background image for toolbar is not displaying, what can be wrong? 并且工具栏的背景图像未显示,这可能是错误的吗?
Cannot found any debug message in Error console 在错误控制台中找不到任何调试消息
Note that Image #logoimage is displaying correctly 请注意, 图像#logoimage显示正确
XUL XUL
<toolbox id="navigator-toolbox" class="nav-box" crop="end">
<toolbarpalette id="BrowserToolbarPalette">
<image id="logoimage"/>
<toolbarbutton type="menu" label="&toolbar.quicklinks.label;" id="quicklinks">
<menupopup>
<menuitem class="menuitem-iconic" label="&toolbar.quicklinks.quicklink1;" image="chrome://tbar/skin/icon.png"/>
</menupopup>
</toolbarbutton>
</toolbarpalette>
<toolbar id="test-toolbar"
class="nav-bar"
mode="full"
iconsize="small"
customizable="true"
context="toolbar-context-menu"
toolbarname="Toolbar"
crop="end"
defaultset="logoimage,toolbarseparator,quicklinks">
</toolbar>
</toolbox>
CSS 的CSS
toolbar.nav-bar {
background-image: url("chrome://tbar/skin/tbg.png");
}
#logoimage {
list-style-image: url("chrome://tbar/skin/logo.png");
}
As nobody could help, I asked in mozilla.dev.tech.xul Google group, and got an answer 由于没人能帮忙,我在mozilla.dev.tech.xul Google小组中询问,并得到了答案
Try adding " -moz-appearance: none; " to your CSS stanza.
尝试在CSS节中添加“ -moz-appearance:none; ”。 This turns off OS-defined theming.
这将关闭操作系统定义的主题。
And that thing simply worked ! 那个东西简直起作用了! It also removes all OS specific look and feel effects
它还删除了所有操作系统特定的外观效果
see: https://groups.google.com/group/mozilla.dev.tech.xul/browse_thread/thread/a4cd4452a72b9151# 请参阅: https : //groups.google.com/group/mozilla.dev.tech.xul/browse_thread/thread/a4cd4452a72b9151#
Given that there are no issues in the code you show here I only see one explanation: the background image is being set to a different value elsewhere, maybe in some built-in CSS file. 鉴于您在此处显示的代码中没有问题,我只看到一种解释:背景图像在其他位置(可能在某些内置CSS文件中)设置为其他值。 You can check the CSS rules applying to a particular UI element using DOM Inspector .
您可以使用DOM Inspector检查应用于特定UI元素的CSS规则。
Does your toolbar have a height and width? 您的工具栏是否有高度和宽度? I can't remember if they're block by default, but it might not be showing because it has no dimensions?
我不记得默认情况下它们是否处于阻止状态,但可能因为它没有尺寸而没有显示?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.