From 59410e62330ebd04464c3ac989c410188119fdee Mon Sep 17 00:00:00 2001 From: Rtch90 Date: Thu, 18 Dec 2014 15:37:21 +0000 Subject: [PATCH] [Add] Added a remove option for pages. --- bin/hpdf.qrc | 1 + img/remove.png | Bin 0 -> 507 bytes src/pdf_file_widget.cpp | 10 +++++++++- src/pdf_file_widget.h | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 img/remove.png diff --git a/bin/hpdf.qrc b/bin/hpdf.qrc index 6e886bb..e263e67 100644 --- a/bin/hpdf.qrc +++ b/bin/hpdf.qrc @@ -11,5 +11,6 @@ ../img/about.png ../img/collapse.png ../img/expand.png + ../img/remove.png diff --git a/img/remove.png b/img/remove.png new file mode 100644 index 0000000000000000000000000000000000000000..37c52799cb61531994ec9785f0a14f8c03090bfb GIT binary patch literal 507 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLlldscJ{ML*8!M+*K zC+50Wo;wl7F*Eg{$c(ngV*!cPJLJ`r4KLo%nsK%+C+gVm-Y@_E>RX$O@7*abUkLJ? Mr>mdKI;Vst0Gl(;rT_o{ literal 0 HcmV?d00001 diff --git a/src/pdf_file_widget.cpp b/src/pdf_file_widget.cpp index c4a0ded..a09cda7 100644 --- a/src/pdf_file_widget.cpp +++ b/src/pdf_file_widget.cpp @@ -58,12 +58,20 @@ PDFFileWidget::PDFFileWidget(QWidget* parent) :QFrame(parent) { topLayout->addWidget(collapseButton, 0, 0); fileNameLabel = new QLabel(); + fileNameLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); topLayout->addWidget(fileNameLabel, 0, 1); + + removeButton = new QPushButton(); + removeButton->resize(QSize(COLLAPSE_BUTTON_WIDTH, COLLAPSE_BUTTON_HEIGHT)); + removeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + removeButton->setIcon(QIcon(":img/remove.png")); + /*connect(collapseButton, SIGNAL(released()), this, SLOT(collapsedButtonClick()));*/ + topLayout->addWidget(removeButton, 0, 2); pagesContainerWidget = new PagesContainerWidget(); scrollArea = new QScrollArea(); scrollArea->setWidget(pagesContainerWidget); - topLayout->addWidget(scrollArea, 1, 0, 1, 5); + topLayout->addWidget(scrollArea, 1, 0, 1, 3); setLayout(topLayout); diff --git a/src/pdf_file_widget.h b/src/pdf_file_widget.h index 63e2196..0c19ac8 100644 --- a/src/pdf_file_widget.h +++ b/src/pdf_file_widget.h @@ -70,6 +70,7 @@ private: QLabel* fileNameLabel; QPushButton* collapseButton; + QPushButton* removeButton; PagesContainerWidget* pagesContainerWidget; QScrollArea* scrollArea; QWidget* ancestor;