From 7bfaced66b2fba16839e73d6abf74ab11836a7b7 Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 20 Jul 2020 12:40:38 -0400 Subject: [PATCH] Fix event list + composer double context menu Don't also Aopen the composer's context menu when there are highlighted or selected messages in the timeline and user presses the menu key. --- src/gui/Base/HTextArea.qml | 3 ++- src/gui/Pages/Chat/Composer/MessageArea.qml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/Base/HTextArea.qml b/src/gui/Base/HTextArea.qml index 9bc77cf2..6ac93cb0 100644 --- a/src/gui/Base/HTextArea.qml +++ b/src/gui/Base/HTextArea.qml @@ -16,6 +16,7 @@ TextArea { property bool bordered: true property var focusItemOnTab: null + property bool menuKeySpawnsMenu: true property var disabledText: null property var defaultText: null // XXX test me readonly property bool changed: text !== (defaultText || "") @@ -108,7 +109,7 @@ TextArea { } } - Keys.onMenuPressed: contextMenu.spawn(false) + Keys.onMenuPressed: if (menuKeySpawnsMenu) contextMenu.spawn(false) // Prevent leaking arrow presses to parent elements when the carret is at // the beginning or end of the text diff --git a/src/gui/Pages/Chat/Composer/MessageArea.qml b/src/gui/Pages/Chat/Composer/MessageArea.qml index a319455e..08fada08 100644 --- a/src/gui/Pages/Chat/Composer/MessageArea.qml +++ b/src/gui/Pages/Chat/Composer/MessageArea.qml @@ -95,6 +95,8 @@ HTextArea { disabledText: qsTr("You do not have permission to post in this room") placeholderText: qsTr("Type a message...") enableCustomImagePaste: true + menuKeySpawnsMenu: + ! (eventList && (eventList.currentItem || eventList.selectedCount)) backgroundColor: "transparent" focusedBorderColor: "transparent"