This fixes some odd UX where you tap on someone's user in a search or
pinned messages window, but it opens in the NeoChat main window instead.
Fixes#681
(cherry picked from commit 590fba7deb)
Co-authored-by: Joshua Goins <josh@redstrate.com>
Currently the way we show invite notifications is sub-optimal. We did it
during the initial room state load, which meant it shows an invite
notification *every time* you opened NeoChat. This gets annoying very
quickly if you have any pending invitations you don't want to take
action on just yet.
Instead, let's handle this in NotificationsManager directly, and also
remove some scaffolding now that it isn't plumbed through
NeoChatRoom/NeoChatConnection.
(cherry picked from commit d542033125)
Co-authored-by: Joshua Goins <josh@redstrate.com>
Set the progress the download action only when the currentProgressInfo
changed, otherwise we sometimes end up in a data race.
(cherry picked from commit 2a9c75e24f)
The api of RoomManager.viewEventMenu changed and now require also
passing the author.
(cherry picked from commit 7231662f94)
Co-authored-by: Carl Schwan <carl.schwan@gnupg.com>
Currently it uses applicationWindow().overlay which works but is
not ideal for multiple reasons:
- This as a tendency to breaks unexpectedly
- It can't be optimized by the qml compiler
So we are trying to move away from these construct everywhere.
(cherry picked from commit f14dfc5de8)
Co-authored-by: Carl Schwan <carl.schwan@gnupg.com>
This sets the parent to the overlay, which makes sure it's actually
centered even when the right sidebar is opened.
(cherry picked from commit a456b10420)
Co-authored-by: Joshua Goins <josh@redstrate.com>
Some clients - such as Element - can send colored text through <span>,
which fails to display in Qt's rich text parser. So we need to transform
that into CSS styles which is supported by Qt.
Notably this allows you to exchange rainbow shrugs through Matrix, which
is really important. And this means colored backgrounds for text is
supported too, I guess.
(cherry picked from commit 843da2664f)
https://invent.kde.org/network/neochat/-/merge_requests/2005 changed the custom emoji height (whose default is 32 on every Matrix client) to match font height (on my machine it becomes 17, my font is 12pt).
It makes emojis unreadable on non-HiDPI resolutions (1366x768, 1920x1080), and even in the MR itself you can see how much detail is lost. This is compounded by some other rendering bug where the emoji image becomes very jagged when downscaled.
That MR however was correct in that:
* we want custom emojis to have a different size than unicode emojis
* we want custom emojis to be centered according to the text (to make better use of line spacing/paddings)
* we don't want the line height to be changed (too much) by custom emojis
* we (probably) want custom emojis to be _displayed_ proportionally to the text
I'm investigating ways to solve this issue. It seems other Matrix clients (and even chat applications like Telegram or Discord) all globally suffer from this issue and have dealt with it in different ways, sometimes masquerading it and sometimes working around it.
For now though, we shouldn't break emoji legibility for our users. Affecting line height by a few pt is a minor issue compared to being almost unable to tell what inline emoji you or your interlocutor is using. Even just the "center emoji with text" thing already makes the line height issue 1/3 less of a problem. Once we improve the emoji rendering so it's more readable, _then_ it would make sense to decrease the emoji height to something like font.height * 1.6 or so.
This does not affect unicode emojis, as far as I can tell those are handled elsewhere. This only affects inline custom emojis.
Illegible on 1366x768 with 100% scaling and font size 11:
{width=1025 height=576}

Legible:


(cherry picked from commit 29820e2ab2)
3cea53f5 Don't set emoji size to font size
Co-authored-by: Thiago Sueto <herzenschein@gmail.com>
ECM recently started adding -fhardened, which makes us crash here since we're doing things that aren't valid, but happened to work out fine previously.