2024-10-08 20:22:22 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2022-06-06 15:23:24 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
2022-08-18 14:25:06 +00:00
|
|
|
import StatusQ.Components 0.1
|
2022-06-06 15:23:24 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1 as StatusQControls
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property alias text: bannerText.text
|
|
|
|
property alias buttonText: bannerButton.text
|
2022-08-11 11:55:08 +00:00
|
|
|
property alias icon: bannerIcon.asset
|
2022-09-15 07:31:38 +00:00
|
|
|
property string buttonTooltipText: ""
|
|
|
|
property bool buttonLoading: false
|
2022-06-06 15:23:24 +00:00
|
|
|
|
|
|
|
implicitWidth: 272
|
2022-08-18 14:25:06 +00:00
|
|
|
implicitHeight: 168
|
2024-10-15 19:26:12 +00:00
|
|
|
border.color: Theme.palette.border
|
2022-06-06 15:23:24 +00:00
|
|
|
radius: 16
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.transparent
|
2022-06-06 15:23:24 +00:00
|
|
|
|
|
|
|
signal buttonClicked()
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
acceptedButtons: Qt.RightButton
|
|
|
|
propagateComposedEvents: true
|
|
|
|
onClicked: {
|
|
|
|
/* Prevents sending events to the component beneath
|
|
|
|
if Right Mouse Button is clicked. */
|
|
|
|
mouse.accepted = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
width: 70
|
|
|
|
height: 4
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.background
|
2022-06-06 15:23:24 +00:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: -2
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
}
|
|
|
|
|
2022-08-18 14:25:06 +00:00
|
|
|
StatusRoundIcon {
|
2022-06-06 15:23:24 +00:00
|
|
|
id: bannerIcon
|
|
|
|
anchors.top: parent.top
|
2022-08-18 14:25:06 +00:00
|
|
|
anchors.topMargin: -8
|
2022-06-06 15:23:24 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
id: bannerText
|
|
|
|
anchors.top: parent.top
|
2022-08-18 14:25:06 +00:00
|
|
|
anchors.topMargin: 48
|
2022-06-06 15:23:24 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
anchors.right: parent.right
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.rightMargin: Theme.xlPadding
|
2022-06-06 15:23:24 +00:00
|
|
|
anchors.left: parent.left
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.leftMargin: Theme.xlPadding
|
2022-06-06 15:23:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusQControls.StatusButton {
|
|
|
|
id: bannerButton
|
2023-04-26 16:22:57 +00:00
|
|
|
objectName: "communityBannerButton"
|
2022-06-06 15:23:24 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.bottom: parent.bottom
|
2022-08-18 14:25:06 +00:00
|
|
|
anchors.bottomMargin: 16
|
|
|
|
font.weight: Font.Medium
|
2022-09-15 07:31:38 +00:00
|
|
|
onClicked: {
|
|
|
|
if (!root.buttonLoading) {
|
|
|
|
root.buttonClicked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
loading: root.buttonLoading
|
|
|
|
|
|
|
|
StatusQControls.StatusToolTip {
|
|
|
|
text: root.buttonTooltipText
|
|
|
|
visible: !!root.buttonTooltipText && bannerButton.loading && bannerButton.hovered
|
|
|
|
}
|
2022-06-06 15:23:24 +00:00
|
|
|
}
|
|
|
|
}
|
2022-08-25 11:18:51 +00:00
|
|
|
|