Combination of maximumLineCount and TruncationMode.Elide (or Fade)
breaks Emoji image alignment, pushing the image down. Explicitly
truncating the text fixes the problem, at expense of certain runtime
overhead.
Also, toggle full and truncated Web page preview on tap.
1. Store and handle message ids as numbers rather than variants/strings
2. Incrementally update message id map
3. Expose additional roles and properties to avoid unnecessary lookups
The crash was happening when Repeater was adding context menu items
instantiated by PollPreview to context menu owned by MessageListViewItem.
It's fixed by instantiating those extra menu items inside context menu
itself. Generic ListElement couldn't be used because it doesn't like
functions as property values, hence this NamedAction thing.
there are still a few areas where there's no press effect (message items themselves: Text, profile thumbnail, sent icon,…)
but for now I've just aligned the components to the image changes
MouseArea filling the image was eating mouse events which should be
handled by the list item. Handle them all at the list item level and
forward the "clicked" event to the extra content items which declare
the clicked() function.
https://doc.qt.io/archives/qt-5.6/qtquick-performance.html
In general, "property var" should be considered to be superior to "property variant" for every use-case from QtQuick 2.0 and newer (note that "property variant" is marked as obsolete), as it allows a true JavaScript reference to be stored (which can reduce the number of conversions required in certain expressions).