Cockatrice/cockatrice/src/interface/widgets/utility/report_utils.h
Lukas Brübach 66405e966b [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.
2026-11-02 23:22:30 +01:00

44 lines
1.4 KiB
C++

#ifndef REPORT_UTILS_H
#define REPORT_UTILS_H
#include <QFont>
#include <QString>
#include <QtGlobal>
class QTableWidget;
class QTextEdit;
class ServerInfo_Report;
namespace report_utils
{
/** @brief Font for the report chat-log views: the theme's ChatLog role when it
* sets one, otherwise the monospace font these views used before the
* role existed. Shared by the three report surfaces so they cannot
* drift apart. */
QFont reportLogFont();
QString formatReportCategory(const QString &category);
QString formatReportTime(qint64 secondsSinceEpoch);
void fillReportTableRow(QTableWidget *table,
int row,
const ServerInfo_Report &report,
int idColumn,
int timeColumn,
int reportedColumn,
int categoryColumn,
int gameIdColumn,
int statusColumn,
int assignedColumn);
void renderReportDetails(QTextEdit *chatLogEdit,
QTextEdit *commentsEdit,
const ServerInfo_Report &report,
const QString &commentsEmptyText,
const QString &moderatorPrefix,
const QString &nonModeratorPrefix);
} // namespace report_utils
#endif // REPORT_UTILS_H