mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-06 07:19:27 -05:00
tooltips: add delay
This commit is contained in:
@@ -7,9 +7,31 @@ import QtQuick.Layouts
|
||||
ToolTip {
|
||||
property string content
|
||||
property bool extraVisibleCondition: true
|
||||
property bool internalVisibleCondition: false
|
||||
padding: 7
|
||||
|
||||
visible: (extraVisibleCondition && (parent.hovered === undefined || parent?.hovered))
|
||||
visible: (extraVisibleCondition && (parent.hovered === undefined || parent?.hovered) && internalVisibleCondition)
|
||||
|
||||
Connections {
|
||||
target: parent
|
||||
onHoveredChanged: {
|
||||
if (parent.hovered) {
|
||||
tooltipShowDelay.restart()
|
||||
} else {
|
||||
internalVisibleCondition = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: tooltipShowDelay
|
||||
interval: 200
|
||||
repeat: false
|
||||
running: false
|
||||
onTriggered: {
|
||||
internalVisibleCondition = true
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: Appearance.colors.colTooltip
|
||||
|
||||
Reference in New Issue
Block a user