Meshroom/meshroom/ui/qml/MaterialIcons/MaterialToolButton.qml
Candice Bentéjac 0e71f2a520 [qt6] Update versions for all the imported modules
Qt3D.Extras cannot be updated to 2.6 yet, otherwise there are errors.
2024-11-07 18:09:01 +01:00

33 lines
948 B
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
/**
* MaterialToolButton is a standard ToolButton using MaterialIcons font.
* It also shows up its tooltip when hovered.
*/
ToolButton {
id: control
font.family: MaterialIcons.fontFamily
padding: 4
font.pointSize: 13
ToolTip.visible: ToolTip.text && hovered
ToolTip.delay: 100
Component.onCompleted: {
contentItem.color = Qt.binding(function() { return checked ? palette.highlight : palette.text })
}
background: Rectangle {
color: {
if (pressed || checked || hovered) {
if (pressed || checked)
return Qt.darker(parent.palette.base, 1.3)
if (hovered)
return Qt.darker(parent.palette.base, 0.6)
}
return "transparent"
}
border.color: checked ? Qt.darker(parent.palette.base, 1.4) : "transparent"
}
}