2019-10-25 07:07:32 +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
|
|
|
|
|
color: dialer.textColor
|
2021-09-13 16:40:56 +00:00
|
|
|
font.pixelSize: Math.floor((width - (PlasmaCore.Units.largeSpacing)) / 2)
|
2019-10-25 07:07:32 +00:00
|
|
|
property alias sub: longHold.text
|
|
|
|
|
property var callback
|
|
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
onClicked: {
|
|
|
|
|
if (callback) {
|
|
|
|
|
callback();
|
|
|
|
|
} else {
|
|
|
|
|
addNumber(parent.text);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onPressAndHold: {
|
|
|
|
|
if (longHold.visible) {
|
|
|
|
|
addNumber(longHold.text);
|
|
|
|
|
} else {
|
|
|
|
|
addNumber(parent.text);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Text {
|
|
|
|
|
id: longHold
|
|
|
|
|
anchors {
|
|
|
|
|
top: parent.top
|
|
|
|
|
right: parent.right
|
|
|
|
|
}
|
|
|
|
|
height: parent.height
|
|
|
|
|
width: parent.width / 3
|
|
|
|
|
verticalAlignment: Qt.AlignVCenter
|
|
|
|
|
visible: text.length > 0
|
|
|
|
|
opacity: 0.7
|
|
|
|
|
|
|
|
|
|
font.pixelSize: parent.pixelSize * .8
|
|
|
|
|
color: parent.color
|
|
|
|
|
}
|
|
|
|
|
}
|