Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR #6289: FIX(client, ui): fix text selection in chat log
In v1.4, the logic surrounding when entries in the chat log are put in their own text frame was changed, introducing a bug where elements such as lists would not be terminated correctly (#4491). The fix for this issue was to put every chat log entry into its own text frame, but Qt inserts a blank line between adjacent frames resulting in too much space between subsequent chat entries. There is no convenient Qt API (as far as I know) to disable this behaviour, so my second attempt to resolve this (PR #5820) set the font size to near zero for the blank lines between entries. This worked on Linux, but broke on (at least) Windows (#5886). PR #5927 fixed the issue by calling `setVisible(false)` on the blank lines instead of changing the font size, but this introduced a regression to text selection in the chat log (#6045). This PR deals with the empty lines between entries by setting their *line height* to zero using a call to `setLineHeight(0, QTextBlockFormat::FixedHeight)`. https://doc.qt.io/qt-5/qtextblockformat.html#LineHeightTypes-enum According to the Qt documentation, this method allows setting a fixed line height in pixels. Based on my testing on Linux, this solves the problem without introducing any new regressions. This should still be tested on Windows before v1.5, just in case. Fixes #6045
- Loading branch information