mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-17 10:01:44 +00:00
03d7632f32
- signal for adding notification to the Activity Center introduced and emitted, but that part is not handled within this commit since there are some details needed to be discussed in the PR#5334 - signal for displaying ephemeral app notification is introduced and emitted, but that part is not handled within this commit since we don't have yet ephemeral notificaiton in place. Fixes #4902
72 lines
2.0 KiB
QML
72 lines
2.0 KiB
QML
import QtQuick 2.13
|
|
import QtQuick.Controls 2.13
|
|
|
|
import StatusQ.Controls 0.1
|
|
import StatusQ.Popups 0.1
|
|
|
|
import utils 1.0
|
|
|
|
Item {
|
|
id: root
|
|
|
|
signal sendAlertsClicked()
|
|
signal deliverQuietlyClicked()
|
|
signal turnOffClicked()
|
|
|
|
property string selected: Constants.settingsSection.notifications.sendAlertsValue
|
|
|
|
implicitWidth: button.width
|
|
implicitHeight: button.height
|
|
|
|
QtObject {
|
|
id: d
|
|
readonly property string sendAlertsText: qsTr("Send Alerts")
|
|
readonly property string deliverQuietlyText: qsTr("Deliver Quietly")
|
|
readonly property string turnOffText: qsTr("Turn Off")
|
|
}
|
|
|
|
StatusButton {
|
|
id: button
|
|
text: root.selected === Constants.settingsSection.notifications.turnOffValue? d.turnOffText :
|
|
root.selected === Constants.settingsSection.notifications.deliverQuietlyValue? d.deliverQuietlyText :
|
|
d.sendAlertsText
|
|
icon.name: "chevron-down"
|
|
|
|
onClicked: {
|
|
if (selectMenu.opened) {
|
|
selectMenu.close()
|
|
} else {
|
|
selectMenu.popup(button.x, button.y + button.height + 8)
|
|
}
|
|
}
|
|
}
|
|
|
|
StatusPopupMenu {
|
|
id: selectMenu
|
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
|
width: parent.width
|
|
clip: true
|
|
|
|
StatusMenuItem {
|
|
text: d.sendAlertsText
|
|
onTriggered: {
|
|
root.sendAlertsClicked()
|
|
}
|
|
}
|
|
|
|
StatusMenuItem {
|
|
text: d.deliverQuietlyText
|
|
onTriggered: {
|
|
root.deliverQuietlyClicked()
|
|
}
|
|
}
|
|
|
|
StatusMenuItem {
|
|
text: d.turnOffText
|
|
onTriggered: {
|
|
root.turnOffClicked()
|
|
}
|
|
}
|
|
}
|
|
}
|