patch to DWM system

This commit is contained in:
Rafael 2016-11-01 18:49:44 +01:00
parent cbc0274bb7
commit 70043be5f2
3 changed files with 5 additions and 5 deletions

View File

@ -109,16 +109,15 @@ void PictureDialog::addPreviousNextButtons()
backAction->setToolTip(""); backAction->setToolTip("");
nextAction->setToolTip(""); nextAction->setToolTip("");
ui->jsonFrame->setStyleSheet(QString("QFrame { background: %1; }").arg(palette.window().color().name())); ui->jsonFrame->setStyleSheet(QString("QFrame { background: %1; }").arg(palette.window().color().name()));
stylize();
#endif #endif
#endif #endif
} }
void PictureDialog::stylize() void PictureDialog::stylizeDialog()
{ {
if (QtWin::isCompositionEnabled()) if (QtWin::isCompositionEnabled())
{ {
QtWin::extendFrameIntoClientArea(this, 0, this->layout()->menuBar()->height() - 2, 0, 0); QtWin::extendFrameIntoClientArea(this, 0, this->layout()->menuBar()->height(), 0, 0);
setAttribute(Qt::WA_TranslucentBackground, true); setAttribute(Qt::WA_TranslucentBackground, true);
setAttribute(Qt::WA_NoSystemBackground, false); setAttribute(Qt::WA_NoSystemBackground, false);
setStyleSheet("PictureDialog { background: transparent; }"); setStyleSheet("PictureDialog { background: transparent; }");
@ -137,7 +136,7 @@ bool PictureDialog::event(QEvent *event)
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
if (event->type() == QWinEvent::CompositionChange || event->type() == QWinEvent::ColorizationChange) if (event->type() == QWinEvent::CompositionChange || event->type() == QWinEvent::ColorizationChange)
{ {
stylize(); stylizeDialog();
} }
#endif #endif
#endif #endif

View File

@ -44,6 +44,7 @@ public:
void setSnapmaticPicture(SnapmaticPicture *picture, int index); void setSnapmaticPicture(SnapmaticPicture *picture, int index);
void setSnapmaticPicture(SnapmaticPicture *picture); void setSnapmaticPicture(SnapmaticPicture *picture);
void addPreviousNextButtons(); void addPreviousNextButtons();
void stylizeDialog();
bool isIndexed(); bool isIndexed();
int getIndex(); int getIndex();
~PictureDialog(); ~PictureDialog();
@ -63,7 +64,6 @@ private slots:
void exportCustomContextMenuRequestedPrivate(const QPoint &pos, bool fullscreen); void exportCustomContextMenuRequestedPrivate(const QPoint &pos, bool fullscreen);
void nextPictureRequestedSlot(); void nextPictureRequestedSlot();
void previousPictureRequestedSlot(); void previousPictureRequestedSlot();
void stylize();
signals: signals:
void nextPictureRequested(); void nextPictureRequested();

View File

@ -115,6 +115,7 @@ void SnapmaticWidget::on_cmdView_clicked()
// show picture dialog // show picture dialog
picDialog->show(); picDialog->show();
picDialog->stylizeDialog();
picDialog->setMinimumSize(picDialog->size()); picDialog->setMinimumSize(picDialog->size());
picDialog->setMaximumSize(picDialog->size()); picDialog->setMaximumSize(picDialog->size());
picDialog->exec(); picDialog->exec();