Use Instantiator for RoomList AtIndex keybinds

Instantiator is better suited to the task: Repeater is specially
made to load visual components, and that forced us to wrap the
HShortcuts inside empty Items.
This commit is contained in:
miruka 2021-04-09 02:23:34 -04:00
parent 66169e641e
commit 806983db93

View File

@ -269,27 +269,21 @@ HListView {
onActivated: cycleUnreadRooms(true, true) && showItemLimiter.restart() onActivated: cycleUnreadRooms(true, true) && showItemLimiter.restart()
} }
Repeater { Instantiator {
model: Object.keys(window.settings.Keys.Accounts.AtIndex) model: Object.keys(window.settings.Keys.Accounts.AtIndex)
delegate: HShortcut {
Item {
HShortcut {
sequences: window.settings.Keys.Accounts.AtIndex[modelData] sequences: window.settings.Keys.Accounts.AtIndex[modelData]
onActivated: goToAccountNumber(parseInt(modelData, 10) - 1) onActivated: goToAccountNumber(parseInt(modelData, 10) - 1)
} }
} }
}
Repeater { Instantiator {
model: Object.keys(window.settings.Keys.Rooms.AtIndex) model: Object.keys(window.settings.Keys.Rooms.AtIndex)
delegate: HShortcut {
Item {
HShortcut {
sequences: window.settings.Keys.Rooms.AtIndex[modelData] sequences: window.settings.Keys.Rooms.AtIndex[modelData]
onActivated: showAccountRoomAtIndex(parseInt(modelData, 10) - 1) onActivated: showAccountRoomAtIndex(parseInt(modelData, 10) - 1)
} }
} }
}
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent