status-desktop/ui/app/AppLayouts/Chat/ChatColumn
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
..
ChatComponents chore: run translation scripts 2021-02-18 15:23:58 -05:00
MessageComponents fix(Chat): disable HoverHandler when profile popup or context menu are open 2021-03-23 10:32:31 -04:00
samples feat: Un/install free sticker packs in sticker market 2020-07-15 15:53:48 -04:00
ChatMessages.qml feat: see stickers details when clicking on a sticker 2021-03-16 15:39:52 -04:00
EmptyChat.qml Fixed onboarding view backgroud image issue on dark mode. Fixes #1965 2021-03-04 17:17:29 -05:00
Message.qml fix: fix community not being passed correctly to the invite bubble 2021-03-17 16:09:23 -04:00
SuggestionBox.qml Fixed not showing issue for the profile thumbnail in the suggestion list. Fixes #1916 2021-03-04 17:34:01 -05:00
SuggestionFilter.qml feat: highlite mentions in the chat input as well 2021-03-22 15:49:21 -04:00
TopBar.qml refactor: make use of StatusContextMenuButton 2021-03-18 10:03:08 +01:00
qmldir feat: refactor Message and add Compact message type 2020-07-16 10:29:29 -04:00