Spectral/qml/component/AutoMouseArea.qml

13 lines
373 B
QML
Raw Normal View History

import QtQuick 2.9
import Spectral.Settings 0.1
MouseArea {
signal primaryClicked()
signal secondaryClicked()
acceptedButtons: MSettings.pressAndHold ? Qt.LeftButton : (Qt.LeftButton | Qt.RightButton)
2018-09-04 13:13:14 +00:00
onClicked: mouse.button == Qt.RightButton ? secondaryClicked() : primaryClicked()
onPressAndHold: MSettings.pressAndHold ? secondaryClicked() : {}
}