1
0
Fork 0
flightgear/src/GUI/qml/YesNoPanel.qml

55 lines
1.1 KiB
QML
Raw Normal View History

import QtQuick 2.0
2018-04-25 15:24:14 +00:00
import "."
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()
2018-06-28 10:43:40 +00:00
StyledText {
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();
}
}