Commits

Samir Hadzic committed dde27f3

Css on selection updated. Ugly hack to access label removed.

Comments (0)

Files changed (2)

src/main/java/impl/org/controlsfx/spreadsheet/HorizontalHeader.java

 	 * @param i
 	 */
 	private void removeStyleHeader(Integer i) {
-        	getRootHeader().getColumnHeaders().get(i).getChildrenUnmodifiable().get(0).getStyleClass().removeAll("fixed");
+        	getRootHeader().getColumnHeaders().get(i).getStyleClass().removeAll("fixed");
     }
 	/**
 	 * Remove the fix style of the header Label of the specified column
 	 * @param i
 	 */
 	private void addStyleHeader(Integer i) {
-            getRootHeader().getColumnHeaders().get((Integer) i)
-                    .getChildrenUnmodifiable().get(0).getStyleClass()
+            getRootHeader().getColumnHeaders().get((Integer) i).getStyleClass()
                     .addAll("fixed");
     }
     
      */
     private void updateHighlightSelection() {
     	for (final TableColumnHeader i : getRootHeader().getColumnHeaders()) {
-            i.getChildrenUnmodifiable().get(0).getStyleClass().removeAll("selected");
+            i.getStyleClass().removeAll("selected");
 
         }
         final List<Integer> selectedColumns = gridViewSkin.getSelectedColumns();
-        // TODO Ugly hack to get access to the Label
         for (final Object i : selectedColumns) {
-            getRootHeader().getColumnHeaders().get((Integer) i)
-                    .getChildrenUnmodifiable().get(0).getStyleClass()
+            getRootHeader().getColumnHeaders().get((Integer) i).getStyleClass()
                     .addAll("selected");
         }
 

src/main/resources/org/controlsfx/control/spreadsheet/spreadsheet.css

 }  
 
 VerticalHeader > Label.selected,
-HorizontalHeaderColumn > TableColumnHeader > Label.selected{
--fx-background-color: -fx-box-border, -fx-inner-border,  #ffd700;
+HorizontalHeaderColumn > TableColumnHeader.column-header.table-column.selected{
+	-fx-background-color: -fx-box-border, -fx-inner-border,  #ffd700;
     -fx-background-insets: 0, 0 1 1 0, 1 2 2 1;
     -fx-font-weight: bold;
     -fx-size: 2em;
     -fx-text-fill: -fx-selection-bar-text;
     -fx-alignment: center;
+    -fx-border-color : #ffd700;
 }  
 
 /* FIXED HEADERS  */
 VerticalHeader > Label.fixed,
-HorizontalHeaderColumn > TableColumnHeader > Label.fixed{
+HorizontalHeaderColumn > TableColumnHeader.column-header.table-column.fixed{
 	-fx-font-style : italic;
 }