2015-04-21 07:53:35 +00:00
|
|
|
|
/*
|
|
|
|
|
|
* 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
|
2018-11-19 03:54:40 +00:00
|
|
|
|
import QtQuick.Layouts 1.2
|
2019-06-23 11:30:17 +00:00
|
|
|
|
|
|
|
|
|
|
import org.kde.kirigami 2.5 as Kirigami
|
2015-04-21 07:53:35 +00:00
|
|
|
|
|
|
|
|
|
|
GridLayout {
|
|
|
|
|
|
id: pad
|
|
|
|
|
|
columns: 3
|
2018-07-13 21:33:28 +00:00
|
|
|
|
rowSpacing: 10
|
|
|
|
|
|
columnSpacing: 10
|
2019-06-23 11:30:17 +00:00
|
|
|
|
Layout.leftMargin: Kirigami.Units.largeSpacing * 2
|
|
|
|
|
|
Layout.rightMargin: Kirigami.Units.largeSpacing * 2
|
2015-04-21 07:53:35 +00:00
|
|
|
|
|
2015-04-21 08:54:30 +00:00
|
|
|
|
property var callback
|
|
|
|
|
|
property var pressedCallback
|
|
|
|
|
|
property var releasedCallback
|
2018-11-19 03:54:40 +00:00
|
|
|
|
property var deleteCallback
|
2015-04-21 08:54:30 +00:00
|
|
|
|
|
2018-07-13 21:33:28 +00:00
|
|
|
|
DialerButton { id: one; text: "1" }
|
2015-04-28 09:18:56 +00:00
|
|
|
|
DialerButton { text: "2"; sub: "ABC" }
|
|
|
|
|
|
DialerButton { text: "3"; sub: "DEF" }
|
2015-04-21 07:53:35 +00:00
|
|
|
|
|
2018-07-13 21:33:28 +00:00
|
|
|
|
DialerButton { text: "4"; sub: "GHI" }
|
2015-04-28 09:18:56 +00:00
|
|
|
|
DialerButton { text: "5"; sub: "JKL" }
|
|
|
|
|
|
DialerButton { text: "6"; sub: "MNO" }
|
2015-04-21 07:53:35 +00:00
|
|
|
|
|
2018-07-13 21:33:28 +00:00
|
|
|
|
DialerButton { text: "7"; sub: "PQRS" }
|
2015-04-28 09:18:56 +00:00
|
|
|
|
DialerButton { text: "8"; sub: "TUV" }
|
|
|
|
|
|
DialerButton { text: "9"; sub: "WXYZ" }
|
2015-04-21 07:53:35 +00:00
|
|
|
|
|
2018-07-13 21:33:28 +00:00
|
|
|
|
DialerButton { display: "*"; text: "*"; special: true; }
|
|
|
|
|
|
DialerButton { text: "0"; subdisplay: "+"; sub: "+"; }
|
|
|
|
|
|
DialerButton { display: "#"; text: "#"; special: true; }
|
2015-04-21 07:53:35 +00:00
|
|
|
|
|
2018-07-13 21:33:28 +00:00
|
|
|
|
Item {
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
}
|
2015-06-24 14:58:11 +00:00
|
|
|
|
DialerIconButton {
|
|
|
|
|
|
id: callButton
|
|
|
|
|
|
Layout.fillWidth: true
|
2018-07-13 21:33:28 +00:00
|
|
|
|
Layout.fillHeight: true
|
2015-06-24 14:58:11 +00:00
|
|
|
|
|
|
|
|
|
|
enabled: status.text.length > 0
|
|
|
|
|
|
opacity: enabled ? 1 : 0.5
|
|
|
|
|
|
source: "call-start"
|
2019-06-23 11:30:17 +00:00
|
|
|
|
size: Kirigami.Units.gridUnit * 3
|
2015-06-24 14:58:11 +00:00
|
|
|
|
callback: function() {
|
|
|
|
|
|
call(status.text);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-11-19 03:54:40 +00:00
|
|
|
|
DialerIconButton {
|
|
|
|
|
|
id: delButton
|
2015-06-24 14:58:11 +00:00
|
|
|
|
Layout.fillWidth: true
|
2018-07-13 21:33:28 +00:00
|
|
|
|
Layout.fillHeight: true
|
2018-11-19 03:54:40 +00:00
|
|
|
|
|
|
|
|
|
|
enabled: status.text.length > 0
|
|
|
|
|
|
opacity: enabled ? 1 : 0.5
|
|
|
|
|
|
source: "edit-clear"
|
2019-06-23 11:30:17 +00:00
|
|
|
|
size: Kirigami.Units.gridUnit * 2
|
2018-11-19 03:54:40 +00:00
|
|
|
|
callback: pad.deleteCallback
|
2015-06-24 14:58:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|