Changeset View
Changeset View
Standalone View
Standalone View
dialer/package/contents/ui/Dialpad/Dialpad.qml
Show All 20 Lines | |||||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.0 | ||
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 | ||
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 | ||||
30 | columnSpacing: 10 | ||||
29 | 31 | | |||
30 | property var callback | 32 | property var callback | ||
31 | property var pressedCallback | 33 | property var pressedCallback | ||
32 | property var releasedCallback | 34 | property var releasedCallback | ||
33 | 35 | | |||
34 | property int buttonHeight: parent.height / 6 | | |||
35 | | ||||
36 | DialerButton { id: one; text: "1" } | 36 | DialerButton { id: one; text: "1" } | ||
37 | DialerButton { text: "2"; sub: "ABC" } | 37 | DialerButton { text: "2"; sub: "ABC" } | ||
38 | DialerButton { text: "3"; sub: "DEF" } | 38 | DialerButton { text: "3"; sub: "DEF" } | ||
39 | 39 | | |||
40 | DialerButton { text: "4"; sub: "GHI" } | 40 | DialerButton { text: "4"; sub: "GHI" } | ||
41 | DialerButton { text: "5"; sub: "JKL" } | 41 | DialerButton { text: "5"; sub: "JKL" } | ||
42 | DialerButton { text: "6"; sub: "MNO" } | 42 | DialerButton { text: "6"; sub: "MNO" } | ||
43 | 43 | | |||
44 | DialerButton { text: "7"; sub: "PQRS" } | 44 | DialerButton { text: "7"; sub: "PQRS" } | ||
45 | DialerButton { text: "8"; sub: "TUV" } | 45 | DialerButton { text: "8"; sub: "TUV" } | ||
46 | DialerButton { text: "9"; sub: "WXYZ" } | 46 | DialerButton { text: "9"; sub: "WXYZ" } | ||
47 | 47 | | |||
48 | DialerButton { text: "*"; } | 48 | DialerButton { display: "*"; text: "*"; special: true; } | ||
49 | DialerButton { text: "0"; sub: "+"; } | 49 | DialerButton { text: "0"; subdisplay: "+"; sub: "+"; } | ||
50 | DialerButton { text: "#" } | 50 | DialerButton { display: "#"; text: "#"; special: true; } | ||
51 | 51 | | |||
52 | Item { | ||||
53 | Layout.fillWidth: true | ||||
54 | Layout.fillHeight: true | ||||
55 | } | ||||
52 | DialerIconButton { | 56 | DialerIconButton { | ||
53 | id: callButton | 57 | id: callButton | ||
54 | Layout.fillWidth: true | 58 | Layout.fillWidth: true | ||
55 | Layout.maximumHeight: buttonHeight | 59 | Layout.fillHeight: true | ||
56 | Layout.minimumHeight: Layout.maximumHeight | | |||
57 | 60 | | |||
58 | enabled: status.text.length > 0 | 61 | enabled: status.text.length > 0 | ||
59 | opacity: enabled ? 1 : 0.5 | 62 | opacity: enabled ? 1 : 0.5 | ||
60 | source: "call-start" | 63 | source: "call-start" | ||
61 | callback: function() { | 64 | callback: function() { | ||
62 | call(status.text); | 65 | call(status.text); | ||
63 | } | 66 | } | ||
64 | } | 67 | } | ||
65 | Item { | 68 | Item { | ||
66 | Layout.fillWidth: true | 69 | Layout.fillWidth: true | ||
67 | } | 70 | Layout.fillHeight: true | ||
68 | DialerIconButton { | | |||
69 | Layout.fillWidth: true | | |||
70 | Layout.maximumHeight: buttonHeight | | |||
71 | Layout.minimumHeight: Layout.maximumHeight | | |||
72 | | ||||
73 | enabled: status.text.length > 0 | | |||
74 | opacity: enabled ? 1 : 0.5 | | |||
75 | source: "edit-clear" | | |||
76 | callback: function(text) { | | |||
77 | if (status.text.length > 0) { | | |||
78 | status.text = status.text.substr(0, status.text.length - 1); | | |||
79 | } | | |||
80 | } | | |||
81 | } | 71 | } | ||
82 | } | 72 | } |