0

JavaFx 2.0 アプリで Opera Web ブラウザーのようなタブを作成したいと考えています。多くの CSS 設定でタブをカスタマイズしようとしましたが、成功しませんでした。誰もそれを行う方法を知っていますか?

4

1 に答える 1

2

次のように、個々のタブにクラスを追加してスタイルを設定できます。

.blue .tab-label  {
  -fx-text-fill: blue;  
}

.red .tab-label  {
 -fx-text-fill: red;  
}

.green .tab-label {
-fx-text-fill: lime;  
}

すべてのタブのスタイルを設定するには、次のような CSS を使用できます。

.tab-chat.tab:hover {
-fx-background-color:  linear-gradient(to top, -fx-purple, -fx-control-inner-background);
}

.tab-chat:selected {
-fx-background-color: linear-gradient(to bottom, derive(-fx-base, 95%),     -fx-control-inner-background );
-fx-background-insets: 0, 9 9 0 9;
-fx-background-radius: 12 12 0 0, 12 12 0 0;
-fx-font-weight: bold;
}

/* ----------------------------- */
/*  Tabs  background graphic     */
/* ----------------------------- */
.tab-header-background {
   -fx-background-image: url("images/back-rustyfill.jpg");
} 
于 2012-05-25T09:07:27.447 に答える