integrate dialer

This commit is contained in:
Aaron Seigo 2014-09-29 21:38:56 +02:00
parent 8eee53a039
commit 511041d65e
2 changed files with 49 additions and 19 deletions

View file

@ -19,6 +19,7 @@
*/ */
import QtQuick 2.0 import QtQuick 2.0
import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.shell 2.0 as Shell import org.kde.plasma.shell 2.0 as Shell
import "../components" import "../components"
@ -32,22 +33,6 @@ Item {
property Item wallpaper; property Item wallpaper;
property var pendingRemovals: []; property var pendingRemovals: [];
property int notificationId: 0; property int notificationId: 0;
Timer {
id: pendingTimer
interval: 5000
repeat: false
onTriggered: {
for (var i = 0; i < pendingRemovals.length; ++i) {
var id = pendingRemovals[i];
for (var j = 0; j < notificationsModel.count; ++j) {
if (notificationsModel.get(j).id == id) {
notificationsModel.remove(j);
}
}
}
pendingRemovals = [];
}
}
/* /*
Notificadtion data object has the following properties: Notificadtion data object has the following properties:
@ -62,7 +47,6 @@ Item {
appRealName appRealName
configurable configurable
*/ */
function addNotification(source, data, actions) { function addNotification(source, data, actions) {
// Do not show duplicated notifications // Do not show duplicated notifications
// Remove notifications that are sent again (odd, but true) // Remove notifications that are sent again (odd, but true)
@ -98,6 +82,24 @@ Item {
} }
} }
Timer {
id: pendingTimer
interval: 5000
repeat: false
onTriggered: {
for (var i = 0; i < pendingRemovals.length; ++i) {
var id = pendingRemovals[i];
for (var j = 0; j < notificationsModel.count; ++j) {
if (notificationsModel.get(j).id == id) {
notificationsModel.remove(j);
}
}
}
pendingRemovals = [];
}
}
PlasmaCore.DataSource { PlasmaCore.DataSource {
id: notificationsSource id: notificationsSource
@ -154,6 +156,33 @@ Item {
} }
} }
Dialer {
id: dialer
anchors {
left: parent.left
top: statusPanel.bottom
right: parent.right
bottom: parent.bottom
}
z: 20
opacity: 0
visible: false
Behavior on opacity {
NumberAnimation { properties: "opacity"; duration: 100 }
}
onVisibleChanged: {
opacity = visible ? 0.9 : 0;
}
onCallingChanged: {
if (!calling) {
opacity = 0;
}
}
}
Rectangle { Rectangle {
id: statusPanel id: statusPanel
anchors { anchors {
@ -247,7 +276,9 @@ Item {
id: phoneIcon id: phoneIcon
svg: stripeIcons svg: stripeIcons
elementId: "phone" elementId: "phone"
callback: function() { console.log("Start phone") } callback: function() {
dialer.visible = true;
}
} }
HomeLauncherSvg { HomeLauncherSvg {

View file

@ -4,7 +4,6 @@ import "../components"
Rectangle { Rectangle {
id: dialer id: dialer
anchors.fill: parent;
color: "white" color: "white"
opacity: 0.5 opacity: 0.5