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 ...@@ -11,10 +11,10 @@ import QtQuick 2.4
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.12 import QtGraphicalEffects 1.12
import QtQuick.Controls 2.2 as Controls import QtQuick.Controls 2.2 as Controls
import QtFeedback 5.0
import org.kde.kirigami 2.2 as Kirigami import org.kde.kirigami 2.2 as Kirigami
Item { Item {
id: root id: root
Layout.fillWidth: true Layout.fillWidth: true
...@@ -35,6 +35,17 @@ Item { ...@@ -35,6 +35,17 @@ Item {
property color buttonTextColor: Kirigami.Theme.textColor property color buttonTextColor: Kirigami.Theme.textColor
property color dropShadowColor: Qt.darker(Kirigami.Theme.backgroundColor, 1.15) 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 { Rectangle {
id: keyRect id: keyRect
anchors.fill: parent anchors.fill: parent
...@@ -46,6 +57,7 @@ Item { ...@@ -46,6 +57,7 @@ Item {
anchors.fill: parent anchors.fill: parent
onPressedChanged: { onPressedChanged: {
if (pressed) { if (pressed) {
vibrate.start();
parent.color = root.buttonPressedColor; parent.color = root.buttonPressedColor;
} else { } else {
parent.color = root.buttonColor; 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