Skip to content

Commit

Permalink
Place tooltips under the cursor (draft)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsurkov committed Dec 23, 2021
1 parent be8565a commit 35f7941
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions application/style/ToolTip.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ import Theme 1.0
T.ToolTip {
id: control

x: parent ? (parent.width - implicitWidth) / 2 : 0
y: -implicitHeight - 3
x: mouseArea.mouseX + 10
y: mouseArea.mouseY + 20

implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
contentWidth + leftPadding + rightPadding)
Expand Down Expand Up @@ -89,4 +89,13 @@ T.ToolTip {
border.color: Theme.color.mediumorange3
color: "black"
}

MouseArea {
id: mouseArea
parent: control.parent
anchors.fill: parent

hoverEnabled: !control.visible
acceptedButtons: Qt.NoButton
}
}

0 comments on commit 35f7941

Please sign in to comment.