2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtGraphicalEffects 1.15
|
|
|
|
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-14 11:53:56 +00:00
|
|
|
import "../"
|
2020-05-13 19:41:16 +00:00
|
|
|
|
|
|
|
Rectangle {
|
2020-06-24 03:23:49 +00:00
|
|
|
id: root
|
2020-06-29 22:02:19 +00:00
|
|
|
property alias source: roundedIconImage.source
|
|
|
|
default property alias content: content.children
|
|
|
|
property alias icon: roundedIconImage
|
2020-09-14 14:58:21 +00:00
|
|
|
property bool rotates: false
|
2020-06-24 03:23:49 +00:00
|
|
|
signal clicked
|
2020-06-29 22:02:19 +00:00
|
|
|
width: 36
|
|
|
|
height: 36
|
|
|
|
property alias iconWidth: roundedIconImage.width
|
|
|
|
property alias iconHeight: roundedIconImage.height
|
|
|
|
property alias rotation: roundedIconImage.rotation
|
2024-10-15 19:26:12 +00:00
|
|
|
property color iconColor: Theme.palette.transparent
|
2020-05-13 19:41:16 +00:00
|
|
|
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.primaryColor1
|
2020-06-29 22:02:19 +00:00
|
|
|
radius: width / 2
|
2020-05-13 19:41:16 +00:00
|
|
|
|
2020-09-14 14:58:21 +00:00
|
|
|
Item {
|
|
|
|
id: iconContainer
|
2020-05-13 19:41:16 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2020-09-14 14:58:21 +00:00
|
|
|
width: roundedIconImage.width
|
|
|
|
height: roundedIconImage.height
|
|
|
|
|
|
|
|
SVGImage {
|
|
|
|
id: roundedIconImage
|
|
|
|
width: 12
|
|
|
|
height: 12
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2024-10-15 19:26:12 +00:00
|
|
|
source: Theme.svg("new_chat")
|
2020-09-14 14:58:21 +00:00
|
|
|
}
|
|
|
|
ColorOverlay {
|
|
|
|
anchors.fill: roundedIconImage
|
|
|
|
source: roundedIconImage
|
|
|
|
color: root.iconColor
|
2020-09-17 06:40:41 +00:00
|
|
|
rotation: roundedIconImage.rotation
|
2020-09-14 14:58:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
active: rotates
|
|
|
|
sourceComponent: rotatorComponent
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: rotatorComponent
|
|
|
|
RotationAnimator {
|
|
|
|
target: iconContainer
|
|
|
|
from: 0;
|
|
|
|
to: 360;
|
|
|
|
duration: 1200
|
2022-06-28 14:44:58 +00:00
|
|
|
running: visible
|
2020-09-14 14:58:21 +00:00
|
|
|
loops: Animation.Infinite
|
|
|
|
}
|
|
|
|
|
2020-06-29 22:02:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: content
|
2020-09-14 14:58:21 +00:00
|
|
|
anchors.left: iconContainer.right
|
|
|
|
anchors.leftMargin: 6 + (root.width - iconContainer.width)
|
2020-05-13 19:41:16 +00:00
|
|
|
}
|
2020-06-24 03:23:49 +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}
|
|
|
|
}
|
|
|
|
##^##*/
|