2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import QtQml.Models 2.15
|
2023-03-31 12:26:49 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Popups.Dialog 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2023-06-27 19:56:44 +00:00
|
|
|
import StatusQ.Components 0.1
|
2023-03-31 12:26:49 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
StatusDialog {
|
|
|
|
id: root
|
|
|
|
|
2023-05-30 15:18:45 +00:00
|
|
|
property alias acceptBtnText: acceptBtn.text
|
|
|
|
property alias alertText: contentTextItem.text
|
2023-06-27 19:56:44 +00:00
|
|
|
property alias alertLabel: contentTextItem
|
|
|
|
property int acceptBtnType: StatusBaseButton.Type.Danger
|
|
|
|
|
|
|
|
property StatusAssetSettings asset: StatusAssetSettings {
|
|
|
|
width: 24
|
|
|
|
height: 24
|
|
|
|
rotation: 0
|
|
|
|
color: Theme.palette.primaryColor1
|
|
|
|
bgWidth: 40
|
|
|
|
bgHeight: 40
|
|
|
|
bgColor: Theme.palette.primaryColor3
|
|
|
|
bgRadius: bgWidth / 2
|
|
|
|
}
|
2023-03-31 12:26:49 +00:00
|
|
|
|
2023-05-30 15:18:45 +00:00
|
|
|
signal acceptClicked
|
2023-03-31 12:26:49 +00:00
|
|
|
signal cancelClicked
|
|
|
|
|
|
|
|
implicitWidth: 400 // by design
|
2024-10-15 19:26:12 +00:00
|
|
|
topPadding: Theme.padding
|
2023-03-31 12:26:49 +00:00
|
|
|
bottomPadding: topPadding
|
|
|
|
contentItem: StatusBaseText {
|
2023-05-30 15:18:45 +00:00
|
|
|
id: contentTextItem
|
|
|
|
|
2024-10-15 19:26:12 +00:00
|
|
|
font.pixelSize: Theme.primaryTextFontSize
|
2023-03-31 12:26:49 +00:00
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
lineHeight: 1.2
|
|
|
|
}
|
|
|
|
|
2023-06-27 19:56:44 +00:00
|
|
|
header: StatusDialogHeader {
|
|
|
|
visible: root.title || root.subtitle
|
|
|
|
headline.title: root.title
|
|
|
|
headline.subtitle: root.subtitle
|
|
|
|
actions.closeButton.onClicked: root.close()
|
|
|
|
leftComponent: StatusRoundIcon {
|
|
|
|
width: visible? implicitWidth: 0
|
|
|
|
visible: !!root.asset.name
|
|
|
|
asset: root.asset
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-31 12:26:49 +00:00
|
|
|
footer: StatusDialogFooter {
|
2024-10-15 19:26:12 +00:00
|
|
|
spacing: Theme.padding
|
2023-03-31 12:26:49 +00:00
|
|
|
rightButtons: ObjectModel {
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
text: qsTr("Cancel")
|
|
|
|
normalColor: "transparent"
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
root.cancelClicked()
|
|
|
|
close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusButton {
|
2023-05-30 15:18:45 +00:00
|
|
|
id: acceptBtn
|
|
|
|
|
2023-06-27 19:56:44 +00:00
|
|
|
type: root.acceptBtnType
|
2023-03-31 12:26:49 +00:00
|
|
|
|
|
|
|
onClicked: {
|
2023-05-30 15:18:45 +00:00
|
|
|
root.acceptClicked()
|
2023-03-31 12:26:49 +00:00
|
|
|
close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|