我正在尝试使用 css 样式表更改 javafx 微调器的样式。
但是,当更改颜色时,我只能更改文本字段的颜色,微调器侧面的箭头按钮看起来仍然像默认值。
如何更改这些按钮的颜色?
最佳答案
设置用作按钮背景的-fx-body-color
:
.spinner .increment-arrow-button,
.spinner .decrement-arrow-button {
-fx-body-color: yellow;
}
.spinner .increment-arrow-button:hover,
.spinner .decrement-arrow-button:hover {
/* interpolate color between yellow and red based on first color brightness */
-fx-body-color: ladder(#444, yellow 0%, red 100%);
}
.spinner .increment-arrow-button:hover:pressed,
.spinner .decrement-arrow-button:hover:pressed,
.spinner .increment-arrow-button:pressed,
.spinner .decrement-arrow-button:pressed {
/* interpolate color between yellow and red based on first color brightness */
-fx-body-color: ladder(#AAA, yellow 0%, red 100%);
}
默认样式表将它们用作按钮的背景色。
关于css - 使用 css 更改 javafx 微调器按钮的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38669584/