JavaFX TableView: Cannot Override '-fx-text-fill'!

前端 未结 2 599
情话喂你
情话喂你 2020-12-18 11:28

On JavaFX2.2, I created my own style class to represent table cells that contain invalid data. But my style class seems unable to override -fx-text-fill in the

2条回答
  •  一向
    一向 (楼主)
    2020-12-18 12:00

    Following jewelsea's advice, I increased the specificity of my CSS rules to match the specificity of the corresponding rules in capsian.css. Because I was curious, I increased the specificity of my own rules incrementally and discovered that anything less specific than the following rules does not work in my situation.

    .table-view:cell-selection .table-row-cell:filled .invalid-table-cell:hover {
        /* Works! */
    }
    
    .table-view:focused .table-row-cell:filled .invalid-table-cell:selected:focused {
        /* Works! */
    }
    
    .table-view:focused .table-row-cell:filled .invalid-table-cell:focused:selected:hover {
        /* Works! */
    }
    

提交回复
热议问题