0

I've checked a few solutions like How to set/remove insets in JavaFX TitledPane, Titled pane css settings and Remove insets in JavaFX TitledPane with CSS not working. Also checked the modena.css (line 1829), but when I click on the TitledPane (i.e. when it's focused), the arrow always keeps glowing like in the image below (might be a bit hard to see).

Default default Focusedfocused

This is my CSS:

.titledPane {
    -fx-background-color: transparent;
    -fx-background-insets: 0;
    -fx-text-fill: white;
}
.titledPane > .title {
    -fx-background-color: black;
    -fx-background-insets: 0;
    -fx-background-radius: 0;
}
.titledPane:focused > .title {
    -fx-background-color: black;
    -fx-background-insets: 0;
}
.titledPane > .title > .arrow-button > .arrow{
    -fx-background-color: white;
    -fx-background-insets: 0;
}
.titledPane:focused > .title > .arrow-button > .arrow{
    -fx-background-color: white;
    -fx-background-insets: 0;
}
.titledPane:collapsed > .title > .arrow-button > .arrow{
    -fx-background-color: white;
    -fx-background-insets: 0;
}
.titledPane > .content {
    -fx-background-color: white;
}

What other setting am I missing? I've a GridPane inside it, if it makes any difference.

Doombringer
  • 596
  • 4
  • 19
  • 2
    Probably that's the dropshadow effect. Try `-fx-effect: null;` on the arrow. Btw: note that you can seperate the rules and use multiple selectors, e.g. `.titledPane, .titledPane > .title, .titledPane > .title > .arrow-button > .arrow { -fx-background-insets: 0; }` `.titledPane > .content, .titledPane > .title > .arrow-button > .arrow, .titledPane > .title { -fx-background-color: white; }` `.titledPane:focused > .title { -fx-background-color: black; }` – fabian Dec 11 '19 at 18:34
  • @fabian Thank you so much!!! `-fx-effect: null;` solved it. If you put it in an answer, I can mark it as the solution, if you want. – Doombringer Dec 11 '19 at 18:47
  • Related question: [How to change header component in TitledPane in JavaFX](https://stackoverflow.com/questions/11765436/how-to-change-header-component-in-titledpane-in-javafx). Some answers there are quite old and based upon previous styling for JavaFX (Caspian vs Modena), so the solutions offered there may not be relevant to what you want to accomplish. – jewelsea Dec 12 '19 at 00:37

0 Answers0