Commit 1b04b29f authored by Devin Lin's avatar Devin Lin 🎨
Browse files

Add vibration to numpad

parent 7ae1ce5d
......@@ -11,10 +11,10 @@ import QtQuick 2.4
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.12
import QtQuick.Controls 2.2 as Controls
import QtFeedback 5.0
import org.kde.kirigami 2.2 as Kirigami
Item {
id: root
Layout.fillWidth: true
......@@ -35,6 +35,17 @@ Item {
property color buttonTextColor: Kirigami.Theme.textColor
property color dropShadowColor: Qt.darker(Kirigami.Theme.backgroundColor, 1.15)
// vibration
HapticsEffect {
id: vibrate
attackIntensity: 0.0
attackTime: 0
fadeTime: 0
fadeIntensity: 0.0
intensity: 0.5
duration: Kirigami.Units.shortDuration
}
Rectangle {
id: keyRect
anchors.fill: parent
......@@ -46,6 +57,7 @@ Item {
anchors.fill: parent
onPressedChanged: {
if (pressed) {
vibrate.start();
parent.color = root.buttonPressedColor;
} else {
parent.color = root.buttonColor;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment