summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Olszak <olszak.tomasz@gmail.com>2013-08-09 15:24:00 +0200
committerTomasz Olszak <olszak.tomasz@gmail.com>2013-08-10 16:45:39 +0200
commitc2e34623c52462bc8143e39f81ee88a3cb257e9c (patch)
treef12dbcd4eb9cd7f654ba543d94bed6969b3d593a
parentb9d0c40716f0f269af27f7614c5693614ec4e64e (diff)
Added screen orientation handling and configuration page.
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>
-rw-r--r--examples/touch/content/AndroidDelegate.qml6
-rw-r--r--examples/touch/content/ButtonPage.qml2
-rw-r--r--examples/touch/content/ConfigurationPage.qml161
-rw-r--r--examples/touch/content/ContextMenuPage.qml2
-rw-r--r--examples/touch/content/PageCurl.qml2
-rw-r--r--examples/touch/images/NOTICE.txt6
-rw-r--r--examples/touch/images/mainmenu.pngbin0 -> 30891 bytes
-rw-r--r--examples/touch/main.cpp7
-rw-r--r--examples/touch/main.qml301
-rw-r--r--examples/touch/tizen/qt.conf (renamed from examples/touch/qt.conf)2
-rw-r--r--examples/touch/touch-default.qrc (renamed from examples/touch/touch.qrc)5
-rw-r--r--examples/touch/touch-tizen.qrc5
-rw-r--r--examples/touch/touch.pro20
-rw-r--r--src/controls/View.qml13
-rw-r--r--src/styles/Floater.qml3
-rw-r--r--src/styles/TitleBarStyle.qml2
-rw-r--r--src/styles/ViewStyle.qml12
-rw-r--r--src/styles/internal_resources.qrc1
-rw-r--r--src/styles/private/TizenStyleConfig.qml4
-rw-r--r--src/styles/styles.pro9
20 files changed, 381 insertions, 182 deletions
diff --git a/examples/touch/content/AndroidDelegate.qml b/examples/touch/content/AndroidDelegate.qml
index d23f6e0..e40da1d 100644
--- a/examples/touch/content/AndroidDelegate.qml
+++ b/examples/touch/content/AndroidDelegate.qml
@@ -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()
-
}
diff --git a/examples/touch/content/ButtonPage.qml b/examples/touch/content/ButtonPage.qml
index 3c94e32..8ff9f5f 100644
--- a/examples/touch/content/ButtonPage.qml
+++ b/examples/touch/content/ButtonPage.qml
@@ -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
index 0000000..7a74285
--- /dev/null
+++ b/examples/touch/content/ConfigurationPage.qml
@@ -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
+ }
+}
diff --git a/examples/touch/content/ContextMenuPage.qml b/examples/touch/content/ContextMenuPage.qml
index 1856f23..b356d8f 100644
--- a/examples/touch/content/ContextMenuPage.qml
+++ b/examples/touch/content/ContextMenuPage.qml
@@ -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
diff --git a/examples/touch/content/PageCurl.qml b/examples/touch/content/PageCurl.qml
index 5585f8d..9f0da9d 100644
--- a/examples/touch/content/PageCurl.qml
+++ b/examples/touch/content/PageCurl.qml
@@ -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;
diff --git a/examples/touch/images/NOTICE.txt b/examples/touch/images/NOTICE.txt
index 88ef2dc..fea8011 100644
--- a/examples/touch/images/NOTICE.txt
+++ b/examples/touch/images/NOTICE.txt
@@ -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
index 0000000..4733d45
--- /dev/null
+++ b/examples/touch/images/mainmenu.png
Binary files differ
diff --git a/examples/touch/main.cpp b/examples/touch/main.cpp
index 0ba2b5d..e0f25c1 100644
--- a/examples/touch/main.cpp
+++ b/examples/touch/main.cpp
@@ -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 {
diff --git a/examples/touch/main.qml b/examples/touch/main.qml
index f53a684..59f0a11 100644
--- a/examples/touch/main.qml
+++ b/examples/touch/main.qml
@@ -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
}
}
}
diff --git a/examples/touch/qt.conf b/examples/touch/tizen/qt.conf
index 9205357..7b3b93b 100644
--- a/examples/touch/qt.conf
+++ b/examples/touch/tizen/qt.conf
@@ -1,5 +1,5 @@
[Paths]
-Prefix=/opt/usr/apps/HtoZbhWbHx
+Prefix=/opt/usr/apps/QtControls
Libraries=lib
Binaries=bin
Plugins=data/plugins
diff --git a/examples/touch/touch.qrc b/examples/touch/touch-default.qrc
index c615e0a..8c2da2c 100644
--- a/examples/touch/touch.qrc
+++ b/examples/touch/touch-default.qrc
@@ -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
index 0000000..a172726
--- /dev/null
+++ b/examples/touch/touch-tizen.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/qt/etc">
+ <file alias="qt.conf">tizen/qt.conf</file>
+ </qresource>
+</RCC>
diff --git a/examples/touch/touch.pro b/examples/touch/touch.pro
index f97f79c..02bfa4e 100644
--- a/examples/touch/touch.pro
+++ b/examples/touch/touch.pro
@@ -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
diff --git a/src/controls/View.qml b/src/controls/View.qml
index a743e66..787b2e7 100644
--- a/src/controls/View.qml
+++ b/src/controls/View.qml
@@ -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
+ }
+ }
}
diff --git a/src/styles/Floater.qml b/src/styles/Floater.qml
index 4a75b06..850712d 100644
--- a/src/styles/Floater.qml
+++ b/src/styles/Floater.qml
@@ -11,7 +11,8 @@ Item {
function findRoot() {
var p = parent;
- while(p.parent != undefined)
+
+ while (p.parent.parent != undefined)
p = p.parent;
return p;
diff --git a/src/styles/TitleBarStyle.qml b/src/styles/TitleBarStyle.qml
index d372100..b363a6f 100644
--- a/src/styles/TitleBarStyle.qml
+++ b/src/styles/TitleBarStyle.qml
@@ -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
diff --git a/src/styles/ViewStyle.qml b/src/styles/ViewStyle.qml
index f4ca0e9..f5ee29a 100644
--- a/src/styles/ViewStyle.qml
+++ b/src/styles/ViewStyle.qml
@@ -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
diff --git a/src/styles/internal_resources.qrc b/src/styles/internal_resources.qrc
index cda7961..edbc7a0 100644
--- a/src/styles/internal_resources.qrc
+++ b/src/styles/internal_resources.qrc
@@ -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>
diff --git a/src/styles/private/TizenStyleConfig.qml b/src/styles/private/TizenStyleConfig.qml
index 4e5942f..6b42f60 100644
--- a/src/styles/private/TizenStyleConfig.qml
+++ b/src/styles/private/TizenStyleConfig.qml
@@ -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)
diff --git a/src/styles/styles.pro b/src/styles/styles.pro
index 88943c5..a5ee8a4 100644
--- a/src/styles/styles.pro
+++ b/src/styles/styles.pro
@@ -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