mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-04 01:08:26 +02:00
[ui] MaterialIcons: add MaterialLabel
preset Component to create a Label with MaterialIcons font + optional tooltip
This commit is contained in:
parent
6a138e492a
commit
62961dedd9
2 changed files with 25 additions and 0 deletions
24
meshroom/ui/qml/MaterialIcons/MaterialLabel.qml
Normal file
24
meshroom/ui/qml/MaterialIcons/MaterialLabel.qml
Normal file
|
@ -0,0 +1,24 @@
|
|||
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
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
module MaterialIcons
|
||||
singleton MaterialIcons 2.2 MaterialIcons.qml
|
||||
MaterialToolButton 2.2 MaterialToolButton.qml
|
||||
MaterialLabel 2.2 MaterialLabel.qml
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue