changeset 5994:dabee4f56388

RT-34914: [TableView, TreeTableView] sort order dots beneath arrow are not centered
author jgiles
date Tue, 17 Dec 2013 12:47:27 +1300
parents 4d5e31cb54d1
children 7a85b9cf6241
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Tue Dec 17 12:34:53 2013 +1300
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Tue Dec 17 12:47:27 2013 +1300
@@ -595,7 +595,7 @@
                 sortArrowGrid.add(sortOrderLabel, 2, 1);
             } else if (showSortOrderDots) {
                 if (sortOrderDots == null) {
-                    sortOrderDots = new HBox(1);
+                    sortOrderDots = new HBox(0);
                     sortOrderDots.getStyleClass().add("sort-order-dots-container");
                 }
 
@@ -647,6 +647,16 @@
             }
             
             sortOrderDots.getChildren().add(r);
+
+            // RT-34914: fine tuning the placement of the sort dots. We could have gone to a custom layout, but for now
+            // this works fine.
+            if (i < sortPos) {
+                Region spacer = new Region();
+                double rp = sortPos == 1 ? 1 : 1;
+                double lp = sortPos == 1 ? 1 : 0;
+                spacer.setPadding(new Insets(0, rp, 0, lp));
+                sortOrderDots.getChildren().add(spacer);
+            }
         }
         
         sortOrderDots.setAlignment(Pos.TOP_CENTER);