mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
41 lines
975 B
QML
41 lines
975 B
QML
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
|
|
font.pixelSize: Math.floor((width - (units.largeSpacing)) / 2)
|
|
property alias sub: longHold.text;
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
onClicked: {
|
|
addNumber(parent.text);
|
|
}
|
|
|
|
onPressAndHold: {
|
|
if (longHold.visible) {
|
|
addNumber(longHold.text);
|
|
} else {
|
|
addNumber(parent.text);
|
|
}
|
|
}
|
|
}
|
|
|
|
Text {
|
|
id: longHold
|
|
visible: text.length > 0
|
|
opacity: 0.7
|
|
height: parent.height
|
|
width: parent.width / 3
|
|
verticalAlignment: Qt.AlignVCenter
|
|
anchors {
|
|
top: parent.top
|
|
right: parent.right
|
|
}
|
|
|
|
font.pixelSize: parent.pixelSize * .8
|
|
}
|
|
}
|