2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2021-10-25 12:30:23 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2021-10-28 13:37:26 +00:00
|
|
|
import StatusQ.Platform 0.1
|
2024-10-15 19:26:12 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2021-10-28 13:37:26 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-01-19 19:26:59 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
property bool checked: false
|
|
|
|
property string name
|
|
|
|
property string notificationTitle
|
|
|
|
property string notificationMessage
|
|
|
|
property var buttonGroup
|
|
|
|
property bool isHovered: false
|
|
|
|
signal radioCheckedChanged(checked: bool)
|
|
|
|
|
|
|
|
id: root
|
|
|
|
height: container.height
|
|
|
|
width: container.width
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: container
|
2024-10-15 19:26:12 +00:00
|
|
|
width: notificationPreview.width + Theme.padding * 2
|
|
|
|
height: childrenRect.height + Theme.padding + Theme.halfPadding
|
|
|
|
color: radioButton.checked ? Theme.palette.secondaryBackground :
|
|
|
|
(isHovered ? Theme.palette.backgroundHover : Theme.palette.transparent)
|
|
|
|
radius: Theme.radius
|
2021-01-19 19:26:59 +00:00
|
|
|
|
|
|
|
StatusRadioButton {
|
|
|
|
id: radioButton
|
|
|
|
text: root.name
|
|
|
|
ButtonGroup.group: root.buttonGroup
|
|
|
|
checked: root.checked
|
|
|
|
onCheckedChanged: root.radioCheckedChanged(checked)
|
|
|
|
anchors.top: parent.top
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.topMargin: Theme.halfPadding
|
2021-01-19 19:26:59 +00:00
|
|
|
anchors.left: parent.left
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.leftMargin: Theme.padding
|
2021-01-19 19:26:59 +00:00
|
|
|
}
|
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
StatusNotificationWithDropShadowPanel {
|
2021-01-19 19:26:59 +00:00
|
|
|
id: notificationPreview
|
|
|
|
anchors.top: radioButton.bottom
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.topMargin: Theme.halfPadding
|
2021-01-19 19:26:59 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
name: root.notificationTitle
|
|
|
|
message: root.notificationMessage
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: container
|
|
|
|
hoverEnabled: true
|
|
|
|
onEntered: root.isHovered = true
|
|
|
|
onExited: root.isHovered = false
|
|
|
|
onClicked: {
|
|
|
|
if (!radioButton.checked) {
|
|
|
|
root.radioCheckedChanged(true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|