Panel moved to Controls.Tizen plugin.
authorTomasz Olszak <olszak.tomasz@gmail.com>
Sun, 11 Aug 2013 20:03:49 +0000 (20:03 +0000)
committerTomasz Olszak <olszak.tomasz@gmail.com>
Sun, 11 Aug 2013 20:07:49 +0000 (22:07 +0200)
Examples fixed. Now there is no need to import
QtQuick.Controls.Styles.Tizen in application

Change-Id: I0a31087a7974dd829385bdbf28169fb0de4e7c6b
Reviewed-by: Jarosław Staniek <staniek@kde.org>
14 files changed:
examples/touch/content/CheckBoxPage.qml
examples/touch/content/ConfigurationPage.qml
examples/touch/main.qml
src/controls/Panel.qml [new file with mode: 0644]
src/controls/controls.pro
src/controls/private/TizenControls.qml
src/controls/qmldir
src/styles/CheckBoxStyle.qml
src/styles/PanelStyle.qml [new file with mode: 0644]
src/styles/TabViewStyle.qml
src/styles/TizenBorderImage.qml
src/styles/private/PrivatePanel.qml [moved from src/styles/Panel.qml with 77% similarity]
src/styles/qmldir
src/styles/styles.pro

index 80f51ef..bdaa585 100644 (file)
@@ -97,7 +97,7 @@ Item {
             x:100
             width:root.width/2
             height: root.height/10
-            styleHints: {"color": "yellow","pressedColor": "red"}
+            styleHints: {"color": "orange","pressedColor": "red"}
             LayoutMirroring.enabled: true
             LayoutMirroring.childrenInherit: true
 
index 83f3106..63e5406 100644 (file)
@@ -29,7 +29,6 @@
 import QtQuick 2.1
 import QtQuick.Controls 1.0
 import QtQuick.Controls.Tizen 1.0
-import QtQuick.Controls.Styles.Tizen 1.0
 import QtQuick.Layouts 1.0
 
 Item {
@@ -70,8 +69,9 @@ Item {
             id: themePanel
             x:15
             width: root.width-30
-            onPressedChanged: {
-                if (pressed)
+            active: false
+            onActiveChanged: {
+                if (active)
                     themeCheckBoxPanel.show()
                 else
                     themeCheckBoxPanel.hide()
@@ -91,7 +91,7 @@ Item {
                 fontSizeMode: Text.Fit
                 MouseArea {
                     anchors.fill: parent
-                    onClicked: themePanel.pressed = !themePanel.pressed
+                    onClicked: themePanel.active = !themePanel.active
                 }
             }
         }
@@ -107,7 +107,6 @@ Item {
                     name:"visible"
                     PropertyChanges {
                         target: themeCheckBoxPanel
-                        //visible: true
                         width: root.width -30
                         height: checkBoxWhite.implicitHeight + spacing + checkBoxBlack.implicitHeight
                     }
@@ -117,10 +116,12 @@ Item {
                 Transition {
                     from: "*"
                     to: "*"
-                    NumberAnimation {
-                        target: themeCheckBoxPanel
-                        properties: "width,height"
-                        duration: 200
+                    ParallelAnimation {
+                        NumberAnimation {
+                            target: themeCheckBoxPanel
+                            properties: "width,height"
+                            duration: 200
+                        }
                     }
                 }
             ]
@@ -132,6 +133,7 @@ Item {
             }
 
             property string theme: TizenControls.currentTheme
+
             onThemeChanged: {
                 checkBoxWhite.checked = TizenControls.currentTheme === "white"
                 checkBoxBlack.checked = TizenControls.currentTheme === "black"
index 1f6b799..a07537c 100644 (file)
@@ -54,7 +54,7 @@ ApplicationWindow {
 
     contentOrientation: Screen.orientation
     property bool pageCurlEffectEnabled: false
-
+    Component.onCompleted: TizenControls.changeTheme("white")
     Item {
         id: rotatedItem
         anchors.fill: parent
diff --git a/src/controls/Panel.qml b/src/controls/Panel.qml
new file mode 100644 (file)
index 0000000..c474f01
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2013 Tomasz Olszak <olszak.tomasz@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls.Private 1.0
+
+Control {
+    id: root
+    property color color
+    property bool active: false
+    style: Qt.createComponent(Settings.style + "/PanelStyle.qml", root)
+}
index 792cc10..d25044d 100644 (file)
@@ -17,7 +17,8 @@ QML_FILES += \
     TimeEdit.qml \
     TitleBar.qml \
     ToolBar.qml \
-    View.qml
+    View.qml \
+    Panel.qml
 
 CONFIG += force_independent
 
index 6aa8e96..11e507a 100644 (file)
@@ -37,6 +37,7 @@ QtObject {
         property QtObject pal: QtObject {
             readonly property color foreground: TizenConfig.colors.foreground
             readonly property color background: TizenConfig.colors.background
+            readonly property color active: TizenConfig.panel.color.pressed
         }
     }
 
index 03e779d..164a704 100644 (file)
@@ -14,3 +14,4 @@ TitleBar 1.0 TitleBar.qml
 TimeEdit 1.0 TimeEdit.qml
 ToolBar 1.0 ToolBar.qml
 View 1.0 View.qml
+Panel 1.0 Panel.qml
index 6e118c8..8d9659e 100644 (file)
@@ -21,6 +21,7 @@ import QtQuick 2.1
 import QtQuick.Controls 1.0
 import QtQuick.Controls.Styles 1.0
 import QtQuick.Controls.Styles.Tizen 1.0
+import "private"
 
 CheckBoxStyle {
     id: checkboxStyle
@@ -49,7 +50,7 @@ CheckBoxStyle {
     }
 
 
-    background: Panel {
+    background: PrivatePanel {
         id:panel
         pressed: control.pressed
         property var pressedColor: control.styleHints && control.styleHints["pressedColor"] ? control.styleHints["pressedColor"]: TizenConfig.panel.color.pressed
diff --git a/src/styles/PanelStyle.qml b/src/styles/PanelStyle.qml
new file mode 100644 (file)
index 0000000..706265f
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2013 Tomasz Olszak <olszak.tomasz@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls.Private 1.0
+import QtQuick.Controls.Styles.Tizen 1.0
+import "private"
+
+Style {
+    id:style
+
+    property Component panel: PrivatePanel {
+        anchors.fill: parent
+        Binding {
+            target: control
+            property: "color"
+            value: control.active ? TizenConfig.panel.color.pressed : TizenConfig.panel.color.normal
+        }
+        backgroundColor: control.color
+    }
+
+}
index e2d4e13..4d3e3df 100644 (file)
@@ -21,13 +21,14 @@ import QtQuick 2.1
 import QtQuick.Controls 1.0
 import QtQuick.Controls.Styles 1.0
 import QtQuick.Controls.Styles.Tizen 1.0
+import "private"
 TabViewStyle {
     id:root
     tabsAlignment: Qt.AlignLeft
     tabOverlap: 0
     frameOverlap: 0
 
-    frame: Panel {
+    frame: PrivatePanel {
         anchors.fill: parent
     }
 
index aa65a60..d0c668a 100644 (file)
@@ -50,6 +50,11 @@ Item {
                                 }
                             "
         }
+        onStatusChanged: {
+            if (status == BorderImage.Error) {
+                console.log("Error while loading BorderImage:"+source)
+            }
+        }
     }
     BorderImage {
         id:effect
@@ -74,6 +79,11 @@ Item {
                                 }
                             "
         }
+        onStatusChanged: {
+            if (status == BorderImage.Error) {
+                console.log("Error while loading BorderImage:"+source)
+            }
+        }
     }
 
 }
similarity index 77%
rename from src/styles/Panel.qml
rename to src/styles/private/PrivatePanel.qml
index 0335e50..01541f9 100644 (file)
@@ -23,8 +23,8 @@ import QtQuick.Controls.Styles.Tizen 1.0
 TizenBorderImage {
     implicitWidth: 200
     implicitHeight: 100
-    property bool pressed:false
-    source: pressed ? TizenConfig.panel.source.pressed : TizenConfig.panel.source.normal
-    effectSource: pressed ? TizenConfig.panel.effectSource.pressed : (activeFocus ? TizenConfig.panel.effectSource.selected : TizenConfig.panel.effectSource.normal)
+    property bool pressed: false
+    source:  "../" + (pressed ? TizenConfig.panel.source.pressed : TizenConfig.panel.source.normal)
+    effectSource: "../" + (pressed ? TizenConfig.panel.effectSource.pressed : (activeFocus ? TizenConfig.panel.effectSource.selected : TizenConfig.panel.effectSource.normal))
     backgroundColor: pressed ? TizenConfig.panel.color.pressed: TizenConfig.panel.color.normal
 }
index 0b7f32d..7362221 100644 (file)
@@ -7,7 +7,7 @@ CheckBoxStyle 1.0 CheckBoxStyle.qml
 ButtonStyle 1.0 ButtonStyle.qml
 SliderStyle 1.0 SliderStyle.qml
 TizenBorderImage 1.0 TizenBorderImage.qml
-Panel 1.0 Panel.qml
+PanelStyle 1.0 PanelStyle.qml
 Floater 1.0 Floater.qml
 SwitchStyle 1.0 SwitchStyle.qml
 DetailButtonStyle 1.0 DetailButtonStyle.qml
index 6bd0785..29c4c38 100644 (file)
@@ -26,11 +26,13 @@ QML_FILES = \
     DateEditStyle.qml\
     TimeEditStyle.qml \
     ToolBarStyle.qml \
-    ToolBarButton.qml
+    ToolBarButton.qml \
+    PanelStyle.qml
 
 QML_FILES += \
     private/DateEditField.qml\
-    private/DateEditBarPicker.qml
+    private/DateEditBarPicker.qml \
+    private/PrivatePanel.qml
 
 # Images
 QML_FILES += \