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
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
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()
|
|
|
|
|
|
|
|
Text {
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|