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,25 +269,19 @@ HListView {
onActivated: cycleUnreadRooms(true, true) && showItemLimiter.restart()
}
Repeater {
Instantiator {
model: Object.keys(window.settings.Keys.Accounts.AtIndex)
Item {
HShortcut {
sequences: window.settings.Keys.Accounts.AtIndex[modelData]
onActivated: goToAccountNumber(parseInt(modelData, 10) - 1)
}
delegate: HShortcut {
sequences: window.settings.Keys.Accounts.AtIndex[modelData]
onActivated: goToAccountNumber(parseInt(modelData, 10) - 1)
}
}
Repeater {
Instantiator {
model: Object.keys(window.settings.Keys.Rooms.AtIndex)
Item {
HShortcut {
sequences: window.settings.Keys.Rooms.AtIndex[modelData]
onActivated: showAccountRoomAtIndex(parseInt(modelData,10) - 1)
}
delegate: HShortcut {
sequences: window.settings.Keys.Rooms.AtIndex[modelData]
onActivated: showAccountRoomAtIndex(parseInt(modelData, 10) - 1)
}
}