Start keyboard navigation
Now a room can be opened with the keyboard only and be scrolled.
This commit is contained in:
@@ -33,6 +33,7 @@ Kirigami.ScrollablePage {
|
|||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onTextChanged: sortFilterRoomListModel.filterText = text
|
onTextChanged: sortFilterRoomListModel.filterText = text
|
||||||
|
KeyNavigation.tab: listView
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
@@ -79,9 +80,19 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
delegate: Kirigami.AbstractListItem {
|
delegate: Kirigami.AbstractListItem {
|
||||||
|
id: roomListItem
|
||||||
visible: model.categoryVisible
|
visible: model.categoryVisible
|
||||||
topPadding: Kirigami.Units.largeSpacing
|
topPadding: Kirigami.Units.largeSpacing
|
||||||
bottomPadding: Kirigami.Units.largeSpacing
|
bottomPadding: Kirigami.Units.largeSpacing
|
||||||
|
focus: true
|
||||||
|
action: Kirigami.Action {
|
||||||
|
id: enterRoomAction
|
||||||
|
onTriggered: {
|
||||||
|
var roomItem = roomManager.enterRoom(currentRoom)
|
||||||
|
roomListItem.KeyNavigation.right = roomItem
|
||||||
|
roomItem.focus = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
contentItem: Item {
|
contentItem: Item {
|
||||||
implicitHeight: roomLayout.implicitHeight
|
implicitHeight: roomLayout.implicitHeight
|
||||||
@@ -127,6 +138,7 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -39,8 +39,9 @@ Kirigami.ApplicationWindow {
|
|||||||
currentRoom = null;
|
currentRoom = null;
|
||||||
pageStack.removePage(pageStack.lastItem);
|
pageStack.removePage(pageStack.lastItem);
|
||||||
}
|
}
|
||||||
pageStack.push(roomPage, { 'currentRoom': room, });
|
var item = pageStack.push(roomPage, { 'currentRoom': room, });
|
||||||
currentRoom = room;
|
currentRoom = room;
|
||||||
|
return item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user