Changeset View
Changeset View
Standalone View
Standalone View
dialer/package/contents/ui/Dialpad/Dialpad.qml
Show All 13 Lines | |||||
14 | * | 14 | * | ||
15 | * You should have received a copy of the GNU Library General Public | 15 | * You should have received a copy of the GNU Library General Public | ||
16 | * License along with this program; if not, write to the | 16 | * License along with this program; if not, write to the | ||
17 | * Free Software Foundation, Inc., | 17 | * Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.0 | ||
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.2 | ||
23 | import org.kde.plasma.core 2.0 as PlasmaCore | 23 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
24 | import org.kde.plasma.components 2.0 as PlasmaComponents | 24 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
25 | 25 | | |||
26 | GridLayout { | 26 | GridLayout { | ||
27 | id: pad | 27 | id: pad | ||
28 | columns: 3 | 28 | columns: 3 | ||
29 | rowSpacing: 10 | 29 | rowSpacing: 10 | ||
30 | columnSpacing: 10 | 30 | columnSpacing: 10 | ||
31 | Layout.leftMargin: units.largeSpacing * 2 | ||||
32 | Layout.rightMargin: units.largeSpacing * 2 | ||||
31 | 33 | | |||
32 | property var callback | 34 | property var callback | ||
33 | property var pressedCallback | 35 | property var pressedCallback | ||
34 | property var releasedCallback | 36 | property var releasedCallback | ||
37 | property var deleteCallback | ||||
35 | 38 | | |||
36 | DialerButton { id: one; text: "1" } | 39 | DialerButton { id: one; text: "1" } | ||
37 | DialerButton { text: "2"; sub: "ABC" } | 40 | DialerButton { text: "2"; sub: "ABC" } | ||
38 | DialerButton { text: "3"; sub: "DEF" } | 41 | DialerButton { text: "3"; sub: "DEF" } | ||
39 | 42 | | |||
40 | DialerButton { text: "4"; sub: "GHI" } | 43 | DialerButton { text: "4"; sub: "GHI" } | ||
41 | DialerButton { text: "5"; sub: "JKL" } | 44 | DialerButton { text: "5"; sub: "JKL" } | ||
42 | DialerButton { text: "6"; sub: "MNO" } | 45 | DialerButton { text: "6"; sub: "MNO" } | ||
Show All 13 Lines | |||||
56 | DialerIconButton { | 59 | DialerIconButton { | ||
57 | id: callButton | 60 | id: callButton | ||
58 | Layout.fillWidth: true | 61 | Layout.fillWidth: true | ||
59 | Layout.fillHeight: true | 62 | Layout.fillHeight: true | ||
60 | 63 | | |||
61 | enabled: status.text.length > 0 | 64 | enabled: status.text.length > 0 | ||
62 | opacity: enabled ? 1 : 0.5 | 65 | opacity: enabled ? 1 : 0.5 | ||
63 | source: "call-start" | 66 | source: "call-start" | ||
67 | size: units.gridUnit * 3 | ||||
64 | callback: function() { | 68 | callback: function() { | ||
65 | call(status.text); | 69 | call(status.text); | ||
66 | } | 70 | } | ||
67 | } | 71 | } | ||
68 | Item { | 72 | DialerIconButton { | ||
73 | id: delButton | ||||
69 | Layout.fillWidth: true | 74 | Layout.fillWidth: true | ||
70 | Layout.fillHeight: true | 75 | Layout.fillHeight: true | ||
76 | | ||||
77 | enabled: status.text.length > 0 | ||||
78 | opacity: enabled ? 1 : 0.5 | ||||
79 | source: "edit-clear" | ||||
80 | size: units.gridUnit * 2 | ||||
81 | callback: pad.deleteCallback | ||||
71 | } | 82 | } | ||
72 | } | 83 | } |