summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Olszak <olszak.tomasz@gmail.com>2013-06-19 18:10:01 +0000
committerJarosław Staniek <staniek@kde.org>2013-06-20 00:26:33 +0200
commit029a6d6caef3d3c5cc8b8d8305655dbd33112afd (patch)
treec23fbe47fea2a7b824b04e2a6f2cef948f830ac9
parenteb7fcb15dba665c546bc2f401bdfb2fe9c4a59d6 (diff)
Added BusyIndicator Control
Change-Id: I183dbe58d6a0cc4aa6eb586b83363883ae5f3346 Reviewed-by: Jarosław Staniek <staniek@kde.org>
-rw-r--r--examples/touch/content/CheckBoxPage.qml9
-rw-r--r--src/controls/BusyIndicator.qml31
-rw-r--r--src/controls/controls.pro3
-rw-r--r--src/controls/qmldir1
-rw-r--r--src/styles/BusyIndicatorStyle.qml52
-rw-r--r--src/styles/DefaultSettings.js5
-rw-r--r--src/styles/qmldir1
-rw-r--r--src/styles/styles.pro3
8 files changed, 98 insertions, 7 deletions
diff --git a/examples/touch/content/CheckBoxPage.qml b/examples/touch/content/CheckBoxPage.qml
index 7930364..80f51ef 100644
--- a/examples/touch/content/CheckBoxPage.qml
+++ b/examples/touch/content/CheckBoxPage.qml
@@ -39,11 +39,6 @@ Item {
Popup {
id:popup
Text {
- text:"Center"
- font.pixelSize: 60
- anchors.centerIn: parent
- }
- Text {
text:"Left"
font.pixelSize: 60
anchors.left: parent.left
@@ -68,6 +63,10 @@ Item {
onClicked: popup.hide()
anchors.horizontalCenter: parent.horizontalCenter
}
+ BusyIndicator {
+ anchors.centerIn: parent
+ running: true
+ }
}
Column {
diff --git a/src/controls/BusyIndicator.qml b/src/controls/BusyIndicator.qml
new file mode 100644
index 0000000..6468a13
--- /dev/null
+++ b/src/controls/BusyIndicator.qml
@@ -0,0 +1,31 @@
+/*
+ * 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
+
+Control {
+ id: root
+ property bool running: false
+ property int duration: 1000
+
+
+ style: Qt.createComponent(Settings.style + "/BusyIndicatorStyle.qml", root)
+}
diff --git a/src/controls/controls.pro b/src/controls/controls.pro
index b932d8e..080e53e 100644
--- a/src/controls/controls.pro
+++ b/src/controls/controls.pro
@@ -7,7 +7,8 @@ QML_FILES += \
ContextMenu.qml\
SplitView.qml\
ScrollDecorator.qml\
- Popup.qml
+ Popup.qml\
+ BusyIndicator.qml
CONFIG += force_independent
diff --git a/src/controls/qmldir b/src/controls/qmldir
index d79980a..5ec06b6 100644
--- a/src/controls/qmldir
+++ b/src/controls/qmldir
@@ -6,3 +6,4 @@ ContextMenu 1.0 ContextMenu.qml
SplitView 1.0 SplitView.qml
ScrollDecorator 1.0 ScrollDecorator.qml
Popup 1.0 Popup.qml
+BusyIndicator 1.0 BusyIndicator.qml
diff --git a/src/styles/BusyIndicatorStyle.qml b/src/styles/BusyIndicatorStyle.qml
new file mode 100644
index 0000000..c67b19e
--- /dev/null
+++ b/src/styles/BusyIndicatorStyle.qml
@@ -0,0 +1,52 @@
+/*
+ * 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 1.0
+import QtQuick.Controls.Private 1.0
+import QtQuick.Controls.Tizen 1.0
+import "DefaultSettings.js" as Theme
+
+Style {
+ id: style
+
+ property BusyIndicator control: __control
+
+ property Component panel: Image {
+ id:root
+ source: Theme.busyIndicator.source
+
+ Binding {
+ target:control
+ property: "duration"
+ value: Theme.busyIndicator.duration
+ }
+
+ RotationAnimation {
+ running: control.running
+ from:0
+ to: 360
+ target: root
+ direction: RotationAnimation.Clockwise
+ duration: control.duration
+ loops: Animation.Infinite
+ property: "rotation"
+ }
+ }
+}
diff --git a/src/styles/DefaultSettings.js b/src/styles/DefaultSettings.js
index 82499d8..fdfc30d 100644
--- a/src/styles/DefaultSettings.js
+++ b/src/styles/DefaultSettings.js
@@ -1184,3 +1184,8 @@ var popup = {
right: 16+3
}
}
+
+var busyIndicator = {
+ source: images.img_00_list_process_01,
+ duration: 1500
+}
diff --git a/src/styles/qmldir b/src/styles/qmldir
index be86051..605d203 100644
--- a/src/styles/qmldir
+++ b/src/styles/qmldir
@@ -12,5 +12,6 @@ DetailButtonStyle 1.0 DetailButtonStyle.qml
ScrollDecoratorStyle 1.0 ScrollDecoratorStyle.qml
ContextMenuStyle 1.0 ContextMenuStyle.qml
PopupStyle 1.0 PopupStyle.qml
+BusyIndicatorStyle 1.0 BusyIndicatorStyle.qml
Theme 1.0 DefaultSettings.js
diff --git a/src/styles/styles.pro b/src/styles/styles.pro
index 269c319..933368a 100644
--- a/src/styles/styles.pro
+++ b/src/styles/styles.pro
@@ -14,7 +14,8 @@ QML_FILES = \
DefaultSettings.js\
ScrollDecoratorStyle.qml\
ContextMenuStyle.qml\
- PopupStyle.qml
+ PopupStyle.qml\
+ BusyIndicatorStyle.qml
# Images
QML_FILES += \