2012-07-05 135 views
0

我在我的xul应用程序中有这个树结构。更改treeitem的默认箭头图标

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

正如你所知道的那样,包含treechildren的treeitem从标签中得到一个箭头。就像这样:

enter image description here

我想知道的是如何改变这个箭头,它的位置最右边。

回答

1

这个箭头被称为“twisty”,它的样式是使用-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"); 
} 

通过重写这些样式更改它的宽度和利润,你也可以使用其他图片。但是,我认为你不能将它移到不同的位置。

+0

我已经对齐了曲折的权利,把余裕放在它,并以某种方式它的工作。非常感谢您的帮助 – madeye 2012-07-06 08:21:45