每次拖动列时,我都会在整个列上显示一条蓝线。 我知道我可以通过设置当我拖动它时,此行显示为[[only,如果我不这样做,一切都很好。-fx-background-insets: 0;
来删除它,但是我不知道该放在哪里。
我当前的CSS
如下:
.table-view .column-header,
.table-view .filler,
.table-view .column-header-background .show-hide-columns-button {
-fx-background-color: white;
}
.table-view .column-header {
-fx-border-color: grey;
-fx-border-width: 0 1 0 0;
}
.table-view .column-header-background {
-fx-border-color: grey;
-fx-border-width: 0 0 1 0;
}
.table-view .show-hide-column-image {
-fx-background-color: black;
}
.table-view .column-drag-header,
.table-view .column-overlay {
-fx-background-color: green;
}
.table-view:focused > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled:selected,
.table-view:focused > .virtual-flow > .clipped-container > .sheet > .table-row-cell .table-cell:selected {
-fx-background-color: darkgrey;
-fx-table-cell-border-color: grey;
}
.table-cell {
-fx-border-color: grey;
-fx-border-width: 0 1 0 0;
-fx-text-fill: black;
}
.table-row-cell:focused {
-fx-background-insets: 0;
}
.table-row-cell:selected .table-cell {
-fx-text-fill: black;
}
我在modena.css
中看到的有关此“拖动事件”的唯一内容是:
/* When a column is being 'dragged' to be placed in a different position, there is a region that follows along the column header area to indicate where the column will be dropped. This region can be styled using the .column-drag-header name. */ .table-view .column-drag-header, .tree-table-view .column-drag-header { -fx-background: -fx-accent; -fx-background-color: -fx-selection-bar; -fx-border-color: transparent; -fx-opacity: 0.6; } /* Semi-transparent overlay to indicate the column that is currently being moved */ .table-view .column-overlay, .tree-table-view .column-overlay { -fx-background-color: darkgray; -fx-opacity: 0.3; }
我曾尝试将其放在两个地方,例如:
.table-view .column-drag-header, .table-view .column-overlay { -fx-background-insets:0; }
但是没有效果。将问题更改为“更改颜色”而不是将其删除,因为这似乎是一种更好的方法。注释中的kleopatra提供了更改颜色的解决方案。我以为这个“区域”可能是有插图的区域,因为它会出现蓝线,但是我找不到它在
CSS
中或至少它叫什么。Edit:
.table-view .column-resize-line {
-fx-background-color: red;
}
.column-resize-line
可以用于TableView
和TreeTableView
:/* The column-resize-line is shown when the user is attempting to resize a column. */
.table-view .column-resize-line,
.tree-table-view .column-resize-line {
-fx-background: -fx-accent;
-fx-background-color: -fx-background;
-fx-padding: 0.0em 0.0416667em 0.0em 0.0416667em; /* 0 0.571429 0 0.571429 */
}