43 lines
835 B
QML
43 lines
835 B
QML
|
import QtQuick 2.15
|
||
|
import QtGraphicalEffects 1.0
|
||
|
import QtQuick.Controls 2.3
|
||
|
|
||
|
ToolButton {
|
||
|
width: 25
|
||
|
height: 25
|
||
|
|
||
|
signal pressed()
|
||
|
|
||
|
property var name: String
|
||
|
property var toolIcon: String
|
||
|
property bool isActivated: false
|
||
|
|
||
|
onClicked: pressed()
|
||
|
|
||
|
ToolTip.visible: hovered
|
||
|
ToolTip.text: name
|
||
|
|
||
|
background: Rectangle { color: "transparent" }
|
||
|
contentItem: Rectangle { color: "transparent" }
|
||
|
|
||
|
visible: !matrix.currentRoom.direct
|
||
|
|
||
|
Image {
|
||
|
id: internalImage
|
||
|
|
||
|
anchors.fill: parent
|
||
|
|
||
|
sourceSize.width: parent.width
|
||
|
sourceSize.height: parent.height
|
||
|
|
||
|
source: toolIcon
|
||
|
}
|
||
|
|
||
|
ColorOverlay {
|
||
|
anchors.fill: parent
|
||
|
source: internalImage
|
||
|
|
||
|
color: parent.hovered ? "white" : (isActivated ? "white" : Qt.rgba(0.8, 0.8, 0.8, 1.0))
|
||
|
}
|
||
|
}
|