changeset 2345:2b7f947dca31

RT-27512 : [VGA] Implement CSS for ScrollBar in ScrollPane
author mickf
date Tue, 22 Jan 2013 17:59:07 +0000
parents 0707a49bd4bc
children c58a0d435738 7e9de19b8f10
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java javafx-ui-controls/src/com/sun/javafx/scene/control/skin/caspian/embedded.css
diffstat 2 files changed, 72 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Tue Jan 22 21:05:23 2013 +1300
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Tue Jan 22 17:59:07 2013 +0000
@@ -78,6 +78,7 @@
     private static final double DEFAULT_MIN_SIZE = 36.0;
 
     private static final double DEFAULT_SB_BREADTH = 12.0;
+    private static final double DEFAULT_EMBEDDED_SB_BREADTH = 8.0;
 
     private static final double PAN_THRESHOLD = 0.5;
 
@@ -966,12 +967,22 @@
         vsbWidth = snapSize(vsb.prefWidth(-1));
         if (vsbWidth == 0) {
             //            println("*** WARNING ScrollPaneSkin: can't get scroll bar width, using {DEFAULT_SB_BREADTH}");
-            vsbWidth = DEFAULT_SB_BREADTH;
+            if (PlatformUtil.isEmbedded()) {
+                vsbWidth = DEFAULT_EMBEDDED_SB_BREADTH;
+            }
+            else {
+                vsbWidth = DEFAULT_SB_BREADTH;
+            }
         }
         hsbHeight = snapSize(hsb.prefHeight(-1));
         if (hsbHeight == 0) {
             //            println("*** WARNING ScrollPaneSkin: can't get scroll bar height, using {DEFAULT_SB_BREADTH}");
-            hsbHeight = DEFAULT_SB_BREADTH;
+            if (PlatformUtil.isEmbedded()) {
+                hsbHeight = DEFAULT_EMBEDDED_SB_BREADTH;
+            }
+            else {
+                hsbHeight = DEFAULT_SB_BREADTH;
+            }
         }
     }
 
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/caspian/embedded.css	Tue Jan 22 21:05:23 2013 +1300
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/caspian/embedded.css	Tue Jan 22 17:59:07 2013 +0000
@@ -87,8 +87,66 @@
  * ScrollPane                                                                   *
  *                                                                             *
  ******************************************************************************/
+
 .scroll-pane .corner {
-    -fx-background-color: skyblue;    
+    -fx-background-color: transparent;
+}
+
+.scroll-pane > .scroll-bar {
+    -fx-opacity: 100%;
+}
+.scroll-pane > .scroll-bar:horizontal {
+    -fx-background-insets: 1 0 -1 0, 0, 1;
+    -fx-background-color: transparent;
+}
+.scroll-pane > .scroll-bar:vertical {
+    -fx-background-insets: 0 -1 0 1, 0, 1;
+    -fx-background-color: transparent;
+}
+
+.scroll-pane > .scroll-bar:horizontal > .track-background {
+    -fx-background-radius: 1.0em;
+    -fx-opacity: 10%;
+    -fx-background-color: #000000;
+}
+.scroll-pane > .scroll-bar:vertical > .track-background {
+    -fx-background-radius: 1.0em;
+    -fx-opacity: 10%;
+    -fx-background-color: #000000;
+}
+
+.scroll-pane > .scroll-bar:horizontal .thumb {
+    -fx-opacity: 75%;
+    -fx-background-color: #a0a0a0;
+}
+
+.scroll-pane > .scroll-bar:vertical .thumb {
+    -fx-opacity: 75%;
+    -fx-background-color: #a0a0a0;
+}
+.scroll-pane > .scroll-bar .track {
+    -fx-background-color: transparent;
+}
+.scroll-pane > .scroll-bar .track-background {
+    -fx-background-color: transparent;
+}
+
+.scroll-pane > .scroll-bar:horizontal > .track {
+    -xfx-background-color: transparent;
+    -fx-opacity: 10%;
+    -fx-background-color: #000000;
+}
+.scroll-pane > .scroll-bar:vertical > .track {
+    -fx-opacity: 10%;
+    -fx-background-color: #000000;
+}
+.scroll-pane > .scroll-bar:horizontal > .track-background {
+    -fx-opacity: 10%;
+    -fx-background-color: #000000;
+}
+.scroll-pane > .scroll-bar:vertical > .track-background {
+    -fx-opacity: 10%;
+    -fx-background-color: #000000;
 }