Make the SpaceDrawer navigable with the keyboard.

(cherry picked from commit 624b1b06c5)
This commit is contained in:
James Graham
2024-04-22 18:18:15 +02:00
committed by Tobias Fella
parent 714ea8413c
commit 3967b27352
3 changed files with 258 additions and 245 deletions

View File

@@ -91,7 +91,6 @@ RowLayout {
Layout.preferredWidth: root.desiredWidth ? root.desiredWidth - menuButton.width - root.spacing : -1
visible: !root.collapsed
onTextChanged: root.textChanged(text)
KeyNavigation.tab: treeView
}
QQC2.ToolButton {

View File

@@ -21,11 +21,11 @@ QQC2.Control {
topPadding: 0
bottomPadding: 0
contentItem: Loader {
id: sidebarColumn
z: 0
onActiveFocusChanged: if (activeFocus) {
notificationsButton.forceActiveFocus();
}
sourceComponent: ColumnLayout {
contentItem: ColumnLayout {
spacing: 0
QQC2.ScrollView {
@@ -60,6 +60,8 @@ QQC2.Control {
source: "notifications"
}
activeFocusOnTab: true
onClicked: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'NotificationsView'), {
connection: root.connection
}, {
@@ -86,6 +88,8 @@ QQC2.Control {
source: "user-home-symbolic"
}
activeFocusOnTab: true
checked: RoomManager.currentSpace.length === 0
onClicked: {
RoomManager.currentSpace = "";
@@ -132,6 +136,8 @@ QQC2.Control {
source: "system-users"
}
activeFocusOnTab: true
checked: RoomManager.currentSpace === "DM"
onClicked: {
RoomManager.currentSpace = "DM";
@@ -184,6 +190,8 @@ QQC2.Control {
text: displayName
source: avatar ? ("image://mxc/" + avatar) : ""
activeFocusOnTab: true
onSelected: {
RoomManager.resolveResource(spaceDelegate.roomId);
RoomManager.currentSpace = spaceDelegate.roomId;
@@ -227,6 +235,8 @@ QQC2.Control {
Layout.preferredHeight: width - Kirigami.Units.smallSpacing
Layout.maximumHeight: width - Kirigami.Units.smallSpacing
activeFocusOnTab: true
visible: SpaceHierarchyCache.recommendedSpaceId.length > 0 && !root.connection.room(SpaceHierarchyCache.recommendedSpaceId) && !SpaceHierarchyCache.recommendedSpaceHidden
text: i18nc("Join <name of a space>", "Join %1", SpaceHierarchyCache.recommendedSpaceDisplayName)
@@ -275,6 +285,9 @@ QQC2.Control {
contentItem: Kirigami.Icon {
source: "list-add"
}
activeFocusOnTab: true
onClicked: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'CreateRoomDialog'), {
connection: root.connection,
isSpace: true,
@@ -286,7 +299,6 @@ QQC2.Control {
}
}
}
}
function createContextMenu(room) {
let context = spaceListContextMenu.createObject(root, {

View File

@@ -46,6 +46,8 @@ RowLayout {
text: i18n("Edit this account")
source: mediaId ? ("image://mxc/" + mediaId) : ""
activeFocusOnTab: true
onClicked: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'AccountEditorPage'), {
connection: root.connection
}, {