status-desktop/ui/shared/RoundedIcon.qml

52 lines
1.2 KiB
QML
Raw Normal View History

2020-06-17 19:31:01 +00:00
import QtQuick 2.13
import QtGraphicalEffects 1.0
2020-05-13 19:41:16 +00:00
import "../imports"
Rectangle {
id: root
property alias source: roundedIconImage.source
default property alias content: content.children
property alias icon: roundedIconImage
signal clicked
width: 36
height: 36
property alias iconWidth: roundedIconImage.width
property alias iconHeight: roundedIconImage.height
property alias rotation: roundedIconImage.rotation
2020-05-13 19:41:16 +00:00
color: Style.current.blue
radius: width / 2
2020-05-13 19:41:16 +00:00
SVGImage {
2020-05-13 20:18:16 +00:00
id: roundedIconImage
2020-05-13 19:41:16 +00:00
width: 12
height: 12
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
fillMode: Image.PreserveAspectFit
source: "../img/new_chat.svg"
}
Item {
id: content
anchors.left: roundedIconImage.right
anchors.leftMargin: 6 + (root.width - roundedIconImage.width)
2020-05-13 19:41:16 +00:00
}
MouseArea {
id: mouseArea
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
cursorShape: Qt.PointingHandCursor
onClicked: {
root.clicked()
}
}
2020-05-13 19:41:16 +00:00
}
/*##^##
Designer {
D{i:0;formeditorZoom:1.75}
}
##^##*/