]> source.dussan.org Git - vaadin-framework.git/commitdiff
ISlider theme improved.
authorJouni Koivuviita <jouni.koivuviita@itmill.com>
Wed, 31 Oct 2007 14:39:53 +0000 (14:39 +0000)
committerJouni Koivuviita <jouni.koivuviita@itmill.com>
Wed, 31 Oct 2007 14:39:53 +0000 (14:39 +0000)
svn changeset:2638/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/ISlider.java
src/com/itmill/toolkit/terminal/gwt/public/default/slider/img/handle-horizontal.png
src/com/itmill/toolkit/terminal/gwt/public/default/slider/img/handle-vertical.png
src/com/itmill/toolkit/terminal/gwt/public/default/slider/slider.css

index e5532d5de906eb5f4394390ffc13cba72d77baca..9f090518c9776fff56cbb554114833bcc4207d57 100644 (file)
@@ -271,13 +271,21 @@ public class ISlider extends Widget implements Paintable,
                } else\r
                        DOM.setStyleAttribute(handle, styleAttribute, ((int) pos) + "px");\r
 \r
+               // Round value to resolution\r
+               if (resolution > 0) {\r
+                       v = (int) (v * (double) Math.pow(10, resolution));\r
+                       v = v / (double) Math.pow(10, resolution);\r
+               } else\r
+                       v = Math.round(v);\r
+               \r
                // TODO give more detailed info when dragging and do roundup\r
                DOM.setElementAttribute(handle, "title", "" + v);\r
-\r
-               this.value = value;\r
+               \r
+               // Update value\r
+               this.value = new Double(v);\r
 \r
                if (updateToServer)\r
-                       client.updateVariable(id, "value", value.doubleValue(), immediate);\r
+                       client.updateVariable(id, "value", this.value.doubleValue(), immediate);\r
        }\r
 \r
        public void onBrowserEvent(Event event) {\r
@@ -412,14 +420,6 @@ public class ISlider extends Widget implements Paintable,
                else if (v > max)\r
                        v = max;\r
 \r
-               if (roundup) {\r
-                       if (resolution > 0) {\r
-                               v = (int) (v * (double) Math.pow(10, resolution));\r
-                               v = v / (double) Math.pow(10, resolution);\r
-                       } else\r
-                               v = Math.round(v);\r
-               }\r
-\r
                setValue(new Double(v), animate, roundup);\r
        }\r
 \r
index a4fc19d5ad91ccf68e00be4e078245c7f08c624a..620b86f1da6f41582221690f36b4d4fd83cc1fd9 100755 (executable)
Binary files a/src/com/itmill/toolkit/terminal/gwt/public/default/slider/img/handle-horizontal.png and b/src/com/itmill/toolkit/terminal/gwt/public/default/slider/img/handle-horizontal.png differ
index 280fff8fab1fa4d086dbcf7ae75740903cd87327..b7f63b91b7a8f3c3c75a025e98fbd60d4b9065ff 100755 (executable)
Binary files a/src/com/itmill/toolkit/terminal/gwt/public/default/slider/img/handle-vertical.png and b/src/com/itmill/toolkit/terminal/gwt/public/default/slider/img/handle-vertical.png differ
index fb9fb43e4348099c61c8a431804bbd2df2d7c125..5b10e6a110075c0aa15b39f9353226bc6ffcc547 100644 (file)
@@ -3,24 +3,27 @@
   --------------------------*/
 
 .i-slider {
-       border: 1px solid #d8dbdc;
-       height: 2px;
+       border: 1px solid #cccfd0;
+       height: 3px;
        margin: 5px 0;
 }
 
 .i-slider-base {
-       height: 1px;
-       border-top: 1px solid #e5e8e8;
-       background: #fff;
+       height: 2px;
+       border-top: 1px solid #cbcdce;
+       background: #f3f3f4;
 }
 .i-slider-handle {
-       background: #babfc0 url(img/handle-horizontal.png);
-       width: 7px;
-       height: 15px;
+       background: transparent url(img/handle-horizontal.png);
+       width: 12px;
+       height: 12px;
        margin-top: -5px;
        font-size: 0;
        cursor: pointer;
 }
+.i-slider-handle:hover {
+       background-position: left bottom;
+}
 /* TODO
 .i-slider-bigger {
        background: #dde4ef url(img/arrow-right.png);
   -----------------*/
 
 .i-slider-vertical {
-       width: 2px;
+       width: 3px;
        height: auto;
        margin: 0 5px;
 }
 .i-slider-vertical .i-slider-base {
-       width: 1px;
-       border-left: 1px solid #e5e8e8;
-       background: #fff;
+       width: 2px;
+       border-left: 1px solid #cbcdce;
+       background: #f3f3f4;
 }
 .i-slider-vertical .i-slider-handle {
-       background: #babfc0 url(img/handle-vertical.png);
-       width: 14px;
-       height: 7px;
+       background: transparent url(img/handle-vertical.png);
+       width: 12px;
+       height: 12px;
        font-size: 0;
        cursor: pointer;
-       margin-left: -7px;
+       margin-left: -5px;
+}
+.i-slider-vertical .i-slider-handle:hover {
+       background-position: left bottom;
 }
 .i-slider-vertical .i-slider-bigger {
 
 }
 .i-slider-vertical .i-slider-smaller {
 
+}
+
+
+
+/* IE specific styles */
+
+* html .i-slider,
+* html .i-slider-vertical {
+       margin: 0;
+}
+* html .i-slider .i-slider-handle {
+       margin: -1px 0;
+}
+* html .i-slider-vertical .i-slider-handle {
+       margin: 0 -1px;
 }
\ No newline at end of file