add close button

This commit is contained in:
Anika Raemer 2021-03-13 17:06:39 +01:00
parent 693078b892
commit 5d5e3c6888
6 changed files with 56 additions and 30 deletions

View file

@ -1,41 +1,40 @@
import QtQuick 2.0
import QtQuick.Controls 2.4
Rectangle {
/**
* @brief Round button containing an image
*/
Button {
id: container
property alias imageSource: image.source
signal clicked();
border.width: 2
border.color: "grey"
background: Rectangle{
color: "white"
border.width: 2
border.color: "grey"
width: 65
height: width
radius: width/2
color: "white"
Image{
id: image
anchors.centerIn: parent
width: 30
height: width
source: "qrc:/icon_back"
}
Rectangle{
id: overlay
z: 1
visible: !container.enabled
anchors.centerIn: parent
width: 30
height: width
color: "#99ffffff"
}
implicitWidth: 65
implicitHeight: width
radius: width/2
MouseArea{
id: controlObject
anchors.fill: parent
onClicked:{
container.clicked();
Image{
id: image
anchors.centerIn: parent
width: 30
height: width
source: "qrc:/icon_back"
}
Rectangle{
id: overlay
z: 1
visible: !container.enabled
anchors.centerIn: parent
width: 30
height: width
color: "#99ffffff"
}
}
}