42 lines
1.0 KiB
QML
42 lines
1.0 KiB
QML
import Quickshell
|
|
import QtQuick
|
|
|
|
PopupWindow {
|
|
id: tooltip
|
|
|
|
required property color bgColor
|
|
required property color fgColor
|
|
required property color borderColor
|
|
required property string fontFamily
|
|
|
|
property string text: ""
|
|
property Item target: null
|
|
|
|
visible: text !== "" && target !== null && target.hovered
|
|
anchor.item: target
|
|
anchor.edges: Edges.Bottom
|
|
anchor.gravity: Edges.Bottom
|
|
anchor.adjustment: PopupAdjustment.SlideX
|
|
implicitWidth: tooltipContent.implicitWidth + 20
|
|
implicitHeight: tooltipContent.implicitHeight + 14
|
|
color: "transparent"
|
|
|
|
Rectangle {
|
|
anchors.fill: parent
|
|
color: tooltip.bgColor
|
|
border.color: tooltip.borderColor
|
|
border.width: 2
|
|
radius: 8
|
|
|
|
Text {
|
|
id: tooltipContent
|
|
anchors.centerIn: parent
|
|
text: tooltip.text
|
|
color: tooltip.fgColor
|
|
font.pixelSize: 12
|
|
font.family: tooltip.fontFamily
|
|
lineHeight: 1.3
|
|
}
|
|
}
|
|
}
|