2014-09-26 19:05:59 +00:00
|
|
|
import QtQuick 2.0
|
|
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
|
|
|
|
|
|
|
|
Text {
|
|
|
|
|
width: parent.width / parent.columns
|
|
|
|
|
height: parent.buttonHeight
|
|
|
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
|
|
|
verticalAlignment: Qt.AlignVCenter
|
2014-09-29 21:08:55 +00:00
|
|
|
color: dialer.textColor
|
2014-09-26 19:05:59 +00:00
|
|
|
font.pixelSize: Math.floor((width - (units.largeSpacing)) / 2)
|
2014-09-29 21:08:55 +00:00
|
|
|
property alias sub: longHold.text
|
2014-09-26 19:05:59 +00:00
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
onClicked: {
|
|
|
|
|
addNumber(parent.text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onPressAndHold: {
|
|
|
|
|
if (longHold.visible) {
|
|
|
|
|
addNumber(longHold.text);
|
|
|
|
|
} else {
|
|
|
|
|
addNumber(parent.text);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Text {
|
|
|
|
|
id: longHold
|
|
|
|
|
anchors {
|
|
|
|
|
top: parent.top
|
|
|
|
|
right: parent.right
|
|
|
|
|
}
|
2014-09-29 21:08:55 +00:00
|
|
|
height: parent.height
|
|
|
|
|
width: parent.width / 3
|
|
|
|
|
verticalAlignment: Qt.AlignVCenter
|
|
|
|
|
visible: text.length > 0
|
|
|
|
|
opacity: 0.7
|
2014-09-26 19:05:59 +00:00
|
|
|
|
|
|
|
|
font.pixelSize: parent.pixelSize * .8
|
2014-09-29 21:08:55 +00:00
|
|
|
color: dialer.textColor
|
2014-09-26 19:05:59 +00:00
|
|
|
}
|
|
|
|
|
}
|