[Fonts] Keep ChatView on the app font and share the report log font

- ChatLog's unset fallback is qApp->font() again: ChatView never set a font
  before the role existed, so an unset role must not switch chat and the game
  log to monospace at the system GeneralFont size.
- Move the monospace fallback the report dialogs used before into
  report_utils::reportLogFont(), which returns the theme's ChatLog role when it
  is set and the old monospace otherwise. tab_report, dlg_my_reports and
  dlg_report_user now share it, so they cannot drift and they honour a themed
  size instead of overriding it.
This commit is contained in:
Lukas Brübach 2026-11-01 14:06:05 +01:00
parent dfef59ca4e
commit 66405e966b
7 changed files with 42 additions and 38 deletions

View file

@ -7,6 +7,7 @@
#include "libcockatrice/protocol/pb/serverinfo_report.pb.h"
#include <QAbstractItemView>
#include <QFont>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QHeaderView>
@ -125,14 +126,7 @@ DlgMyReports::DlgMyReports(AbstractClient *_client, QWidget *parent)
void DlgMyReports::applyChatLogFont()
{
// Family comes from the ChatLog theme role; size stays caller-side as before.
QFont monoFont = themeManager->appFont(AppFont::ChatLog);
monoFont.setStyleHint(QFont::Monospace);
const int systemPointSize = QFontDatabase::systemFont(QFontDatabase::GeneralFont).pointSize();
if (systemPointSize > 0) {
monoFont.setPointSize(systemPointSize);
}
chatLogEdit->setFont(monoFont);
chatLogEdit->setFont(report_utils::reportLogFont());
}
void DlgMyReports::refreshList()