Added screen orientation handling and configuration page.
authorTomasz Olszak <olszak.tomasz@gmail.com>
Fri, 9 Aug 2013 13:24:00 +0000 (15:24 +0200)
committerTomasz Olszak <olszak.tomasz@gmail.com>
Sat, 10 Aug 2013 14:45:39 +0000 (16:45 +0200)
Now Page effect is turned off by default. And can be turned on in
configuration page. Also some polishing related to build example
on PC was added and application color pallete updated.

Change-Id: I85248a5e152b749396025b11d4bd88a3ca8b796a
Reviewed-by: Jarosław Staniek <staniek@kde.org>
Reviewed-by: Tomasz Olszak <olszak.tomasz@gmail.com>
20 files changed:
examples/touch/content/AndroidDelegate.qml
examples/touch/content/ButtonPage.qml
examples/touch/content/ConfigurationPage.qml [new file with mode: 0644]
examples/touch/content/ContextMenuPage.qml
examples/touch/content/PageCurl.qml
examples/touch/images/NOTICE.txt
examples/touch/images/mainmenu.png [new file with mode: 0644]
examples/touch/main.cpp
examples/touch/main.qml
examples/touch/tizen/qt.conf [moved from examples/touch/qt.conf with 70% similarity]
examples/touch/touch-default.qrc [moved from examples/touch/touch.qrc with 92% similarity]
examples/touch/touch-tizen.qrc [new file with mode: 0644]
examples/touch/touch.pro
src/controls/View.qml
src/styles/Floater.qml
src/styles/TitleBarStyle.qml
src/styles/ViewStyle.qml
src/styles/internal_resources.qrc
src/styles/private/TizenStyleConfig.qml
src/styles/styles.pro

index d23f6e0..e40da1d 100644 (file)
@@ -41,6 +41,7 @@
 import QtQuick 2.1
 import QtQuick.Controls.Styles.Tizen 1.0
 import QtQuick.Controls.Tizen 1.0
