changeset 1045:9abbdefc6864

RT-21207: ComboBox list width doesn't fit its content when first displayed
author jgiles
date Tue, 15 May 2012 14:52:35 +1200
parents f7ee46991667
children 0f8df2a08440
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Tue May 15 10:27:05 2012 +1200
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Tue May 15 14:52:35 2012 +1200
@@ -72,6 +72,11 @@
         this.comboBox = comboBox;
         this.listView = createListView();
         
+        // Fix for RT-21207. Additional code related to this bug is further below.
+        this.listView.setManaged(false);
+        getChildren().add(listView);
+        // -- end of fix
+                
         updateListViewItems();
         updateCellFactory();
         
@@ -174,6 +179,17 @@
             new WeakListChangeListener(listViewItemsListener);
     
     @Override protected void handleControlPropertyChanged(String p) {
+        // Fix for RT-21207
+        if (p == "SHOWING") {
+            if (getSkinnable().isShowing()) {
+                this.listView.setManaged(true);
+                this.listView.impl_processCSS(true);
+            } else {
+                this.listView.setManaged(false);
+            }
+        }
+        // -- end of fix
+        
         super.handleControlPropertyChanged(p);
         
         if (p == "ITEMS") {