changeset 5890:fde6a94b9415

Ensemble8: Fix for RT-34659 Ensemble8: Empty search window when backspace last character in Search dialog
author Alexander Kouznetsov
date Tue, 03 Dec 2013 13:30:42 -0800
parents 7dfe3ed4a7cb
children a775ec27c8a4
files apps/samples/Ensemble8/src/app/java/ensemble/SearchResultPopoverList.java apps/samples/Ensemble8/src/app/java/ensemble/control/Popover.java apps/samples/Ensemble8/src/app/resources/ensemble/EnsembleStylesCommon.css
diffstat 3 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/apps/samples/Ensemble8/src/app/java/ensemble/SearchResultPopoverList.java	Tue Dec 03 16:18:15 2013 -0500
+++ b/apps/samples/Ensemble8/src/app/java/ensemble/SearchResultPopoverList.java	Tue Dec 03 13:30:42 2013 -0800
@@ -66,12 +66,15 @@
     private PageBrowser pageBrowser;
     private Rectangle leftLine = new Rectangle(0,0,1,1);
     private IconPane iconPane = new IconPane();
+    private final Pane backgroundRectangle = new Pane();
 
     public SearchResultPopoverList(PageBrowser pageBrowser) {
         this.pageBrowser = pageBrowser;
         leftLine.setFill(Color.web("#dfdfdf"));
         iconPane.setManaged(false);
         setFocusTraversable(false);
+        backgroundRectangle.setId("PopoverBackground");
+        setPlaceholder(backgroundRectangle);
     }
 
     @Override protected void layoutChildren() {
@@ -84,6 +87,7 @@
         iconPane.setLayoutX(0);
         iconPane.setLayoutY(0);
         iconPane.resize(getWidth(), getHeight());
+        backgroundRectangle.resize(getWidth(), getHeight());
     }
 
     @Override public void itemClicked(SearchResult item) {
--- a/apps/samples/Ensemble8/src/app/java/ensemble/control/Popover.java	Tue Dec 03 16:18:15 2013 -0500
+++ b/apps/samples/Ensemble8/src/app/java/ensemble/control/Popover.java	Tue Dec 03 13:30:42 2013 -0800
@@ -86,7 +86,6 @@
     private final Button leftButton = new Button("Left");
     private final Button rightButton = new Button("Right");
     private final LinkedList<Page> pages = new LinkedList<Page>();
-    private final Region backgroundRectangle = new Region();
     private final Pane pagesPane = new Pane();
     private final Rectangle pagesClipRect = new Rectangle();
     private final Pane titlesPane = new Pane();
@@ -110,7 +109,6 @@
         getStyleClass().setAll("popover");
         frameBorder.getStyleClass().setAll("popover-frame");
         frameBorder.setMouseTransparent(true);
-        backgroundRectangle.setId("PopoverBackground");
         // setup buttons
         leftButton.setOnMouseClicked(this);
         leftButton.getStyleClass().add("popover-left-button");
@@ -122,7 +120,7 @@
         pagesPane.setClip(pagesClipRect);
         titlesClipRect.setSmooth(false);
         titlesPane.setClip(titlesClipRect);
-        getChildren().addAll(backgroundRectangle, pagesPane, frameBorder, titlesPane, leftButton, rightButton);
+        getChildren().addAll(pagesPane, frameBorder, titlesPane, leftButton, rightButton);
         // always hide to start with
         setVisible(false);
         setOpacity(0);
@@ -243,7 +241,6 @@
         int pageWidth = width - left - right;
         int pageHeight = height - top - bottom;
         
-        backgroundRectangle.resizeRelocate(left, top, pageWidth, pageHeight);
         frameBorder.resize(width, height);
 
         pagesPane.resizeRelocate(left, top, pageWidth, pageHeight);
--- a/apps/samples/Ensemble8/src/app/resources/ensemble/EnsembleStylesCommon.css	Tue Dec 03 16:18:15 2013 -0500
+++ b/apps/samples/Ensemble8/src/app/resources/ensemble/EnsembleStylesCommon.css	Tue Dec 03 13:30:42 2013 -0800
@@ -97,7 +97,7 @@
    * POPOVERS
    ****************************************************************************/
 .popover {
-    -fx-padding: 44 7 7 7;
+    -fx-padding: 43 7 7 7;
 }
 .popover-frame {
     -fx-border-image-source: url("images/popover-empty.png");
@@ -129,9 +129,9 @@
  /*   -fx-font-weight: bold; */
     -fx-text-fill: #363636;
 }
-/* #PopoverBackground {
-    -fx-background-color: grey;
-} */
+#PopoverBackground {
+    -fx-background-color: white;
+}
 .search-result-cell {
     -fx-background-color: white;
     -fx-padding: 4 30 4 45;