更改treeitem的默认箭头图标

时间:2012-07-05 12:56:27

标签: tree firefox-addon xul

我的xul应用程序中有这个树结构。

<tree>
    <treechildren>
        <treeitem>
            <treerow> 
                 /* some code */
            </treerow>
            <treechildren>
                <treeitem> /* some code */</treeitem>
                <treeitem> /* some code */</treeitem>
            </treechildren>
         </treeitem>
     </treechildren>
</tree>

正如xul gurus已经知道的那样,包含treechildren的treeitem会从标签中留下一个箭头。像这样:

enter image description here

我想知道的是如何更改此箭头并将其放置在最右侧。

1 个答案:

答案 0 :(得分:1)

此箭头称为“曲折”,并使用-moz-tree-twisty pseudo-class设置样式。默认的Windows主题为树曲调定义了以下样式:

treechildren::-moz-tree-twisty {
  -moz-padding-end: 4px;
  padding-top: 1px;
  width: 9px; /* The image's width is 9 pixels */
  list-style-image: url("chrome://global/skin/tree/twisty-clsd.png");
}

treechildren::-moz-tree-twisty(open) {
  width: 9px; /* The image's width is 9 pixels */
  list-style-image: url("chrome://global/skin/tree/twisty-open.png");
}

通过覆盖这些样式,您可以更改其宽度和边距,还可以使用其他图像。但是,我认为你不能把它移到另一个位置。

相关问题