From 993410e101ebc5b138dc3470c8a25d969f26fdd1 Mon Sep 17 00:00:00 2001 From: Jinhyuk Jun Date: Thu, 3 Jan 2013 11:25:54 +0900 Subject: [PATCH] toggleswitch : text switch bug fix change text toggleswitch view to jQM style(UX doesn't exist) Change-Id: Iefaceb351797dc1b40323ec0650ba898118ce7a2 --- demos/tizen-winsets/index.html | 1 + .../tizen-winsets/widgets/switch/toggleswitch.css | 3 ++ .../tizen-winsets/widgets/switch/toggleswitch.html | 46 +++++++++++----------- .../common/jquery.mobile.tizen.toggleswitch.less | 36 ++++++++++++++--- 4 files changed, 57 insertions(+), 29 deletions(-) create mode 100755 demos/tizen-winsets/widgets/switch/toggleswitch.css diff --git a/demos/tizen-winsets/index.html b/demos/tizen-winsets/index.html index 1af25f2..260572d 100755 --- a/demos/tizen-winsets/index.html +++ b/demos/tizen-winsets/index.html @@ -296,5 +296,6 @@ + diff --git a/demos/tizen-winsets/widgets/switch/toggleswitch.css b/demos/tizen-winsets/widgets/switch/toggleswitch.css new file mode 100755 index 0000000..a31faef --- /dev/null +++ b/demos/tizen-winsets/widgets/switch/toggleswitch.css @@ -0,0 +1,3 @@ +.containing-element .ui-slider-switch { + width : 9em; +} \ No newline at end of file diff --git a/demos/tizen-winsets/widgets/switch/toggleswitch.html b/demos/tizen-winsets/widgets/switch/toggleswitch.html index 17539db..cd4bb9b 100755 --- a/demos/tizen-winsets/widgets/switch/toggleswitch.html +++ b/demos/tizen-winsets/widgets/switch/toggleswitch.html @@ -3,38 +3,36 @@

ToggleSwitch

+ -

- - - - -

- - - - - - +

- + -
+ + + +
+

+
+ + +
+

+ add element's width to css file
+  .containing-element .ui-slider-switch {
+   width : 9em;
+  }
+

diff --git a/src/themes/tizen/common/jquery.mobile.tizen.toggleswitch.less b/src/themes/tizen/common/jquery.mobile.tizen.toggleswitch.less index 784ae08..344e4e8 100755 --- a/src/themes/tizen/common/jquery.mobile.tizen.toggleswitch.less +++ b/src/themes/tizen/common/jquery.mobile.tizen.toggleswitch.less @@ -31,34 +31,60 @@ div.ui-slider.ui-toggle-switch { } } } +.ui-slider-switch:not(.ui-toggle-switch) { + width : 92 * @unit_base; +} div.ui-slider.ui-slider-switch:not(.ui-toggle-switch) { position : relative; - width : 5.5em; + height : 32 * @unit_base; + border-radius : 15 * @unit_base; + + .ui-slider-inneroffset { + position : relative; + margin : -1px 16 * @unit_base; + z-index : 1; + } a.ui-slider-handle { position : absolute; background : rgba(255, 255, 255, 1); - top : -34 * @unit_base; - margin-top : 30 * @unit_base; + top : 50%; + margin : 1px 0 0 -15 * @unit_base; border-radius : 15 * @unit_base; border : 2px solid gray; + + width : 28 * @unit_base; + height : 28 * @unit_base; } + + a.ui-slider-handle-snapping { + -webkit-transition : left 70ms linear; + } + span { position : absolute; overflow : hidden; text-align : center; height : 32 * @unit_base; font-weight : bold; - border-radius : 10 * @unit_base; + font-size : 16 * @unit_base; + border-radius : 15 * @unit_base; + white-space : nowrap; + line-height : 2; + &.ui-slider-label-a { left : 0px; color : white; + z-index : 1; + text-indent : -1.5em; } &.ui-slider-label-b { right : 0px; color : black; + z-index : 0; + text-indent : 1.5em; } } -} \ No newline at end of file +} -- 2.7.4