Code cleaning: remove unnecessary palette

This commit is contained in:
Jakub Melka
2019-12-04 19:18:40 +01:00
parent 5eed274863
commit 99ba0a0c09
3 changed files with 48 additions and 1773 deletions

View File

@ -27,10 +27,17 @@
#include <QFileDialog>
#include <QStandardPaths>
#include <QMessageBox>
#include <QPainter>
namespace pdfviewer
{
constexpr const char* STYLESHEET =
"QPushButton { background-color: #404040; color: #FFFFFF; }"
"QPushButton:disabled { background-color: #404040; color: #000000; }"
"QPushButton:checked { background-color: #808080; color: #FFFFFF; }"
"QWidget#PDFSidebarWidget { background-color: #404040; background: green;}";
PDFSidebarWidget::PDFSidebarWidget(QWidget* parent) :
QWidget(parent),
ui(new Ui::PDFSidebarWidget),
@ -42,6 +49,8 @@ PDFSidebarWidget::PDFSidebarWidget(QWidget* parent) :
{
ui->setupUi(this);
setStyleSheet(STYLESHEET);
// Outline
QIcon bookmarkIcon(":/resources/bookmark.svg");
m_outlineTreeModel = new pdf::PDFOutlineTreeItemModel(qMove(bookmarkIcon), this);
@ -69,7 +78,6 @@ PDFSidebarWidget::PDFSidebarWidget(QWidget* parent) :
m_pageInfo[Thumbnails] = { ui->thumbnailsButton, ui->thumbnailsPage };
m_pageInfo[Attachments] = { ui->attachmentsButton, ui->attachmentsPage };
setAutoFillBackground(true);
selectPage(Invalid);
updateButtons();
}
@ -291,4 +299,11 @@ void PDFSidebarWidget::onAttachmentCustomContextMenuRequested(const QPoint& pos)
}
}
void PDFSidebarWidget::paintEvent(QPaintEvent* event)
{
Q_UNUSED(event);
QPainter painter(this);
painter.fillRect(rect(), QColor(64, 64, 64));
}
} // namespace pdfviewer