nova-shell/modules/BarLabel.qml
2026-04-12 10:57:48 +02:00

26 lines
680 B
QML

import QtQuick
import "." as M
Text {
id: root
property string label: ""
property string tooltip: ""
text: label
color: M.Theme.base05
font.pixelSize: M.Theme.fontSize
font.family: M.Theme.fontFamily
verticalAlignment: Text.AlignVCenter
HoverHandler {
onHoveredChanged: {
if (hovered && root.tooltip !== "") {
M.FlyoutState.text = root.tooltip;
M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x;
M.FlyoutState.visible = true;
} else if (!hovered && root.tooltip !== "") {
M.FlyoutState.visible = false;
}
}
}
}