Add "Inspect Room Data" button in the room sidebar

I find myself doing the same routine: I want to inspect a room's state,
so I have to go hunting for the Developer Tools button. And then I have
to do a few clicks to even get the correct room, what a waste of time!

So I added a new button to the sidebar to open the Developer Tools for
the current room.
This commit is contained in:
Joshua Goins
2025-10-27 16:11:30 -04:00
parent 7444d68280
commit 07fb3160eb
2 changed files with 20 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ Kirigami.ScrollablePage {
property NeoChatRoom room
required property NeoChatConnection connection
property alias currentTabIndex: tabBar.currentIndex
title: i18nc("@title", "Developer Tools")

View File

@@ -166,6 +166,25 @@ QQC2.ScrollView {
}
}
Delegates.RoundedItemDelegate {
text: i18nc("@action:inmenu", "Inspect Room Data")
icon.name: "tools"
visible: NeoChatConfig.developerTools
activeFocusOnTab: true
Layout.fillWidth: true
onClicked: ((QQC2.ApplicationWindow.window as Kirigami.ApplicationWindow).pageStack as Kirigami.PageRow).pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'DevtoolsPage'), {
connection: root.room.connection,
currentTabIndex: 1, // Room data tab
room: root.room
}, {
title: i18nc("@title:window", "Developer Tools"),
width: Kirigami.Units.gridUnit * 50,
height: Kirigami.Units.gridUnit * 42
})
}
Delegates.RoundedItemDelegate {
id: leaveButton
icon.name: "arrow-left-symbolic"