shift-shell/shell/contents/components/DialerIconButton.qml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
821 B
QML
Raw Normal View History

import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
Item {
width: parent.width / parent.columns
height: parent.buttonHeight
property var callback
property string text
property string sub
property alias source: icon.source
PlasmaCore.IconItem {
id: icon
2021-09-13 16:40:56 +00:00
width: PlasmaCore.Units.iconSizes.medium
height: width
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: {
if (callback) {
callback();
} else {
addNumber(parent.text);
}
}
onPressAndHold: {
if (parent.sub.length > 0) {
addNumber(parent.sub);
} else {
addNumber(parent.text);
}
}
}
}