From 28e7ccacd805896a8254d927dbc7560aec20f34d Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Mon, 29 Sep 2014 23:08:55 +0200 Subject: [PATCH] dialer can now be dismissed by deleting numbers; white on black visuals --- shell/contents/components/DialerButton.qml | 14 ++++++++------ shell/contents/views/Dialer.qml | 15 ++++++++++++--- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/shell/contents/components/DialerButton.qml b/shell/contents/components/DialerButton.qml index d37e5012..e3803d91 100644 --- a/shell/contents/components/DialerButton.qml +++ b/shell/contents/components/DialerButton.qml @@ -6,8 +6,9 @@ Text { height: parent.buttonHeight horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter + color: dialer.textColor font.pixelSize: Math.floor((width - (units.largeSpacing)) / 2) - property alias sub: longHold.text; + property alias sub: longHold.text MouseArea { anchors.fill: parent @@ -26,16 +27,17 @@ Text { Text { id: longHold - visible: text.length > 0 - opacity: 0.7 - height: parent.height - width: parent.width / 3 - verticalAlignment: Qt.AlignVCenter anchors { top: parent.top right: parent.right } + height: parent.height + width: parent.width / 3 + verticalAlignment: Qt.AlignVCenter + visible: text.length > 0 + opacity: 0.7 font.pixelSize: parent.pixelSize * .8 + color: dialer.textColor } } diff --git a/shell/contents/views/Dialer.qml b/shell/contents/views/Dialer.qml index d8117701..43183171 100644 --- a/shell/contents/views/Dialer.qml +++ b/shell/contents/views/Dialer.qml @@ -4,9 +4,10 @@ import "../components" Rectangle { id: dialer - color: "white" - opacity: 0.5 + color: "black" + opacity: 0.8 + property color textColor: "white" property bool calling: false // needs to be connected to a system service property bool enableButtons: calling @@ -37,6 +38,7 @@ Rectangle { horizontalAlignment: Qt.AlignRight verticalAlignment: Qt.AlignVCenter font.pixelSize: one.font.pixelSize + color: textColor } Grid { @@ -81,7 +83,14 @@ Rectangle { } DialerIconButton { source: "edit-clear" - callback: function() { status.text = status.text.substr(0, status.text.length - 1); } + callback: function() { + if (status.text.length > 0) { + status.text = status.text.substr(0, status.text.length - 1); + } else { + dialer.calling = true; + dialer.calling = false; + } + } } } }