Load chat background from embedded resources
This commit is contained in:
1 parent
3e4d5d235f
commit
abdca1acc7
2 files changed
+3
-3
No files matched your search
@@ -6,7 +6,6 @@
|
||||
#include <QPainter>
|
||||
#include <QClipboard>
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QMouseEvent>
|
||||
#include <QKeyEvent>
|
||||
#include <QScrollBar>
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in new issue
Block a user