shift-shell/dialer/package/contents/ui/Dialpad/Dialpad.qml
Michael Eden 9e68bc049b Improve dialer UI and format phone number
Summary:
This makes the buttons more evenly spaced and formats the number as you type!

old: {F6084821}
new (updated): {F6084822}

The plan is to bring the entire dialer page down to about half its current size to support searching through contacts as one dials a number.

Reviewers: bshah, #plasma:_mobile, mart

Reviewed By: #plasma:_mobile, mart

Subscribers: ngraham

Differential Revision: https://phabricator.kde.org/D13936
2018-08-02 15:48:21 -04:00

72 lines
2.2 KiB
QML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Copyright 2014 Aaron Seigo <aseigo@kde.org>
* Copyright 2014 Marco Martin <mart@kde.org>
*
* This program 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, or
* (at your option) any later version.
*
* This program 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 program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
GridLayout {
id: pad
columns: 3
rowSpacing: 10
columnSpacing: 10
property var callback
property var pressedCallback
property var releasedCallback
DialerButton { id: one; text: "1" }
DialerButton { text: "2"; sub: "ABC" }
DialerButton { text: "3"; sub: "DEF" }
DialerButton { text: "4"; sub: "GHI" }
DialerButton { text: "5"; sub: "JKL" }
DialerButton { text: "6"; sub: "MNO" }
DialerButton { text: "7"; sub: "PQRS" }
DialerButton { text: "8"; sub: "TUV" }
DialerButton { text: "9"; sub: "WXYZ" }
DialerButton { display: ""; text: "*"; special: true; }
DialerButton { text: "0"; subdisplay: ""; sub: "+"; }
DialerButton { display: ""; text: "#"; special: true; }
Item {
Layout.fillWidth: true
Layout.fillHeight: true
}
DialerIconButton {
id: callButton
Layout.fillWidth: true
Layout.fillHeight: true
enabled: status.text.length > 0
opacity: enabled ? 1 : 0.5
source: "call-start"
callback: function() {
call(status.text);
}
}
Item {
Layout.fillWidth: true
Layout.fillHeight: true
}
}