DefaultSettings.js import changed from Default to Theme
authorTomasz Olszak <olszak.tomasz@gmail.com>
Thu, 30 May 2013 12:55:05 +0000 (12:55 +0000)
committerTomasz Olszak <olszak.tomasz@gmail.com>
Thu, 30 May 2013 12:58:36 +0000 (14:58 +0200)
Change-Id: I6e025bd0c6a5cfc3362a4d22e338aaee9bcfb32d
Reviewed-by: Tomasz Olszak <olszak.tomasz@gmail.com>
src/styles/ButtonStyle.qml
src/styles/CheckBoxStyle.qml
src/styles/Panel.qml
src/styles/ProgressBarStyle.qml
src/styles/SliderStyle.qml
src/styles/SwitchStyle.qml
src/styles/TabViewStyle.qml
src/styles/qmldir

index cd9ab8d..b322649 100644 (file)
@@ -20,7 +20,7 @@
 import QtQuick 2.1
 import QtQuick.Controls 1.0
 import QtQuick.Controls.Styles 1.0
-import "DefaultSettings.js" as Default
+import "DefaultSettings.js" as Theme
 
 ButtonStyle {
     id: buttonstyle
@@ -28,9 +28,9 @@ ButtonStyle {
     background: TizenBorderImage {
         implicitWidth: 400
         implicitHeight: 80
-        source: control.enabled ? (control.pressed ? Default.button.source.pressed: Default.button.source.normal) : Default.button.source.disabled
-        effectSource: control.enabled ? (control.pressed ? Default.button.effectSource.pressed: Default.button.effectSource.normal) : Default.button.effectSource.disabled
-        backgroundColor: control.enabled ? (control.pressed ? Default.button.backgroundColor.pressed: Default.button.backgroundColor.normal) : Default.button.backgroundColor.disabled
+        source: control.enabled ? (control.pressed ? Theme.button.source.pressed: Theme.button.source.normal) : Theme.button.source.disabled
+        effectSource: control.enabled ? (control.pressed ? Theme.button.effectSource.pressed: Theme.button.effectSource.normal) : Theme.button.effectSource.disabled
+        backgroundColor: control.enabled ? (control.pressed ? Theme.button.backgroundColor.pressed: Theme.button.backgroundColor.normal) : Theme.button.backgroundColor.disabled
     }
 
     /*! The label of the button. */
@@ -39,18 +39,18 @@ ButtonStyle {
         implicitHeight: 0
         Text {
             id:txt
-            anchors.leftMargin: Default.button.text.margins.left
-            anchors.rightMargin: Default.button.text.margins.right
-            anchors.topMargin: Default.button.text.margins.top
-            anchors.bottomMargin: Default.button.text.margins.bottom
+            anchors.leftMargin: Theme.button.text.margins.left
+            anchors.rightMargin: Theme.button.text.margins.right
+            anchors.topMargin: Theme.button.text.margins.top
+            anchors.bottomMargin: Theme.button.text.margins.bottom
             anchors.fill:parent
-            font.pixelSize: Default.button.font.pixelSize
-            color: control.enabled ? (control.pressed ? Default.button.text.color.pressed : Default.button.text.color.normal) : Default.button.text.color.disabled
+            font.pixelSize: Theme.button.font.pixelSize
+            color: control.enabled ? (control.pressed ? Theme.button.text.color.pressed : Theme.button.text.color.normal) : Theme.button.text.color.disabled
             fontSizeMode: Text.Fit
             horizontalAlignment: Text.AlignHCenter
             verticalAlignment: Text.AlignVCenter
             text:control.text
-            minimumPixelSize: Default.button.font.minimumPixelSize
+            minimumPixelSize: Theme.button.font.minimumPixelSize
             maximumLineCount:2
             wrapMode: Text.Wrap
         }
index f54c9d0..b42f72f 100644 (file)
@@ -20,7 +20,7 @@
 import QtQuick 2.1
 import QtQuick.Controls 1.0
 import QtQuick.Controls.Styles 1.0
-import "DefaultSettings.js" as Default
+import "DefaultSettings.js" as Theme
 
 CheckBoxStyle {
     id: checkboxStyle
@@ -28,15 +28,15 @@ CheckBoxStyle {
 
     label: Text {
         text: control.text
-        font.pointSize: Default.checkBox.font.pixelSize
+        font.pointSize: Theme.checkBox.font.pixelSize
         color:if (control.enabled) {
                   if (control.pressed) {
-                      Default.checkBox.text.color.pressed
+                      Theme.checkBox.text.color.pressed
                   } else {
-                      Default.checkBox.text.color.normal
+                      Theme.checkBox.text.color.normal
                   }
               } else {
-                  Default.checkBox.text.color.disabled
+                  Theme.checkBox.text.color.disabled
               }
         verticalAlignment: Text.AlignVCenter
     }
@@ -50,11 +50,11 @@ CheckBoxStyle {
         implicitHeight: bg.implicitHeight
         Image {
             id:bg
-            source: control.enabled ? (control.pressed? Default.checkBox.indicator.source.pressed: Default.checkBox.indicator.source.normal):Default.checkBox.indicator.source.disabled
+            source: control.enabled ? (control.pressed? Theme.checkBox.indicator.source.pressed: Theme.checkBox.indicator.source.normal):Theme.checkBox.indicator.source.disabled
             anchors.centerIn:parent
             Image {
                 visible: control.checked
-                source: control.enabled ? (control.pressed || !control.checked ? Default.checkBox.indicator.markSource.pressed: Default.checkBox.indicator.markSource.normal):Default.checkBox.indicator.markSource.disabled
+                source: control.enabled ? (control.pressed || !control.checked ? Theme.checkBox.indicator.markSource.pressed: Theme.checkBox.indicator.markSource.normal):Theme.checkBox.indicator.markSource.disabled
             }
         }        
     }
@@ -72,15 +72,15 @@ CheckBoxStyle {
         TizenBorderImage {
             id:detailsBg
             anchors.centerIn: parent
-            source: Default.checkBox.details.source.normal
-            backgroundColor: control.enabled ? (control.pressed ? Default.checkBox.details.color.pressed : Default.checkBox.details.color.normal) : Default.checkBox.details.color.disabled
-            effectSource: control.enabled ? (control.pressed ? Default.checkBox.details.effectSource.pressed : Default.checkBox.details.effectSource.normal) : Default.checkBox.details.effectSource.disabled
+            source: Theme.checkBox.details.source.normal
+            backgroundColor: control.enabled ? (control.pressed ? Theme.checkBox.details.color.pressed : Theme.checkBox.details.color.normal) : Theme.checkBox.details.color.disabled
+            effectSource: control.enabled ? (control.pressed ? Theme.checkBox.details.effectSource.pressed : Theme.checkBox.details.effectSource.normal) : Theme.checkBox.details.effectSource.disabled
         }
         TizenBorderImage {
             anchors.centerIn: detailsBg
-            source: Default.checkBox.details.iconSource.normal
-            backgroundColor: control.enabled ? (control.pressed ? Default.checkBox.details.iconColor.pressed : Default.checkBox.details.iconColor.normal) : Default.checkBox.details.iconColor.disabled
-            effectSource: Default.checkBox.details.iconEffectSource.normal
+            source: Theme.checkBox.details.iconSource.normal
+            backgroundColor: control.enabled ? (control.pressed ? Theme.checkBox.details.iconColor.pressed : Theme.checkBox.details.iconColor.normal) : Theme.checkBox.details.iconColor.disabled
+            effectSource: Theme.checkBox.details.iconEffectSource.normal
         }
     }
 
@@ -101,9 +101,9 @@ CheckBoxStyle {
             anchors.left: backgroundLoader.left
             anchors.top: backgroundLoader.top
             anchors.bottom: backgroundLoader.bottom
-            anchors.leftMargin: Default.checkBox.margins.left
-            anchors.topMargin: Default.checkBox.margins.top
-            anchors.bottomMargin: Default.checkBox.margins.bottom
+            anchors.leftMargin: Theme.checkBox.margins.left
+            anchors.topMargin: Theme.checkBox.margins.top
+            anchors.bottomMargin: Theme.checkBox.margins.bottom
         }
         Loader {
             id: labelLoader
@@ -112,8 +112,8 @@ CheckBoxStyle {
             anchors.top: backgroundLoader.top
             anchors.bottom: backgroundLoader.bottom
             anchors.right: detailsLoader.left
-            anchors.topMargin: Default.checkBox.margins.top
-            anchors.bottomMargin: Default.checkBox.margins.bottom
+            anchors.topMargin: Theme.checkBox.margins.top
+            anchors.bottomMargin: Theme.checkBox.margins.bottom
             sourceComponent: label
         }
 
@@ -122,9 +122,9 @@ CheckBoxStyle {
             anchors.top: backgroundLoader.top
             anchors.bottom: backgroundLoader.bottom
             anchors.right: backgroundLoader.right
-            anchors.topMargin: Default.checkBox.margins.top
-            anchors.bottomMargin: Default.checkBox.margins.bottom
-            anchors.rightMargin: Default.checkBox.margins.right
+            anchors.topMargin: Theme.checkBox.margins.top
+            anchors.bottomMargin: Theme.checkBox.margins.bottom
+            anchors.rightMargin: Theme.checkBox.margins.right
             sourceComponent: showDetails ? details : null
         }
     }
index 62e8557..1396d88 100644 (file)
  */
 
 import QtQuick 2.1
-import "DefaultSettings.js" as Default
+import "DefaultSettings.js" as Theme
 
 TizenBorderImage {
     implicitWidth: 200
     implicitHeight: 100
     property bool pressed:false
-    source: pressed ? Default.panel.source.pressed : Default.panel.source.normal
-    effectSource: pressed ? Default.panel.effectSource.pressed : (activeFocus ? Default.panel.effectSource.selected : Default.panel.effectSource.normal)
-    backgroundColor: pressed ? Default.panel.color.pressed: Default.panel.color.normal
+    source: pressed ? Theme.panel.source.pressed : Theme.panel.source.normal
+    effectSource: pressed ? Theme.panel.effectSource.pressed : (activeFocus ? Theme.panel.effectSource.selected : Theme.panel.effectSource.normal)
+    backgroundColor: pressed ? Theme.panel.color.pressed: Theme.panel.color.normal
 }
index caaed68..80e5a5b 100644 (file)
 import QtQuick 2.1
 import QtQuick.Controls 1.0
 import QtQuick.Controls.Styles 1.0
-import "DefaultSettings.js" as Default
+import "DefaultSettings.js" as Theme
 
 ProgressBarStyle {
     id: progressBarStyle
 
-    padding.left: Default.progress.margins.left
-    padding.right: Default.progress.margins.right
+    padding.left: Theme.progress.margins.left
+    padding.right: Theme.progress.margins.right
     progress: Item {
         implicitWidth: bar.implicitWidth
         implicitHeight: bar.implicitHeight
@@ -34,9 +34,9 @@ ProgressBarStyle {
             id:bar
             anchors.centerIn: parent
             width: parent.width
-            source: Default.progress.source.normal
-            backgroundColor: Default.progress.progressColor
-            effectSource: Default.progress.effectSource.normal
+            source: Theme.progress.source.normal
+            backgroundColor: Theme.progress.progressColor
+            effectSource: Theme.progress.effectSource.normal
         }
     }
 
@@ -48,10 +48,10 @@ ProgressBarStyle {
             id:bg
             anchors.centerIn: parent
             width:parent.width
-            height:Default.progress.height
-            source: Default.progress.backgroundSource.normal
-            backgroundColor: Default.progress.backgroundColor
-            effectSource: Default.progress.backgroundEffectSource.normal
+            height:Theme.progress.height
+            source: Theme.progress.backgroundSource.normal
+            backgroundColor: Theme.progress.backgroundColor
+            effectSource: Theme.progress.backgroundEffectSource.normal
         }
     }
 }
index d966373..dac5c26 100644 (file)
@@ -20,7 +20,7 @@
 import QtQuick 2.1
 import QtQuick.Controls 1.0
 import QtQuick.Controls.Styles 1.0
-import "DefaultSettings.js" as Default
+import "DefaultSettings.js" as Theme
 
 SliderStyle {
     id: styleitem
@@ -46,22 +46,22 @@ SliderStyle {
             id:floater
             content: TizenBorderImage {
                 smooth: true
-                implicitWidth: Math.max(txt.contentWidth+txt.anchors.margins, Default.slider.handle.overlay.width)
-                implicitHeight: Default.slider.handle.overlay.height
-                //height: Default.slider.handle.overlay.height
-                source: Default.slider.handle.overlay.source
-                backgroundColor: Default.slider.handle.overlay.backgroundColor
-                effectSource: Default.slider.handle.overlay.effectSource
+                implicitWidth: Math.max(txt.contentWidth+txt.anchors.margins, Theme.slider.handle.overlay.width)
+                implicitHeight: Theme.slider.handle.overlay.height
+                //height: Theme.slider.handle.overlay.height
+                source: Theme.slider.handle.overlay.source
+                backgroundColor: Theme.slider.handle.overlay.backgroundColor
+                effectSource: Theme.slider.handle.overlay.effectSource
                 Text {
                     id:txt
                     anchors.top: parent.top
                     anchors.left:  parent.left
                     anchors.right: parent.right
-                    height: Default.slider.handle.overlay.heightWithoutArrow
-                    anchors.leftMargin: Default.slider.handle.overlay.margin
-                    anchors.rightMargin:  Default.slider.handle.overlay.margin
-                    font.pixelSize: Default.slider.handle.overlay.font.pixelSize
-                    color: Default.slider.handle.overlay.text.color
+                    height: Theme.slider.handle.overlay.heightWithoutArrow
+                    anchors.leftMargin: Theme.slider.handle.overlay.margin
+                    anchors.rightMargin:  Theme.slider.handle.overlay.margin
+                    font.pixelSize: Theme.slider.handle.overlay.font.pixelSize
+                    color: Theme.slider.handle.overlay.text.color
                     verticalAlignment: Text.AlignVCenter
                     horizontalAlignment: Text.AlignHCenter
                     text: control.value
@@ -80,27 +80,27 @@ SliderStyle {
             id:bg
 
             anchors.centerIn: parent
-            source: Default.slider.handle.source.normal
+            source: Theme.slider.handle.source.normal
             effectSource: if (control.enabled) {
                               control.pressed ?
-                                          Default.slider.handle.effectSource.pressed:
-                                          Default.slider.handle.effectSource.normal
+                                          Theme.slider.handle.effectSource.pressed:
+                                          Theme.slider.handle.effectSource.normal
                           } else {
-                              Default.slider.handle.effectSource.disabled
+                              Theme.slider.handle.effectSource.disabled
                           }
 
-            backgroundColor: control.enabled ? (control.pressed ? Default.slider.handle.backgroundColor.pressed : Default.slider.handle.backgroundColor.normal):Default.slider.handle.backgroundColor.disabled
+            backgroundColor: control.enabled ? (control.pressed ? Theme.slider.handle.backgroundColor.pressed : Theme.slider.handle.backgroundColor.normal):Theme.slider.handle.backgroundColor.disabled
 
             Text {
                 visible:!control.pressed
                 text: control.value
                 anchors.fill: parent
-                anchors.margins: Default.slider.handle.text.margins
+                anchors.margins: Theme.slider.handle.text.margins
                 fontSizeMode: Text.Fit
-                font.pointSize: Default.slider.handle.font.pointSize
+                font.pointSize: Theme.slider.handle.font.pointSize
                 horizontalAlignment: Text.AlignHCenter
                 verticalAlignment: Text.AlignVCenter
-                color: control.enabled ? Default.slider.handle.text.color.normal : Default.slider.handle.text.color.disabled
+                color: control.enabled ? Theme.slider.handle.text.color.normal : Theme.slider.handle.text.color.disabled
             }
         }
     }
index 450b5fb..dea743d 100644 (file)
@@ -21,10 +21,9 @@ import QtQuick 2.1
 import QtQuick.Controls 1.0
 import QtQuick.Controls.Private 1.0
 import QtQuick.Controls.Tizen 1.0
-import "DefaultSettings.js" as Default
+import "DefaultSettings.js" as Theme
 
-
-PaddedStyle {
+Style {
     id: styleitem
 
     /*! The \l Slider attached to this style. */
@@ -41,9 +40,9 @@ PaddedStyle {
         Image {
             id:icon
             anchors.fill: parent
-            source: control.enabled ? ( control.pressed ? Default.checkBox.onOff.icon.source.pressed : Default.checkBox.onOff.icon.source.normal) :  Default.checkBox.onOff.icon.source.disabled
+            source: control.enabled ? ( control.pressed ? Theme.checkBox.onOff.icon.source.pressed : Theme.checkBox.onOff.icon.source.normal) :  Theme.checkBox.onOff.icon.source.disabled
             Image {
-                source: control.enabled ? ( control.pressed ? Default.checkBox.onOff.handlerSource.pressed : Default.checkBox.onOff.handlerSource.normal) :  Default.checkBox.onOff.handlerSource.disabled
+                source: control.enabled ? ( control.pressed ? Theme.checkBox.onOff.handlerSource.pressed : Theme.checkBox.onOff.handlerSource.normal) :  Theme.checkBox.onOff.handlerSource.disabled
             }
         }
     }
@@ -58,9 +57,9 @@ PaddedStyle {
             id:onOffBackground
             anchors.fill: parent
             source: if (control.checked) {
-                        control.enabled ? Default.checkBox.onOff.backgroundSource.on.normal :  Default.checkBox.onOff.backgroundSource.on.disabled
+                        control.enabled ? Theme.checkBox.onOff.backgroundSource.on.normal :  Theme.checkBox.onOff.backgroundSource.on.disabled
                     } else {
-                        control.enabled ? Default.checkBox.onOff.backgroundSource.off.normal :  Default.checkBox.onOff.backgroundSource.off.disabled
+                        control.enabled ? Theme.checkBox.onOff.backgroundSource.off.normal :  Theme.checkBox.onOff.backgroundSource.off.disabled
                     }
         }
     }
index c240c71..0a653c6 100644 (file)
@@ -1,8 +1,7 @@
 import QtQuick 2.0
 import QtQuick.Controls 1.0
 import QtQuick.Controls.Styles 1.0
-import "DefaultSettings.js" as Default
-
+import "DefaultSettings.js" as Theme
 TabViewStyle {
     id:root
     tabsAlignment: Qt.AlignLeft
@@ -18,35 +17,35 @@ TabViewStyle {
     tab: Item {
         scale: control.tabPosition === Qt.TopEdge ? 1 : -1
 
-        implicitWidth: Math.min(Math.max(textitem.contentWidth, Default.tabBar.tab.minWidth)+2*Default.tabBar.tab.margin,Default.tabBar.tab.maxWidth)
-        implicitHeight: Default.tabBar.height
+        implicitWidth: Math.min(Math.max(textitem.contentWidth, Theme.tabBar.tab.minWidth)+2*Theme.tabBar.tab.margin,Theme.tabBar.tab.maxWidth)
+        implicitHeight: Theme.tabBar.height
 
         TizenBorderImage {
             id: background
             anchors.fill: parent
-            source: Default.tabBar.source
-            backgroundColor: Default.tabBar.color
-            //effectSource: Default.tabBar.effectSource
-            //foregroundColor: (tab.selected) ? Default.tabBar.tab.color.selected: Default.tabBar.tab.color.normal
+            source: Theme.tabBar.source
+            backgroundColor: Theme.tabBar.color
+            //effectSource: Theme.tabBar.effectSource
+            //foregroundColor: (tab.selected) ? Theme.tabBar.tab.color.selected: Theme.tabBar.tab.color.normal
         }
         TizenBorderImage {
             anchors.verticalCenter: background.verticalCenter
 
-            height: Default.tabBar.tab.height
+            height: Theme.tabBar.tab.height
             anchors.left: background.left
             anchors.right: background.right
-            anchors.leftMargin: Default.tabBar.tab.margin
-            anchors.rightMargin: Default.tabBar.tab.margin
-            source: Default.tabBar.tab.source.normal
-            backgroundColor: (tab.selected) ? Default.tabBar.tab.color.selected: Default.tabBar.tab.color.normal
+            anchors.leftMargin: Theme.tabBar.tab.margin
+            anchors.rightMargin: Theme.tabBar.tab.margin
+            source: Theme.tabBar.tab.source.normal
+            backgroundColor: (tab.selected) ? Theme.tabBar.tab.color.selected: Theme.tabBar.tab.color.normal
             Text {
                 id: textitem
                 anchors.fill: parent
                 text: tab.title
                 renderType: Text.NativeRendering
                 scale: control.tabPosition === Qt.TopEdge ? 1 : -1
-                color: tab.selected ? Default.tabBar.tab.text.color.selected : Default.tabBar.tab.text.color.normal
-                font.pixelSize: Default.tabBar.tab.font.pixelSize
+                color: tab.selected ? Theme.tabBar.tab.text.color.selected : Theme.tabBar.tab.text.color.normal
+                font.pixelSize: Theme.tabBar.tab.font.pixelSize
                 verticalAlignment: Text.AlignVCenter
                 horizontalAlignment: Text.AlignHCenter
             }
index def51fb..f1d8fe5 100644 (file)
@@ -1,6 +1,5 @@
 module QtQuick.Controls.Styles.Tizen
 
-
 ProgressBarStyle 1.0 ProgressBarStyle.qml
 CheckBoxStyle 1.0 CheckBoxStyle.qml
 ButtonStyle 1.0 ButtonStyle.qml
@@ -8,8 +7,6 @@ SliderStyle 1.0 SliderStyle.qml
 TizenBorderImage 1.0 TizenBorderImage.qml
 Panel 1.0 Panel.qml
 Floater 1.0 Floater.qml
-Switch 1.0 Switch.qml
 SwitchStyle 1.0 SwitchStyle.qml
-
-
+Theme 1.0 DefaultSettings.js