Meshroom/meshroom/ui/qml/MaterialIcons/MaterialToolLabel.qml
2023-07-03 12:11:29 +02:00

43 lines
1,005 B
QML

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.11
/**
* MaterialToolLabel is a Label with an icon (using MaterialIcons).
* It shows up its tooltip when hovered.
*/
Item {
id: control
property alias iconText: iconItem.text
property alias iconSize: iconItem.font.pointSize
property alias label: labelItem.text
implicitWidth: childrenRect.width
implicitHeight: childrenRect.height
anchors.rightMargin: 5
RowLayout {
Label {
id: iconItem
font.family: MaterialIcons.fontFamily
font.pointSize: 13
padding: 0
text: ""
color: palette.text
}
Label {
id: labelItem
text: ""
color: palette.text
}
}
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.NoButton
}
ToolTip.visible: mouseArea.containsMouse
ToolTip.delay: 500
}