From abdca1acc75146ffb1aedf8eacafc38b49c0fdb7 Mon Sep 17 00:00:00 2001 From: evgeny Date: Thu, 15 Oct 2026 20:47:51 +0200 Subject: [PATCH] Load chat background from embedded resources --- tools/chatgui/src/chatview.cpp | 4 ++-- tools/chatgui/src/messagelist.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/chatgui/src/chatview.cpp b/tools/chatgui/src/chatview.cpp index 89586a46..4db89063 100644 --- a/tools/chatgui/src/chatview.cpp +++ b/tools/chatgui/src/chatview.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -60,9 +59,10 @@ ChatView::ChatView(QWidget *parent) void ChatView::setBackgroundImage(const QString &path) { if (!m_background.load(path)) { - qWarning() << "ChatView: failed to load background" << path; + GUI_WARN("ChatView: failed to load background path=%s", qPrintable(path)); return; } + GUI_DEBUG("ChatView: background loaded path=%s size=%dx%d", qPrintable(path), m_background.width(), m_background.height()); viewport()->update(); } diff --git a/tools/chatgui/src/messagelist.cpp b/tools/chatgui/src/messagelist.cpp index 73a5a728..c38beea0 100644 --- a/tools/chatgui/src/messagelist.cpp +++ b/tools/chatgui/src/messagelist.cpp @@ -558,7 +558,7 @@ MessageList::MessageList(DbManager* db, AudioRecorder* recorder, QWidget *parent m_view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); m_view->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); m_view->setFrameShape(QFrame::NoFrame); - m_view->setBackgroundImage("../resources/bg.png"); + m_view->setBackgroundImage(QStringLiteral(":/bg.png")); layout->addWidget(m_view, 1); if (s_icons.empty()) {