Browse Source

improve tooltip handling

pull/2/head
Skycoder42 7 years ago
parent
commit
29b5ca9691
No known key found for this signature in database GPG Key ID: 8E01AD9EF0578D2B
  1. 13
      src/imports/mvvmquick/ActionButton.qml
  2. 13
      src/imports/mvvmquick/RoundActionButton.qml

13
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
}

13
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
}

Loading…
Cancel
Save