2016-11-29 340 views

回答

2

您可以在任何情況下,檢查默認modena.css

Tab■找的CSS類:.tab-pane > .tab-header-area > .headers-region > .tab

因此,例如,添加以下你的CSS文件:

.tab-pane > .tab-header-area > .headers-region > .tab { 
    -fx-background-radius: 20; 
} 

.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator { 
    -fx-border-radius: 20; 
} 

將導致如下:

enter image description here

梯形您需要使用-fx-shape屬性:

.tab-pane > .tab-header-area > .headers-region > .tab { 
     -fx-shape: "M300,290 L310,168 L410,168 L421,290 L300,290 z"; 
} 

.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator { 
    -fx-shape: "M300,290 L310,168 L410,168 L421,290 L300,290 z"; 
} 

這將導致:

enter image description here

+0

對於梯形'-fx-shape'需要用來代替背景半徑... – fabian

+0

是的,我知道,但花了一些時間用SVGPath編寫示例:) – DVarga

+0

謝謝。工作得很好 –