diff --git a/YACReaderLibrary/comic_vine/sort_volume_comics.cpp b/YACReaderLibrary/comic_vine/sort_volume_comics.cpp index 699ee7c2..282500a0 100644 --- a/YACReaderLibrary/comic_vine/sort_volume_comics.cpp +++ b/YACReaderLibrary/comic_vine/sort_volume_comics.cpp @@ -19,8 +19,15 @@ SortVolumeComics::SortVolumeComics(QWidget *parent) : QLabel * sortLabel = new QLabel(tr("sort comic info to match your comic files")); sortLabel->setStyleSheet(labelStylesheet); - moveUpButton = new QPushButton; - moveDownButton = new QPushButton; + + moveUpButtonCL = new ScrapperToolButton(ScrapperToolButton::LEFT); + moveUpButtonCL->setIcon(QIcon(":/images/comic_vine/rowUp.png")); + moveDownButtonCL = new ScrapperToolButton(ScrapperToolButton::RIGHT); + moveDownButtonCL->setIcon(QIcon(":/images/comic_vine/rowDown.png")); + moveUpButtonIL = new ScrapperToolButton(ScrapperToolButton::LEFT); + moveUpButtonIL->setIcon(QIcon(":/images/comic_vine/rowUp.png")); + moveDownButtonIL = new ScrapperToolButton(ScrapperToolButton::RIGHT); + moveDownButtonIL->setIcon(QIcon(":/images/comic_vine/rowDown.png")); QVBoxLayout * l = new QVBoxLayout; QHBoxLayout * content = new QHBoxLayout; @@ -41,10 +48,16 @@ SortVolumeComics::SortVolumeComics(QWidget *parent) : connect(tableVolumeComics, SIGNAL(pressed(QModelIndex)), tableFiles, SLOT(setCurrentIndex(QModelIndex))); connect(tableFiles, SIGNAL(pressed(QModelIndex)), tableVolumeComics, SLOT(setCurrentIndex(QModelIndex))); + sortButtonsLayout->addWidget(moveUpButtonCL); + sortButtonsLayout->addWidget(ScrapperToolButton::getSeparator()); + sortButtonsLayout->addWidget(moveDownButtonCL); sortButtonsLayout->addStretch(); sortButtonsLayout->addWidget(sortLabel); - sortButtonsLayout->addWidget(moveUpButton); - sortButtonsLayout->addWidget(moveDownButton); + sortButtonsLayout->addStretch(); + sortButtonsLayout->addWidget(moveUpButtonIL); + sortButtonsLayout->addWidget(ScrapperToolButton::getSeparator()); + sortButtonsLayout->addWidget(moveDownButtonIL); + sortButtonsLayout->setSpacing(0); l->addSpacing(15); l->addWidget(label); diff --git a/YACReaderLibrary/comic_vine/sort_volume_comics.h b/YACReaderLibrary/comic_vine/sort_volume_comics.h index ce85a66e..6b6a3e2d 100644 --- a/YACReaderLibrary/comic_vine/sort_volume_comics.h +++ b/YACReaderLibrary/comic_vine/sort_volume_comics.h @@ -3,14 +3,58 @@ #include #include +#include +#include #include "comic_db.h" class ScraperTableView; -class QPushButton; class LocalComicListModel; class VolumeComicsModel; +class ScrapperToolButton : public QPushButton +{ + Q_OBJECT +public: + enum Appearance { + DEFAULT, + LEFT, + RIGHT + }; + + ScrapperToolButton(ScrapperToolButton::Appearance appearance = DEFAULT, QWidget * parent=0):QPushButton(parent),appearance(appearance) { + setStyleSheet("QPushButton {border: none; background: #2e2e2e; color:white; border-radius:2px;}"); + setFixedSize(18,17); + } + static QWidget * getSeparator(){QWidget * w = new QWidget; w->setFixedWidth(1); w->setStyleSheet("QWidget {background:#282828;}"); return w;} + void setAppearance(ScrapperToolButton::Appearance appearance){this->appearance = appearance;} + virtual ~ScrapperToolButton() {} + + + +protected: + void paintEvent(QPaintEvent * e) + { + QPainter p(this); + + switch (appearance) { + case LEFT: + p.fillRect(16,0,2,18,QColor("#2E2E2E")); + break; + case RIGHT: + p.fillRect(0,0,2,18,QColor("#2E2E2E")); + break; + default: + break; + } + + QPushButton::paintEvent(e); + } + +private: + Appearance appearance; +}; + class SortVolumeComics : public QWidget { Q_OBJECT @@ -32,8 +76,10 @@ private: LocalComicListModel * localComicsModel; VolumeComicsModel * volumeComicsModel; - QPushButton * moveUpButton; - QPushButton * moveDownButton; + ScrapperToolButton * moveUpButtonCL; + ScrapperToolButton * moveDownButtonCL; + ScrapperToolButton * moveUpButtonIL; + ScrapperToolButton * moveDownButtonIL; }; diff --git a/YACReaderLibrary/images.qrc b/YACReaderLibrary/images.qrc index edbe9d02..8f8f0e63 100644 --- a/YACReaderLibrary/images.qrc +++ b/YACReaderLibrary/images.qrc @@ -11,7 +11,7 @@ ../images/notCover.png ../images/edit.png ../images/editIcon.png - ../images/flow1.png + ../images/flow1.png ../images/flow2.png ../images/flow3.png ../images/flow4.png @@ -91,6 +91,9 @@ ../images/getInfo.png ../images/comic_vine/radioChecked.png ../images/comic_vine/radioUnchecked.png + ../images/comic_vine/radioUnchecked.png + ../images/comic_vine/rowDown.png + ../images/comic_vine/rowUp.png ../images/find_folder.png diff --git a/images/comic_vine/rowDown.png b/images/comic_vine/rowDown.png new file mode 100644 index 00000000..c89a816d Binary files /dev/null and b/images/comic_vine/rowDown.png differ diff --git a/images/comic_vine/rowUp.png b/images/comic_vine/rowUp.png new file mode 100644 index 00000000..00c4b548 Binary files /dev/null and b/images/comic_vine/rowUp.png differ