diff --git a/src/imports/mvvmquick/ActionButton.qml b/src/imports/mvvmquick/ActionButton.qml index f75080f..78ca657 100644 --- a/src/imports/mvvmquick/ActionButton.qml +++ b/src/imports/mvvmquick/ActionButton.qml @@ -33,17 +33,12 @@ ToolButton { icon.width: 24 icon.height: 24 - ToolTip { - id: _backToolTip - text: _toolButton.toolTip - } + ToolTip.visible: pressed && _toolButton.toolTip != "" + ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval + ToolTip.text: _toolButton.toolTip onPressAndHold: { - if(_backToolTip.text !== "") { + if(_toolButton.toolTip !== "") QuickPresenter.hapticLongPress(); - _backToolTip.visible = true; - } } - onCanceled: _backToolTip.visible = false - onReleased: _backToolTip.visible = false } diff --git a/src/imports/mvvmquick/RoundActionButton.qml b/src/imports/mvvmquick/RoundActionButton.qml index 9bd275f..f2dd840 100644 --- a/src/imports/mvvmquick/RoundActionButton.qml +++ b/src/imports/mvvmquick/RoundActionButton.qml @@ -26,17 +26,12 @@ RoundButton { icon.width: 24 icon.height: 24 - ToolTip { - id: _backToolTip - text: _roundButton.toolTip - } + ToolTip.visible: pressed && _roundButton.toolTip != "" + ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval + ToolTip.text: _roundButton.toolTip onPressAndHold: { - if(_backToolTip.text !== "") { + if(_roundButton.toolTip !== "") QuickPresenter.hapticLongPress(); - _backToolTip.visible = true; - } } - onCanceled: _backToolTip.visible = false - onReleased: _backToolTip.visible = false }