gpt4 book ai didi

css - 在 javafx 中,如何更改滚动条箭头的颜色?

转载 作者:太空宇宙 更新时间:2023-11-03 22:44:07 24 4
gpt4 key购买 nike

我正在使用 css 自定义滚动条,但我无法更改递增/递减箭头颜色。事实上,改变它们的形式更简单——像这样:

.increment-arrow {
-fx-shape: "M 0 0 L 4 8 L 8 0 Z";
}

但是我试图添加到该样式中的任何东西都不能改变箭头的颜色(箭头本身,而不是它们周围的背景)。如何实现?

最佳答案

如果您查看 modena 如何设置 ScrollBar 控件的样式,您会发现箭头使用以下规则:

.scroll-bar > .increment-button > .increment-arrow,
.scroll-bar > .decrement-button > .decrement-arrow {
-fx-background-color: -fx-mark-highlight-color, derive(-fx-base,-45%);
}

所以您需要做的就是用您自己的颜色覆盖该颜色:

.scroll-bar > .increment-button > .increment-arrow,
.scroll-bar > .decrement-button > .decrement-arrow {
-fx-background-color: green;
}

您可以找到包含在 jfxrt.jar 中或在 openJFX repository 中列出的 modena.css 文件。 .

关于css - 在 javafx 中,如何更改滚动条箭头的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42808539/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com