shift-shell/dialer/contents/ui/DialerIconButton.qml
Marco Martin 013d99a493 port the existing dialer in a standalone app
is qml-only at the moment, but may need to be a c++ half-daemon
in order to be always running and show the "ringning" ui at the right moment
2015-03-27 17:59:32 +01:00

37 lines
810 B
QML

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
width: 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);
}
}
}
}