HLabeledTextField → extensible HLabeledItem

This commit is contained in:
miruka
2020-06-02 20:14:55 -04:00
parent fdaf7089ab
commit e676473f82
11 changed files with 158 additions and 102 deletions

View File

@@ -23,7 +23,7 @@ BoxPopup {
okText: qsTr("Remove")
// box.focusButton: "ok"
onOpened: reasonField.field.forceActiveFocus()
onOpened: reasonField.item.forceActiveFocus()
onOk: {
const idsForSender = {} // {senderId: [event.id, ...]}
@@ -38,7 +38,7 @@ BoxPopup {
py.callClientCoro(
mainUI.accountIds.includes(senderId) ? senderId : preferUserId,
"room_mass_redact",
[roomId, reasonField.field.text, ...eventClientIds]
[roomId, reasonField.item.text, ...eventClientIds]
)
}
@@ -51,10 +51,14 @@ BoxPopup {
property bool isLast: false
HLabeledTextField {
HLabeledItem {
id: reasonField
label.text: qsTr("Optional reason:")
Layout.fillWidth: true
HTextField {
width: parent.width
}
}
}

View File

@@ -24,12 +24,12 @@ BoxPopup {
qsTr("Ban")
onOpened: reasonField.field.forceActiveFocus()
onOpened: reasonField.item.forceActiveFocus()
onOk: py.callClientCoro(
userId,
operation === RemoveMemberPopup.Operation.Ban ?
"room_ban" : "room_kick",
[roomId, targetUserId, reasonField.field.text || null],
[roomId, targetUserId, reasonField.item.text || null],
)
@@ -45,10 +45,14 @@ BoxPopup {
utils.coloredNameHtml(targetDisplayName, targetUserId)
HLabeledTextField {
HLabeledItem {
id: reasonField
label.text: qsTr("Optional reason:")
Layout.fillWidth: true
HTextField {
width: parent.width
}
}
}