2018-03-16 22:01:21 +00:00
|
|
|
import QtQuick 2.0
|
2018-04-25 15:24:14 +00:00
|
|
|
import "."
|
2018-03-16 22:01:21 +00:00
|
|
|
|
2018-07-04 23:17:05 +00:00
|
|
|
Item {
|
2018-03-16 22:01:21 +00:00
|
|
|
property alias promptText:prompt.text
|
|
|
|
property alias yesText: yesButton.text
|
|
|
|
property alias noText: noButton.text
|
|
|
|
|
|
|
|
// change UI appearance if yes is a destructive action
|
|
|
|
property bool yesIsDestructive: false
|
|
|
|
|
|
|
|
signal accepted()
|
|
|
|
|
|
|
|
signal rejected()
|
|
|
|
|
2018-06-28 10:43:40 +00:00
|
|
|
StyledText {
|
2018-03-16 22:01:21 +00:00
|
|
|
id: prompt
|
|
|
|
anchors {
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
left: parent.left
|
|
|
|
right: yesButton.left
|
|
|
|
margins: Style.margin
|
|
|
|
}
|
|
|
|
|
|
|
|
height: parent.height
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: yesButton
|
|
|
|
anchors {
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
right: noButton.left
|
|
|
|
rightMargin: Style.margin
|
|
|
|
}
|
|
|
|
|
|
|
|
destructiveAction: parent.yesIsDestructive
|
|
|
|
onClicked: parent.accepted()
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: noButton
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
right: parent.right
|
|
|
|
rightMargin: Style.margin
|
|
|
|
}
|
|
|
|
|
|
|
|
onClicked: parent.rejected();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|