Meshroom/meshroom/ui/qml/MaterialIcons/MaterialLabel.qml
Yann Lanthony 62961dedd9 [ui] MaterialIcons: add MaterialLabel
preset Component to create a Label with MaterialIcons font + optional tooltip
2018-08-05 22:20:30 +02:00

24 lines
595 B
QML

import QtQuick 2.9
import QtQuick.Controls 2.4
/**
* MaterialLabel is a standard Label using MaterialIcons font.
* If ToolTip.text is set, it also shows up a tooltip when hovered.
*/
Label {
font.family: MaterialIcons.fontFamily
font.pointSize: 10
ToolTip.visible: toolTipLoader.active && toolTipLoader.item.containsMouse
ToolTip.delay: 1000
Loader {
id: toolTipLoader
anchors.fill: parent
active: parent.ToolTip.text
sourceComponent: MouseArea {
hoverEnabled: true
acceptedButtons: Qt.NoButton
}
}
}