From be61a34ec019f1a0cc6902113445bcd022cc10d9 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 20 Dec 2019 10:39:10 -0400 Subject: [PATCH] Event context menu entry to open debug console Replaces the hidden double-click-on-empty-space feature --- src/gui/Base/HMenuItemPopupSpawner.qml | 1 - src/gui/Pages/Chat/Timeline/EventContent.qml | 5 +---- src/gui/Pages/Chat/Timeline/EventDelegate.qml | 7 +++++++ src/icons/thin/debug.svg | 3 +++ 4 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 src/icons/thin/debug.svg diff --git a/src/gui/Base/HMenuItemPopupSpawner.qml b/src/gui/Base/HMenuItemPopupSpawner.qml index 9511daaa..263c2148 100644 --- a/src/gui/Base/HMenuItemPopupSpawner.qml +++ b/src/gui/Base/HMenuItemPopupSpawner.qml @@ -5,7 +5,6 @@ import QtQuick.Controls 2.12 HMenuItem { onTriggered: { - print( parent.parent.parent) menu.focusOnClosed = null utils.makePopup( diff --git a/src/gui/Pages/Chat/Timeline/EventContent.qml b/src/gui/Pages/Chat/Timeline/EventContent.qml index 0dc081ed..5a16563f 100644 --- a/src/gui/Pages/Chat/Timeline/EventContent.qml +++ b/src/gui/Pages/Chat/Timeline/EventContent.qml @@ -46,11 +46,8 @@ HRowLayout { // ~600px max with a 16px font readonly property int maxMessageWidth: theme.fontSize.normal * 0.5 * 75 + readonly property alias debugConsoleLoader: debugConsoleLoader - TapHandler { - enabled: debugMode - onDoubleTapped: debugConsoleLoader.toggle() - } DebugConsoleLoader { id: debugConsoleLoader diff --git a/src/gui/Pages/Chat/Timeline/EventDelegate.qml b/src/gui/Pages/Chat/Timeline/EventDelegate.qml index 5fc18483..833c2501 100644 --- a/src/gui/Pages/Chat/Timeline/EventDelegate.qml +++ b/src/gui/Pages/Chat/Timeline/EventDelegate.qml @@ -170,6 +170,13 @@ HColumnLayout { Clipboard.text = selectableLabelContainer.joinedSelection } + HMenuItem { + icon.name: "debug" + text: qsTr("Debug this event") + visible: debugMode + onTriggered: eventContent.debugConsoleLoader.toggle() + } + HMenuItemPopupSpawner { icon.name: "clear-messages" text: qsTr("Clear messages") diff --git a/src/icons/thin/debug.svg b/src/icons/thin/debug.svg new file mode 100644 index 00000000..4b865a27 --- /dev/null +++ b/src/icons/thin/debug.svg @@ -0,0 +1,3 @@ + + +