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.
This commit is contained in:
miruka 2020-07-20 12:40:38 -04:00
parent e38a4ed408
commit 7bfaced66b
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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"