2012-07-05 100 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