From fa79c9091f289347d59718efe530be615772fcd9 Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Sun, 11 Oct 2009 22:51:49 +0200 Subject: [PATCH] Fixed view crossfade --- src/MainWindow.cpp | 3 ++- src/faderwidget/FaderWidget.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index a195e30..dea39a3 100755 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -391,6 +391,8 @@ void MainWindow::showWidget ( QWidget* widget ) { // toolbar only for the mediaView mainToolBar->setVisible(widget == mediaView && !compactViewAct->isChecked()); + setUpdatesEnabled(true); + history->push(widget); #ifdef Q_WS_MAC @@ -401,7 +403,6 @@ void MainWindow::showWidget ( QWidget* widget ) { views->setCurrentWidget(widget); - setUpdatesEnabled(true); } void MainWindow::fadeInWidget(QWidget *oldWidget, QWidget *newWidget) { diff --git a/src/faderwidget/FaderWidget.cpp b/src/faderwidget/FaderWidget.cpp index aaaa65a..6963a8c 100644 --- a/src/faderwidget/FaderWidget.cpp +++ b/src/faderwidget/FaderWidget.cpp @@ -4,7 +4,7 @@ FaderWidget::FaderWidget(QWidget *parent) : QWidget(parent) { timeLine = new QTimeLine(333, this); - timeLine->setFrameRange(1000, 0); + timeLine->setFrameRange(500, 0); connect(timeLine, SIGNAL(frameChanged(int)), this, SLOT(update())); setAttribute(Qt::WA_DeleteOnClose); resize(parent->size()); @@ -17,10 +17,10 @@ void FaderWidget::start(QPixmap frozenView) { } void FaderWidget::paintEvent(QPaintEvent *) { - const qreal opacity = timeLine->currentFrame() / 1000.; + const qreal opacity = timeLine->currentFrame() / 500.; QPainter painter(this); painter.setOpacity(opacity); - painter.drawPixmap(rect(), frozenView); + painter.drawPixmap(0, 0, frozenView); if (opacity <= 0.) close(); -- 2.39.5