diff --git a/PictureDialog.cpp b/PictureDialog.cpp index 02d481e..98a2fb8 100755 --- a/PictureDialog.cpp +++ b/PictureDialog.cpp @@ -27,6 +27,12 @@ #include "PictureCopy.h" #include "UiModLabel.h" +#ifdef GTA5SYNC_WIN +#if QT_VERSION >= 0x050000 +#include +#endif +#endif + #include #include #include @@ -37,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -88,6 +95,41 @@ PictureDialog::~PictureDialog() delete ui; } +void PictureDialog::addPreviousNextButtons() +{ + // Windows Vista additions +#ifdef GTA5SYNC_WIN +#if QT_VERSION >= 0x050000 + if (QtWin::isCompositionEnabled()) + { + QPalette palette; + QToolBar *uiToolbar = new QToolBar("Picture Toolbar", this); + layout()->setMenuBar(uiToolbar); + QAction *backAction = uiToolbar->addAction("<-", this, SLOT(previousPictureRequestedSlot())); + QAction *nextAction = uiToolbar->addAction("->", this, SLOT(nextPictureRequestedSlot())); + backAction->setToolTip(""); + nextAction->setToolTip(""); + + QtWin::extendFrameIntoClientArea(this, 0, uiToolbar->height(), 0, 0); + setAttribute(Qt::WA_TranslucentBackground, true); + setAttribute(Qt::WA_NoSystemBackground, false); + setStyleSheet("PictureDialog { background: transparent; }"); + ui->jsonFrame->setStyleSheet(QString("QFrame { background: %1; }").arg(palette.window().color().name())); + } +#endif +#endif +} + +void PictureDialog::nextPictureRequestedSlot() +{ + emit nextPictureRequested(); +} + +void PictureDialog::previousPictureRequestedSlot() +{ + emit previousPictureRequested(); +} + bool PictureDialog::eventFilter(QObject *obj, QEvent *ev) { bool returnValue = false; diff --git a/PictureDialog.h b/PictureDialog.h index 8ae39e9..083c462 100755 --- a/PictureDialog.h +++ b/PictureDialog.h @@ -43,6 +43,7 @@ public: void setSnapmaticPicture(SnapmaticPicture *picture, bool readOk); void setSnapmaticPicture(SnapmaticPicture *picture, int index); void setSnapmaticPicture(SnapmaticPicture *picture); + void addPreviousNextButtons(); bool isIndexed(); int getIndex(); ~PictureDialog(); @@ -60,6 +61,8 @@ private slots: void on_labPicture_mouseDoubleClicked(Qt::MouseButton button); void on_labPicture_customContextMenuRequested(const QPoint &pos); void exportCustomContextMenuRequestedPrivate(const QPoint &pos, bool fullscreen); + void nextPictureRequestedSlot(); + void previousPictureRequestedSlot(); signals: void nextPictureRequested(); diff --git a/PictureDialog.ui b/PictureDialog.ui index 16fe60f..54c5894 100755 --- a/PictureDialog.ui +++ b/PictureDialog.ui @@ -14,6 +14,9 @@ %1 - Snapmatic Picture Viewer + + 0 + 0 @@ -57,100 +60,119 @@ 0 + + 0 + - 4 + 0 - 4 + 0 - 4 + 0 - 4 + 0 - - - - 0 - 0 - + + + 4 - - <span style=" font-weight:600;">Title: </span>%6<br/> + + 10 + + + 4 + + + 4 + + + + + + 0 + 0 + + + + <span style=" font-weight:600;">Title: </span>%6<br/> <span style=" font-weight:600;">Location: </span>%7 (%1, %2, %3)<br/> <span style=" font-weight:600;">Players: </span>%4 (Crew %5)<br/> <span style=" font-weight:600;">Created: </span>%8 - - - true - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - 5 - - - 5 - - - - - Qt::Vertical - - QSizePolicy::Expanding + + true - - - 0 - 0 - + + true - + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + - + + + 5 + + + 5 + - - - Qt::NoFocus + + + Qt::Vertical - - Export picture + + QSizePolicy::Expanding - - &Export + + + 0 + 0 + - - false - - + - - - Qt::NoFocus - - - Close - - - &Close - - - false - - + + + + + Qt::NoFocus + + + Export picture + + + &Export + + + false + + + + + + + Qt::NoFocus + + + Close + + + &Close + + + false + + + + diff --git a/SnapmaticWidget.cpp b/SnapmaticWidget.cpp index 8539b8f..44a498f 100755 --- a/SnapmaticWidget.cpp +++ b/SnapmaticWidget.cpp @@ -110,6 +110,9 @@ void SnapmaticWidget::on_cmdView_clicked() QObject::connect(picDialog, SIGNAL(nextPictureRequested()), this, SLOT(dialogNextPictureRequested())); QObject::connect(picDialog, SIGNAL(previousPictureRequested()), this, SLOT(dialogPreviousPictureRequested())); + // add previous next buttons + picDialog->addPreviousNextButtons(); + // show picture dialog picDialog->show(); picDialog->setMinimumSize(picDialog->size()); diff --git a/gta5sync.pro b/gta5sync.pro index 45c38ec..7706eb5 100755 --- a/gta5sync.pro +++ b/gta5sync.pro @@ -19,6 +19,7 @@ QT += core gui network greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +greaterThan(QT_MAJOR_VERSION, 4): win32: QT += winextras DEPLOYMENT.display_name = gta5sync TARGET = gta5sync