PushRuleSettingsPopup: add custom sound field
This commit is contained in:
parent
8b53b4ae11
commit
c46e1eb897
|
@ -1,6 +1,5 @@
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
- sfx selection
|
|
||||||
- custom action
|
- custom action
|
||||||
|
|
||||||
- seen tooltips can't be shown on image hover
|
- seen tooltips can't be shown on image hover
|
||||||
|
|
|
@ -39,11 +39,7 @@ HFlickableColumnPopup {
|
||||||
undefined
|
undefined
|
||||||
|
|
||||||
const actions = []
|
const actions = []
|
||||||
const sfx =
|
const sfx = soundCheck.checked ? soundCombo.editText : false
|
||||||
soundCheck.checked && rule.sound ? rule.sound :
|
|
||||||
soundCheck.checked && rule.rule_id === ".m.rule.call" ? "ring" :
|
|
||||||
soundCheck.checked ? "default":
|
|
||||||
false
|
|
||||||
|
|
||||||
notifyCheck.checked && actions.push("notify")
|
notifyCheck.checked && actions.push("notify")
|
||||||
actions.push({set_tweak: "highlight", value: highlightCheck.checked})
|
actions.push({set_tweak: "highlight", value: highlightCheck.checked})
|
||||||
|
@ -233,12 +229,28 @@ HFlickableColumnPopup {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HFlow {
|
||||||
|
enabled: notifyCheck.checked
|
||||||
|
spacing: theme.spacing / 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
HCheckBox {
|
HCheckBox {
|
||||||
id: soundCheck
|
id: soundCheck
|
||||||
text: qsTr("Play sound")
|
text: qsTr("Play sound: ")
|
||||||
enabled: notifyCheck.checked
|
|
||||||
defaultChecked: root.rule.sound
|
defaultChecked: root.rule.sound
|
||||||
Layout.fillWidth: true
|
height: soundCombo.height
|
||||||
|
}
|
||||||
|
|
||||||
|
HComboBox {
|
||||||
|
id: soundCombo
|
||||||
|
|
||||||
|
readonly property string current: root.rule.sound || "default"
|
||||||
|
|
||||||
|
model: [...new Set(["default", "ring", current])]
|
||||||
|
editText: current
|
||||||
|
currentIndex: model.indexOf(current)
|
||||||
|
editable: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HCheckBox {
|
HCheckBox {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user