This repository has been archived on 2026-07-13. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
nova-shell/modules/BarLabel.qml
2026-04-12 15:30:35 +02:00

28 lines
770 B
QML

import QtQuick
import Quickshell
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.screen = QsWindow.window?.screen ?? null;
M.FlyoutState.visible = true;
} else if (!hovered && root.tooltip !== "") {
M.FlyoutState.visible = false;
}
}
}
}