summaryrefslogtreecommitdiffstats
path: root/src/gui/qml
diff options
context:
space:
mode:
authorLubos Dolezel <lubos@dolezel.info>2015-06-10 22:03:10 +0200
committerLubos Dolezel <lubos@dolezel.info>2015-06-10 22:03:10 +0200
commit5f8b47ef795817fa2acdb177a6c6d3673ff4a03f (patch)
tree15794782f1ad92ed4e8e8dcd8538296536ba8c94 /src/gui/qml
parent0ed98d2d5ded04c9932fbeb3bb0945133b079a85 (diff)
downloadtwinkle-5f8b47ef795817fa2acdb177a6c6d3673ff4a03f.tar
twinkle-5f8b47ef795817fa2acdb177a6c6d3673ff4a03f.tar.gz
twinkle-5f8b47ef795817fa2acdb177a6c6d3673ff4a03f.tar.lz
twinkle-5f8b47ef795817fa2acdb177a6c6d3673ff4a03f.tar.xz
twinkle-5f8b47ef795817fa2acdb177a6c6d3673ff4a03f.zip
Added incoming call popup (resolves #14)
Diffstat (limited to 'src/gui/qml')
-rw-r--r--src/gui/qml/TextImageButton.qml59
-rw-r--r--src/gui/qml/incoming_call.qml62
-rw-r--r--src/gui/qml/qml.qrc2
3 files changed, 123 insertions, 0 deletions
diff --git a/src/gui/qml/TextImageButton.qml b/src/gui/qml/TextImageButton.qml
new file mode 100644
index 0000000..3630029
--- /dev/null
+++ b/src/gui/qml/TextImageButton.qml
@@ -0,0 +1,59 @@
+import QtQuick 1.1
+
+Rectangle {
+ id: backgroundRect
+ width: 150
+ height: 30
+ radius: 0
+
+ property alias image: img.source
+ property alias text: text.text
+ property alias color: backgroundRect.color
+ signal clicked
+
+ color: "red"
+ z: 2
+
+ Image {
+ id: img
+ width: height
+ anchors.top: parent.top
+ anchors.topMargin: 2
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 2
+ anchors.left: parent.left
+ anchors.leftMargin: 5
+ smooth: true
+ source: "qrc:/qtquickplugin/images/template_image.png"
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: parent.clicked()
+ }
+
+ Text {
+ id: text
+ text: "Button text"
+ font.bold: true
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 0
+ anchors.left: img.right
+ anchors.leftMargin: 5
+ anchors.top: parent.top
+ anchors.topMargin: 0
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 0
+ color: "white"
+ font.pixelSize: 12
+ }
+
+ states: State {
+ name: "pressed"; when: mouseArea.pressed
+ PropertyChanges { target: backgroundRect; color: Qt.darker(color) }
+ }
+}
+
diff --git a/src/gui/qml/incoming_call.qml b/src/gui/qml/incoming_call.qml
new file mode 100644
index 0000000..bdcb161
--- /dev/null
+++ b/src/gui/qml/incoming_call.qml
@@ -0,0 +1,62 @@
+import QtQuick 1.1
+
+Rectangle {
+ id: rectangle1
+ width: 400
+ height: 70
+ color: "black"
+
+ Image {
+ id: image1
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ anchors.top: parent.top
+ anchors.topMargin: 5
+ anchors.left: parent.left
+ anchors.leftMargin: 5
+ source: "qrc:/icons/images/twinkle48.png"
+ width: height
+ }
+
+ Text {
+ id: callerText
+ objectName: "callerText"
+ height: 22
+ color: "#ffffff"
+ text: "... calling"
+ anchors.top: parent.top
+ anchors.topMargin: 8
+ anchors.left: image1.right
+ anchors.leftMargin: 9
+ anchors.right: parent.right
+ anchors.rightMargin: 10
+ font.pixelSize: 19
+ }
+
+ TextImageButton {
+ id: buttonAnswer
+ objectName: "buttonAnswer"
+ x: 74
+ y: 36
+ width: 120
+ height: 26
+ color: "#00aa00"
+ radius: 7
+ text: qsTr("Answer")
+ image: "qrc:/icons/images/popup_incoming_answer.png"
+ }
+
+ TextImageButton {
+ id: buttonReject
+ objectName: "buttonReject"
+ y: 36
+ width: 120
+ height: 26
+ radius: 7
+ text: qsTr("Reject")
+ anchors.left: buttonAnswer.right
+ anchors.leftMargin: 15
+ image: "qrc:/icons/images/popup_incoming_reject.png"
+ }
+}
+
diff --git a/src/gui/qml/qml.qrc b/src/gui/qml/qml.qrc
index 95e8f77..87c5184 100644
--- a/src/gui/qml/qml.qrc
+++ b/src/gui/qml/qml.qrc
@@ -2,5 +2,7 @@
<qresource prefix="/qml">
<file>ImageButton.qml</file>
<file>osd.qml</file>
+ <file>TextImageButton.qml</file>
+ <file>incoming_call.qml</file>
</qresource>
</RCC>