Commit ad8b9ff0 authored by Tranter Madi's avatar Tranter Madi 🌧
Browse files

Simplify LabelWidthTooltip.qml

parent 2724e2b4
Pipeline #144127 passed with stage
in 3 minutes and 38 seconds
......@@ -6,8 +6,6 @@
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtGraphicalEffects 1.0
import QtQuick.Window 2.2
import org.kde.kirigami 2.5 as Kirigami
Kirigami.Heading {
......@@ -16,33 +14,18 @@ Kirigami.Heading {
level: 5
textFormat: Text.PlainText
horizontalAlignment: Text.AlignLeft
elide: Text.ElideRight
Loader {
id: mouseArea
anchors.fill: parent
active: theLabel.truncated
visible: theLabel.truncated
sourceComponent: MouseArea {
id: hoverArea
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.NoButton
Loader {
anchors.fill: parent
active: hoverArea && hoverArea.containsMouse
sourceComponent: ToolTip {
delay: Qt.styleHints.mousePressAndHoldInterval
visible: hoverArea && hoverArea.containsMouse && theLabel.truncated
text: theLabel.text
}
}
}
}
ToolTip.visible: mouseArea.active ? mouseArea.item.containsMouse : false
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: theLabel.text
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment