26 lines
686 B
QML
26 lines
686 B
QML
import QtQuick
|
|
import "." as M
|
|
|
|
Text {
|
|
id: root
|
|
property string icon: ""
|
|
property string tooltip: ""
|
|
|
|
text: icon
|
|
color: M.Theme.base05
|
|
font.pixelSize: M.Theme.fontSize + 1
|
|
font.family: M.Theme.iconFontFamily
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
}
|