add new background images to chatlist
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
<file>res/paymentreq.gif</file>
|
||||
<file>res/icon.ico</file>
|
||||
<file>res/mail.png</file>
|
||||
<file>res/darkwing.png</file>
|
||||
<file>res/sdlogo.png</file>
|
||||
<file>res/sdlogo2.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/img">
|
||||
<file>res/hushdlogo.gif</file>
|
||||
|
||||
@@ -123,17 +123,9 @@ void ChatModel::renderChatBox(Ui::MainWindow* ui, QListView *view)
|
||||
Items->setData("Incoming", Qt::UserRole +1);
|
||||
chat->appendRow(Items);
|
||||
|
||||
|
||||
ui->listChat->setResizeMode(QListView::Adjust);
|
||||
ui->listChat->setWordWrap(true);
|
||||
ui->listChat->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
ui->listChat->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
ui->listChat->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
ui->listChat->setModel(chat);
|
||||
ui->listChat->setMinimumSize(200,350);
|
||||
ui->listChat->setModel(chat);
|
||||
ui->listChat->setItemDelegate(new ListViewDelegate());
|
||||
// ui->listChat->setStyleSheet("background-image: url(res/hushdark.png)"); /////Todo set an png as Watermark backgroung in listChat
|
||||
ui->listChat->show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -149,18 +141,11 @@ void ChatModel::renderChatBox(Ui::MainWindow* ui, QListView *view)
|
||||
QStandardItem* Items1 = new QStandardItem(c.second.toChatLine());
|
||||
Items1->setData("Outgoing", Qt::UserRole +1);
|
||||
chat->appendRow(Items1);
|
||||
qDebug()<<Items1->text();
|
||||
}
|
||||
|
||||
ui->listChat->setResizeMode(QListView::Adjust);
|
||||
ui->listChat->setWordWrap(true);
|
||||
ui->listChat->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
ui->listChat->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
ui->listChat->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
ui->listChat->setModel(chat);
|
||||
ui->listChat->setMinimumSize(200,350);
|
||||
ui->listChat->setItemDelegate(new ListViewDelegate());
|
||||
ui->listChat->show();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,27 +3,21 @@
|
||||
#include "mainwindow.h"
|
||||
|
||||
void ContactModel::renderContactList(QListView* view)
|
||||
{
|
||||
{ // QStandardItem(const QIcon & icon, const QString & text)
|
||||
QStandardItemModel* contact = new QStandardItemModel();
|
||||
//}
|
||||
for(auto &c : AddressBook::getInstance()->getAllAddressLabels())
|
||||
{
|
||||
// view->addItem(c.getName());
|
||||
|
||||
|
||||
QStandardItem* Items = new QStandardItem(c.getName());
|
||||
contact->appendRow(Items);
|
||||
// view->setItemDelegate({text: contact})
|
||||
// width: view->width })
|
||||
// height: avatar.implicitHeight,
|
||||
// leftPadding: avatar.implicitWidth + 32})
|
||||
|
||||
// Image {
|
||||
// id: avatar
|
||||
// source: "qrc:/" + modelData.replace(" ", "_") + ".png"
|
||||
// }
|
||||
//}
|
||||
//QStandardItem* Items = new QStandardItem();
|
||||
QStandardItem* Items1 = new QStandardItem(QIcon("res/darkwing.png"),c.getName());
|
||||
// contact->appendRow(Items);
|
||||
contact->appendRow(Items1);
|
||||
view->setModel(contact);
|
||||
view->setIconSize(QSize(80,100));
|
||||
view->setUniformItemSizes(true);
|
||||
view->setDragDropMode(QAbstractItemView::DropOnly);;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -905,6 +905,17 @@ void MainWindow::setupTransactionsTab() {
|
||||
});
|
||||
|
||||
// Set up context menu on transactions tab
|
||||
auto theme = Settings::getInstance()->get_theme_name();
|
||||
if (theme == "dark"){
|
||||
ui->listChat->setStyleSheet("background-image: url(res/sdlogo.png) ;background-attachment: fixed ;background-position: center center ;background-repeat: no-repeat;background-size: cover");
|
||||
}else{ui->listChat->setStyleSheet("background-image: url(res/sdlogo2.png) ;background-attachment: fixed ;background-position: center center ;background-repeat: no-repeat;background-size: cover");}
|
||||
ui->listChat->setResizeMode(QListView::Adjust);
|
||||
ui->listChat->setWordWrap(true);
|
||||
ui->listChat->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
ui->listChat->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
ui->listChat->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
ui->listChat->setMinimumSize(200,350);
|
||||
ui->listChat->show();
|
||||
ui->transactionsTable->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
// Table right click
|
||||
QObject::connect(ui->transactionsTable, &QTableView::customContextMenuRequested, [=] (QPoint pos) {
|
||||
@@ -1014,6 +1025,8 @@ void MainWindow::setupchatTab() {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
ChatMemoEdit::ChatMemoEdit(QWidget* parent) : QPlainTextEdit(parent) {
|
||||
@@ -1066,7 +1079,7 @@ void MainWindow::updateChat()
|
||||
|
||||
void MainWindow::updateContacts()
|
||||
{
|
||||
rpc->refreshContacts(ui->listContactWidget);
|
||||
//rpc->refreshContacts(ui->listContactWidget);
|
||||
}
|
||||
|
||||
void MainWindow::addNewZaddr(bool sapling) {
|
||||
|
||||
Reference in New Issue
Block a user