+import QtQuick.Controls 1.0
 
 Item {
     id: root
@@ -56,11 +57,11 @@ Item {
         visible: detailButton.pressed
     }
 
-    Text {
+    Label {
         id: textitem
         color: TizenConfig.colors.foreground
         font.pixelSize: 32
-        text: modelData
+        font.family: TizenConfig.fonts.defaultFamily
         anchors.verticalCenter: parent.verticalCenter
         anchors.left: parent.left
         anchors.leftMargin: 30
@@ -78,7 +79,6 @@ Item {
         id: mouse
         anchors.fill: parent
         onClicked: root.clicked()
-
     }
 
 
index 3c94e32..8ff9f5f 100644 (file)
@@ -53,7 +53,7 @@ Item {
         Button {
             anchors.margins: 20
             text: "Press me"
-            styleHints:( {color:"yellow",pressedColor:"red"})
+            styleHints:( {color:"orange",pressedColor:"red"})
         }
 
         Button {
diff --git a/examples/touch/content/ConfigurationPage.qml b/examples/touch/content/ConfigurationPage.qml
new file mode 100644 (file)
index 0000000..7a74285
--- /dev/null
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) 2013 Tomasz Olszak <olszak.tomasz@gmail.com>
+ * All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+
+ * 1. Redistributions of source code must retain the copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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 {
+    id:root
+    width: parent.width
+    height: parent.height
+    VisualItemModel {
+        id: itemModel
+        Panel {
+            x: 15
+            width: root.width - 30
+            Label {
+                id: pageEffectLabel
+                anchors.margins: 10
+                anchors.left: parent.left
+                anchors.top: parent.top
+                anchors.bottom: parent.bottom
+                anchors.right: pageEffectSwitch.left
+                text: "Page effect "+ ((pageEffectSwitch.checked) ? "on" : "off")
+                color: TizenConfig.colors.foreground
+                verticalAlignment: Text.AlignVCenter
+                horizontalAlignment: Text.AlignLeft
+                font.family: TizenConfig.fonts.defaultFamily
+                font.pixelSize: parent.height/2
+                fontSizeMode: Text.Fit
+            }
+            Switch {
+                id: pageEffectSwitch
+                anchors.verticalCenter: parent.verticalCenter
+                anchors.right: parent.right
+                checked: appWindow.pageCurlEffectEnabled
+                onCheckedChanged: {
+                    appWindow.pageCurlEffectEnabled = checked
+                }
+            }
+        }
+        Panel {
+            id: themePanel
+            x:15
+            width: root.width-30
+            onPressedChanged: {
+                if (pressed)
+                    themeCheckBoxPanel.show()
+                else
+                    themeCheckBoxPanel.hide()
+            }
+            Label {
+                id: themeLabel
+                anchors.margins: 10
+                anchors.left: parent.left
+                anchors.right: parent.right
+                height:parent.implicitHeight
+                text: "Theme: "+ TizenConfig.theme
+                color: TizenConfig.colors.foreground
+                verticalAlignment: Text.AlignVCenter
+                horizontalAlignment: Text.AlignLeft
+                font.family: TizenConfig.fonts.defaultFamily
+                font.pixelSize: parent.height/2
+                fontSizeMode: Text.Fit
+                MouseArea {
+                    anchors.fill: parent
+                    onClicked: themePanel.pressed = !themePanel.pressed
+                }
+            }
+        }
+        ColumnLayout {
+            id: themeCheckBoxPanel
+            x: 15
+            spacing:0
+            width:0
+            height:0
+            visible: height > 0
+            states: [
+                State {
+                    name:"visible"
+                    PropertyChanges {
+                        target: themeCheckBoxPanel
+                        //visible: true
+                        width: root.width -30
+                        height: checkBoxWhite.implicitHeight + spacing + checkBoxBlack.implicitHeight
+                    }
+                }
+            ]
+            transitions: [
+                Transition {
+                    from: "*"
+                    to: "*"
+                    NumberAnimation {
+                        target: themeCheckBoxPanel
+                        properties: "width,height"
+                        duration: 200
+                    }
+                }
+            ]
+            function show() {
+                state = "visible"
+            }
+            function hide() {
+                state = ""
+            }
+
+            property string theme: TizenConfig.theme
+            onThemeChanged: {
+                checkBoxWhite.checked = TizenConfig.theme === "white"
+                checkBoxBlack.checked = TizenConfig.theme === "black"
+            }
+            CheckBox {
+                id: checkBoxWhite
+                Layout.fillWidth: true
+                Layout.fillHeight: true
+                text: "White"
+                onClicked: TizenConfig.theme = "white"
+            }
+            CheckBox {
+                id: checkBoxBlack
+                Layout.fillWidth: true
+                Layout.fillHeight: true
+                text: "Black"
+                onClicked: TizenConfig.theme = "black"
+            }
+        }
+    }
+
+    ListView {
+        anchors.fill: parent
+        model: itemModel
+        spacing: 5
+    }
+}
index 1856f23..b356d8f 100644 (file)
@@ -29,6 +29,7 @@
 import QtQuick 2.1
 import QtQuick.Controls 1.0
 import QtQuick.Controls.Tizen 1.0
+import QtQuick.Controls.Styles.Tizen 1.0
 
 Item {
     id:root
@@ -72,6 +73,7 @@ Item {
         verticalAlignment: Text.AlignVCenter
         horizontalAlignment: Text.AlignHCenter
         wrapMode: Text.WordWrap
+        color: TizenConfig.colors.foreground
         Rectangle {
             anchors.fill: parent
             border.width: 1
index 5585f8d..9f0da9d 100644 (file)
@@ -39,7 +39,9 @@ ShaderEffect {
     property double curlExtent
 
     fragmentShader: "
+#ifndef highp
 precision lowp float;
+#endif
 uniform lowp float curlExtent;
 uniform lowp sampler2D source;
 uniform lowp float qt_Opacity;
index 88ef2dc..fea8011 100644 (file)
@@ -8,3 +8,9 @@ You may use the materials in this directory without restriction to develop your
 icons are from the Tango Desktop project(http://tango.freedesktop.org/Tango_Desktop_Project):
 internet-mail.png
 internet-web-browser.png
+
+================
+mainmenu.png icon contains modified Components Icon icon from
+Artist: Double-J Design (Available for custom work - http://www.doublejdesign.co.uk/)
+Iconset: Ravenna 3D Icons (90 icons)
+Licensed under CC Attribution 3.0 (http://creativecommons.org/licenses/by/3.0/)
diff --git a/examples/touch/images/mainmenu.png b/examples/touch/images/mainmenu.png
new file mode 100644 (file)
index 0000000..4733d45
Binary files /dev/null and b/examples/touch/images/mainmenu.png differ
index 0ba2b5d..e0f25c1 100644 (file)
@@ -30,6 +30,7 @@
 #include <QtDebug>
 #include <QtGlobal>
 #include <QQmlApplicationEngine>
+#include <QScreen>
 
 extern "C" int OspMain(int argc, char *argv[])
 {
@@ -42,6 +43,12 @@ extern "C" int OspMain(int argc, char *argv[])
     QQmlApplicationEngine engine(QUrl("qrc:///main.qml"));
     QQuickWindow *window = qobject_cast<QQuickWindow *>(engine.rootObjects().at(0));
     if (window) {
+        window->setIcon(QIcon(":/images/mainmenu.png"));
+        window->screen()->setOrientationUpdateMask(Qt::PortraitOrientation | Qt::LandscapeOrientation |
+                                                   Qt::InvertedPortraitOrientation | Qt::InvertedLandscapeOrientation);
+#ifdef Q_OS_TIZEN
+        window->setProperty("contentFollowsContentOrientation",true);
+#endif
         window->show();
         return app.exec();
     } else {
index f53a684..59f0a11 100644 (file)
@@ -47,181 +47,192 @@ import "content"
 
 ApplicationWindow {
     id: appWindow
-    y: 60
+    y: isPortrait ? 60 : 0
     width: 720
-    height: 1220
+    height: isPortrait? 1220 : 1280
     property real curlValue: 0.05
+    property bool isPortrait: contentOrientation === Qt.PortraitOrientation || contentOrientation === Qt.InvertedPortraitOrientation
 
-    View {
-        id: content
+    contentOrientation: Screen.orientation
+    property bool pageCurlEffectEnabled: false
+
+    Item {
+        id: rotatedItem
         anchors.fill: parent
 
-        titleBar.text: "Controls Gallery (Theme: " + TizenConfig.theme+")"
-        titleBar.subText: pageStack.depth > 1 ? pageStack.currentItem: "Main Page"
+        View {
+            id: content
+            anchors.fill: parent
 
-        backAction.onTriggered: pageStack.depth > 1 ? pageStack.pop() : Qt.quit()
+            titleBar.text: "Controls Gallery (Theme: " + TizenConfig.theme+")"
+            titleBar.subText: pageStack.depth > 1 ? pageStack.currentItem: "Main Page"
 
-        ListModel {
-            id: pageModel
-            ListElement {
-                title: "Buttons"
-                page: "content/ButtonPage.qml"
-            }
-            ListElement {
-                title: "Sliders"
-                page: "content/SliderPage.qml"
-            }
-            ListElement {
-                title: "ProgressBar"
-                page: "content/ProgressBarPage.qml"
-            }
-            ListElement {
-                title: "Tabs"
-                page: "content/TabBarPage.qml"
-            }
-            ListElement {
-                title: "CheckBoxes"
-                page: "content/CheckBoxPage.qml"
-            }
-            ListElement {
-                title: "ContextMenu"
-                page: "content/ContextMenuPage.qml"
-            }
-            ListElement {
-                title: "SplitView"
-                page: "content/SplitViewPage.qml"
-            }
-            ListElement {
-                title: "DateTimeEdit"
-                page: "content/DateTimeEditPage.qml"
+            backAction.onTriggered: pageStack.depth > 1 ? pageStack.pop() : Qt.quit()
+
+            ListModel {
+                id: pageModel
+                ListElement {
+                    title: "Configuration"
+                    page: "content/ConfigurationPage.qml"
+                }
+                ListElement {
+                    title: "Buttons"
+                    page: "content/ButtonPage.qml"
+                }
+                ListElement {
+                    title: "Sliders"
+                    page: "content/SliderPage.qml"
+                }
+                ListElement {
+                    title: "ProgressBar"
+                    page: "content/ProgressBarPage.qml"
+                }
+                ListElement {
+                    title: "Tabs"
+                    page: "content/TabBarPage.qml"
+                }
+                ListElement {
+                    title: "CheckBoxes"
+                    page: "content/CheckBoxPage.qml"
+                }
+                ListElement {
+                    title: "ContextMenu"
+                    page: "content/ContextMenuPage.qml"
+                }
+                ListElement {
+                    title: "SplitView"
+                    page: "content/SplitViewPage.qml"
+                }
+                ListElement {
+                    title: "DateTimeEdit"
+                    page: "content/DateTimeEditPage.qml"
+                }
             }
-        }
 
-        StackView {
-            id: pageStack
-            anchors.fill: parent
+            StackView {
+                id: pageStack
+                anchors.fill: parent
 
-            initialItem: Item {
-                width: parent.width
-                height: parent.height
+                initialItem: Item {
+                    width: parent.width
+                    height: parent.height
 
 
-                ListView {
-                    id:listView
-                    model: pageModel
-                    anchors.fill: parent
-                    clip:true
+                    ListView {
+                        id:listView
+                        model: pageModel
+                        anchors.fill: parent
+                        clip:true
 
-                    delegate: AndroidDelegate {
-                        text: title
-                        onClicked: {
-                            content.titleBar.subText = Qt.binding(function() {return pageStack.depth > 1 ? title: "Main Page"})
-                            pageStack.push(Qt.resolvedUrl(page))
+                        delegate: AndroidDelegate {
+                            text: title
+                            onClicked: {
+                                content.titleBar.subText = Qt.binding(function() {return pageStack.depth > 1 ? title: "Main Page"})
+                                pageStack.push(Qt.resolvedUrl(page))
+                            }
                         }
+                        ScrollDecorator {flickableItem: listView}
                     }
-                    ScrollDecorator {flickableItem: listView}
                 }
             }
         }
-    }
-    Rectangle {
-        id: backgroundRect
-        color:"black"
-        width: 300
-        height: 130
-        anchors.right: parent.right
-        anchors.top: parent.top
-
-    }
-    ShaderEffectSource {
-        id: shaderSource
-        anchors.fill: parent
-        sourceItem: content
-        layer.enabled: true
-        layer.effect: PageCurl {
-            id: pageCurl
-            curlExtent: curlValue
+        Rectangle {
+            id: backgroundRect
+            visible: appWindow.pageCurlEffectEnabled
+            color: (TizenConfig.theme === "black") ? "white" : " black"
+            width: 300
+            height: 130
+            anchors.right: parent.right
+            anchors.top: parent.top
         }
-    }
-
-    SequentialAnimation {
-        id: curlAnimation
-        property int to: 1.0
-        SmoothedAnimation {
-            velocity: 1.5
-            target: appWindow
-            property: "curlValue"
-            to: curlAnimation.to
+        ShaderEffectSource {
+            id: shaderSource
+            anchors.fill: parent
+            enabled: pageCurlEffectEnabled
+            sourceItem: pageCurlEffectEnabled ? content : null
+            layer.enabled: pageCurlEffectEnabled
+            layer.effect: PageCurl {
+                id: pageCurl
+                curlExtent: curlValue
+            }
         }
-        ScriptAction {
-            script: {
-                if (!curlMouseArea.roll) {
-                    flipTheme()
+        SequentialAnimation {
+            id: curlAnimation
+            property int to: 1.0
+            SmoothedAnimation {
+                velocity: 1.5
+                target: appWindow
+                property: "curlValue"
+                to: curlAnimation.to
+            }
+            ScriptAction {
+                script: {
+                    if (!curlMouseArea.roll) {
+                        rotatedItem.flipTheme()
+                    }
+                    shaderSource.live = true
+                    curlValue = 0.05
+                    backgroundRect.visible = Qt.binding(function(){return appWindow.pageCurlEffectEnabled})
                 }
-                shaderSource.live = true
-                curlValue = 0.05
-                backgroundRect.color = (TizenConfig.theme === "white") ? "black" : "white"
-                backgroundRect.visible = true
             }
         }
-    }
-    function flipTheme() {
-        if (TizenConfig.theme === "white") {
-            TizenConfig.theme = "black"
-        } else {
-            TizenConfig.theme = "white"
-        }
-        backgroundRect.visible = false
-    }
+        MouseArea {
+            id: curlMouseArea
+            anchors.fill: parent
+            enabled: pageCurlEffectEnabled && !curlAnimation.running
+            property bool dragStarted: false
+            property bool themeChanged: false
+            property int initialY: 0
+            property real oldCurlValue
+            property bool roll: true
+            onPressed: {
+                if (mouse.x > appWindow.width - 100 && mouse.y < 100) {
+                    roll =  true
+                    themeChanged = false
+                    oldCurlValue = curlValue
+                    shaderSource.live = false
+                    initialY = mouse.y
+                    dragStarted = true
+                } else {
+                    mouse.accepted = false
+                }
 
-    MouseArea {
-        id: curlMouseArea
-        anchors.fill: parent
-        enabled: !curlAnimation.running
-        property bool dragStarted: false
-        property bool themeChanged: false
-        property int initialY: 0
-        property real oldCurlValue
-        property bool roll: true
-        onPressed: {
-            if (mouse.x > appWindow.width - 100 && mouse.y < 100) {
-                roll =  true
-                themeChanged = false
-                oldCurlValue = curlValue
-                shaderSource.live = false
-                initialY = mouse.y
-                dragStarted = true
-            } else {
-                mouse.accepted = false
             }
-
-        }
-        onMouseYChanged: {
-            mouse.accepted = dragStarted
-            if (dragStarted) {
-                curlValue = mouse.y / shaderSource.height
-                if (Math.abs(curlValue - oldCurlValue) > 0.05) {
-                    roll = oldCurlValue < curlValue
-                    oldCurlValue = curlValue
+            onMouseYChanged: {
+                mouse.accepted = dragStarted
+                if (dragStarted) {
+                    curlValue = mouse.y / shaderSource.height
+                    if (Math.abs(curlValue - oldCurlValue) > 0.05) {
+                        roll = oldCurlValue < curlValue
+                        oldCurlValue = curlValue
+                    }
+                    if (!themeChanged && (mouse.y - initialY > 50)) {
+                        rotatedItem.flipTheme()
+                        themeChanged = true
+                    }
                 }
-                if (!themeChanged && (mouse.y - initialY > 50)) {
-                    flipTheme()
-                    themeChanged = true
+            }
+            onReleased: {
+                mouse.accepted = dragStarted
+                if (dragStarted) {
+                    initialY = 0
+                    dragStarted = false
+                    if (themeChanged && roll) {
+                        curlAnimation.to = 1
+                    } else {
+                        curlAnimation.to = 0.05
+                    }
+                    curlAnimation.start()
                 }
             }
         }
-        onReleased: {
-            mouse.accepted = dragStarted
-            if (dragStarted) {
-                initialY = 0
-                dragStarted = false
-                if (themeChanged && roll) {
-                    curlAnimation.to = 1
-                } else {
-                    curlAnimation.to = 0.05
-                }
-                curlAnimation.start()
+        function flipTheme() {
+            if (TizenConfig.theme === "white") {
+                TizenConfig.theme = "black"
+            } else {
+                TizenConfig.theme = "white"
             }
+            backgroundRect.visible = false
         }
     }
 }
similarity index 70%
rename from examples/touch/qt.conf
rename to examples/touch/tizen/qt.conf
index 9205357..7b3b93b 100644 (file)
@@ -1,5 +1,5 @@
 [Paths]
-Prefix=/opt/usr/apps/HtoZbhWbHx
+Prefix=/opt/usr/apps/QtControls
 Libraries=lib
 Binaries=bin
 Plugins=data/plugins
similarity index 92%
rename from examples/touch/touch.qrc
rename to examples/touch/touch-default.qrc
index c615e0a..8c2da2c 100644 (file)
@@ -22,8 +22,7 @@
         <file>content/AndroidDelegate.qml</file>
         <file>content/DateTimeEditPage.qml</file>
         <file>content/PageCurl.qml</file>
-    </qresource>
-    <qresource prefix="/qt/etc">
-        <file>qt.conf</file>
+        <file>content/ConfigurationPage.qml</file>
+        <file>images/mainmenu.png</file>
     </qresource>
 </RCC>
diff --git a/examples/touch/touch-tizen.qrc b/examples/touch/touch-tizen.qrc
new file mode 100644 (file)
index 0000000..a172726
--- /dev/null
@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/qt/etc">
+        <file alias="qt.conf">tizen/qt.conf</file>
+    </qresource>
+</RCC>
index f97f79c..02bfa4e 100644 (file)
@@ -1,9 +1,11 @@
 TEMPLATE=app
 
-QMAKE_LFLAGS+=-pie -rdynamic
-
-TARGET=QtControls.exe
-
+tizen {
+    QMAKE_LFLAGS+=-pie -rdynamic
+    TARGET=QtControls.exe
+} else {
+    TARGET=QtControls
+}
 QT += qml quick
 
 OTHER_FILES += \
@@ -18,15 +20,15 @@ OTHER_FILES += \
     content/ContextMenuPage.qml \
     content/SplitViewPage.qml \
     content/DateTimeEditPage.qml\
-    qt.conf \
-    content/PageCurl.qml
+    content/PageCurl.qml \
+    content/ConfigurationPage.qml \
+    tizen/qt.conf
 
 
 SOURCES += \
     main.cpp
 
-RESOURCES += \
-    touch.qrc
-
+RESOURCES += touch-default.qrc
 
+tizen: RESOURCES += touch-tizen.qrc
 
index a743e66..787b2e7 100644 (file)
@@ -41,7 +41,18 @@ Control {
     }
 
     TitleBar { id: prvTitleBar }
-    Item { id: prvContent   }
+    Item { id: prvContent }
     ToolBar { id: prvToolBar; view: root }
     Action {id: prvBackAction }
+    focus: true
+
+    Keys.onReleased: {
+        if (event.key === Qt.Key_Back || event.key === Qt.Key_Escape) {
+            backAction.trigger()
+            event.accepted = true
+        } else if (event.key === Qt.Key_Menu || event.key === Qt.Key_F2) {
+            console.log("NOT IMPLEMENTED: ContextMenu should be shown")
+            event.accepted = true
+        }
+    }
 }
index 4a75b06..850712d 100644 (file)
@@ -11,7 +11,8 @@ Item {
 
     function findRoot() {
         var p = parent;
-        while(p.parent != undefined)
+
+        while (p.parent.parent != undefined)
             p = p.parent;
 
         return p;
index d372100..b363a6f 100644 (file)
@@ -33,8 +33,6 @@ Style {
         implicitWidth: 720
         implicitHeight: header.height + header2.height + 30 + 30
 
-        FontLoader { source: TizenConfig.fonts.defaultSource }
-
         Text {
             id: header
             anchors.top: parent.top
index f4ca0e9..f5ee29a 100644 (file)
@@ -41,17 +41,7 @@ Style {
         Binding { target: styleData.toolBar; property: "anchors.left"; value: control.left }
         Binding { target: styleData.toolBar; property: "anchors.right"; value: control.right }
 
-        focus: true
-
-        Keys.onReleased: {
-            if (event.key === Qt.Key_Back || event.key === Qt.Key_Escape) {
-                backAction.trigger()
-                event.accepted = true
-            } else if (event.key === Qt.Key_Menu || event.key === Qt.Key_F2) {
-                console.log("NOT IMPLEMENTED: ContextMenu should be shown")
-                event.accepted = true
-            }
-        }
+
 
         implicitWidth: 720
         implicitHeight: 1280
index cda7961..edbc7a0 100644 (file)
@@ -4,5 +4,6 @@
         <file>DefaultSettings.js</file>
         <file>themes/Colors.js</file>
         <file>Images.js</file>
+        <file alias="private/TizenSansRegular.ttf">TizenSansRegular.ttf</file>
     </qresource>
 </RCC>
index 4e5942f..6b42f60 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 import QtQml 2.0
+import QtQuick 2.0
 import QtQuick.Controls.Styles.Tizen 1.0
 
 QtObject {
@@ -31,6 +32,9 @@ QtObject {
             return TizenConfig.blackColors[key]
         }
     }
+    property QtObject fontLoader: FontLoader {
+        source: Theme.fonts.defaultSource
+    }
     property var panel : Theme.createPanel(theme)
     property var progress : Theme.createProgress(theme)
     property var slider : Theme.createSlider(theme)
index 88943c5..a5ee8a4 100644 (file)
@@ -1,4 +1,3 @@
-
 TEMPLATE = lib
 CONFIG += qt plugin
 QT += qml quick
@@ -44,13 +43,14 @@ QML_FILES += \
     images/720x1280/white/*.png \
     images/720x1280/white/*.sci \
     images/720x1280/black/*.png \
-    images/720x1280/black/*.sci \
-    TizenSansRegular.ttf
+    images/720x1280/black/*.sci
 
 CONFIG += force_independent
 
 OTHER_FILES += qmldir \
-    private/TizenStyleConfig.qml
+    private/TizenStyleConfig.qml \
+    TizenSansRegular.ttf \
+    $$QML_FILES
 
 load(qml_module)
 
@@ -63,7 +63,6 @@ HEADERS += \
 SOURCES += \
     qquicktizenstyleextensionplugin.cpp
 INSTALLS += target
-#error($$INSTALLS)
 
 RESOURCES += \
     internal_resources.qrc