mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
[ChatView] Fix game log first line incorrect background color (#6612)
This commit is contained in:
parent
6ab558dd58
commit
189f3a7bbc
1 changed files with 7 additions and 1 deletions
|
|
@ -75,8 +75,14 @@ void ChatView::adjustColorsToPalette()
|
||||||
void ChatView::refreshBlockColors()
|
void ChatView::refreshBlockColors()
|
||||||
{
|
{
|
||||||
QTextDocument *doc = document();
|
QTextDocument *doc = document();
|
||||||
QTextCursor cursor(doc);
|
|
||||||
|
|
||||||
|
// Empty QTextDocuments still have 1 block, so we need handle this edge case
|
||||||
|
if (doc->isEmpty()) {
|
||||||
|
evenNumber = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTextCursor cursor(doc);
|
||||||
bool even = true; // start fresh
|
bool even = true; // start fresh
|
||||||
|
|
||||||
for (QTextBlock block = doc->begin(); block.isValid(); block = block.next()) {
|
for (QTextBlock block = doc->begin(); block.isValid(); block = block.next()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue