1
0

add simple internal notification popup,

refactor MessageDialog
This commit is contained in:
Sander van Grieken
2022-03-30 21:08:48 +02:00
parent 6cf4fc9e1e
commit 64745ece10
3 changed files with 124 additions and 55 deletions

View File

@@ -169,62 +169,13 @@ ApplicationWindow
property alias messageDialog: _messageDialog
Component {
id: _messageDialog
Dialog {
id: dialog
title: qsTr("Message")
MessageDialog {}
}
property bool yesno: false
property alias text: message.text
signal yesClicked
signal noClicked
parent: Overlay.overlay
modal: true
x: (parent.width - width) / 2
y: (parent.height - height) / 2
Overlay.modal: Rectangle {
color: "#aa000000"
}
ColumnLayout {
TextArea {
id: message
Layout.preferredWidth: Overlay.overlay.width *2/3
readOnly: true
wrapMode: TextInput.WordWrap
//textFormat: TextEdit.RichText // existing translations not richtext yet
background: Rectangle {
color: 'transparent'
}
}
RowLayout {
Layout.alignment: Qt.AlignHCenter
Button {
text: qsTr('Ok')
visible: !yesno
onClicked: dialog.close()
}
Button {
text: qsTr('Yes')
visible: yesno
onClicked: {
yesClicked()
dialog.close()
}
}
Button {
text: qsTr('No')
visible: yesno
onClicked: {
noClicked()
dialog.close()
}
}
}
}
}
property alias notificationPopup: _notificationPopup
Component {
id: _notificationPopup
NotificationPopup {}
}
Component.onCompleted: {