简体   繁体   English

在-fx-background-color上显示JavaFX“边框”选择吗?

[英]Display JavaFX “border” selection over -fx-background-color?

我的问题

I have styled all cells that match "Liste" like that: 我已经将所有匹配“ Liste”的单元格设置为:

.table-cell-in-main
{
    -fx-background-color: thistle;
}
.table-row-cell:selected .table-cell-in-main
{
    -fx-background-color: transparent;
}

The "normal" selection works and goes blue as is should - but the "border" selection (achieved by selecting one row and then navigating with Ctrl + Arrowkeys) doesn't show on the styled field, that looks really bad. “正常”选择会正常工作并变为蓝色,但“边框”选择(通过选择一行然后使用Ctrl +方向键进行导航)不会显示在样式字段上,这看起来确实很糟糕。 What do I have to change to make it look like this? 我必须更改使其看起来像这样吗?

它看起来像什么

Thanks in advance. 提前致谢。

This is a hack, in that it relies on the current Modena styles, but you can add insets to your cell background to “make room" for the TableRow selection border: 这是一个hack,因为它依赖于当前的Modena样式,但是您可以在单元格背景中添加插图以为TableRow选择边框“腾出空间”:

.table-cell-in-main {
    -fx-background-color: thistle;
    -fx-background-insets: 2 0 2 0;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM