status-desktop/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents
Pascal Precht e1a4a47636 fix(Chat): disable HoverHandler when profile popup or context menu are open
Alright, this is an interesting one:

As described in #1829, when the profile popup is opened within the chat view,
users are still able to click *through* the popup on message, which then puts them in
an active state.

I've done a bunch of debugging as described [here](https://github.com/status-im/status-desktop/issues/1829#issuecomment-804748148) and after doing some
further debugging, I found out that `isMessageActive` isn't really the culprit here.

What causes this effect is the `HoverHandler` that's attached to the `CompactMessage` item.
`HoverHandler` is a standard QML type that emits `hoverChanged` signals so one can do things like
applying hover effects on elements, which is exactly what we do:

```
HoverHandler {
  onHoverChanged: {
    root.isHovered = hovered  // `root` being the message item
  }
}
```

I assume we went with this handler because putting a `MouseArea` in there instead, which fills
the entire message component pretty much eliminates all existing mouse handlers attached to
other child components, such as the profile image or the username of the message, which also
open a message context menu.

It turns out that, having a `HoverHandler` as described above, actually activates it when the
user clicks with the left mouse button as well (not just on hover). That's what causes the "click-through"
effect. This can be verified by setting `acceptedButtons` to `Qt.RightButton`, basically telling
the handler that only right clicks will activate it.

I then tried using `Qt.NoButtons` instead so that no button clicks and only hovers will activate
the handler, but that didn't seem to have any effect at all. It still defaults to `Qt.LeftButton`.

So the last resort was to disable the `HoverHandler` altogether, whenever either the profile popup,
or the message context menu (for emojis etc) is open.

Unfortunately, we don't have access to the profile popup in the compact message component, because it's
detached from the component tree. Therefore, I've introduced a new property `profilePopupOpened` on
the chat layout, which we can read from instead.

Fixes #1829
2021-03-23 10:32:31 -04:00
..
TransactionComponents chore: run translation scripts 2021-02-18 15:23:58 -05:00
AudioPlayer.qml feat: play audio messages 2020-07-30 13:49:50 -04:00
ChannelIdentifier.qml fix: fix channel color in communities 2021-03-03 16:45:23 -05:00
ChatButtons.qml feat: implement new colors for dark mode 2021-02-18 15:24:12 -05:00
ChatImage.qml fix: fix chat height being too high in compact mode 2020-10-02 12:48:02 -04:00
ChatReply.qml make compact mode the default 2021-02-10 15:48:57 -05:00
ChatText.qml feat: intercept clicks on messages links as well 2021-03-03 16:45:23 -05:00
ChatTime.qml fix: fix texts to use secondaryText instead of darkGrey 2021-02-22 09:58:18 -05:00
CompactMessage.qml fix(Chat): disable HoverHandler when profile popup or context menu are open 2021-03-23 10:32:31 -04:00
DateGroup.qml fix: date 2020-07-23 16:00:14 -04:00
EmojiReactions.qml chore: run translation scripts 2021-02-18 15:23:58 -05:00
ImageLoader.qml chore: run translation scripts 2021-02-18 15:23:58 -05:00
InvitationBubble.qml feat: show community invite component on community link 2021-03-17 16:09:23 -04:00
LinksMessage.qml feat: show community invite component on community link 2021-03-17 16:09:23 -04:00
MessageBorder.qml feat: whitelist gifs (no url extension needed) 2020-12-21 14:14:32 -05:00
MessageMouseArea.qml feat: see stickers details when clicking on a sticker 2021-03-16 15:39:52 -04:00
NormalMessage.qml make compact mode the default 2021-02-10 15:48:57 -05:00
RectangleCorner.qml feat: make RectangleCorner a component and show images in compact 2020-07-16 11:49:13 -04:00
Retry.qml feat: allow users to change font size for chat messages 2020-11-25 14:41:29 +01:00
SentMessage.qml feat: show time and sent status on the image itself 2021-01-14 16:02:27 -05:00
StatusUpdate.qml feat: introduce Utils.formatDateTime 2021-01-04 15:16:37 -05:00
Sticker.qml fix: fix scroll going back down when hitting images 2020-12-18 15:39:16 -05:00
TransactionBubble.qml chore: run translation scripts 2021-02-18 15:23:58 -05:00
UserImage.qml Show chat image and username again after a couple of minutes in chat 2021-02-10 13:52:36 -05:00
UsernameLabel.qml chore: run translation scripts 2021-02-18 15:23:58 -05:00
qmldir feat: refactor Message and add Compact message type 2020-07-16 10:29:29 -04:00