Commit 43d8397e authored by Till Theato's avatar Till Theato
Browse files

- Do not save frame in monitorscene when not visible

- Improve switching between monitorscene and normal monitor

svn path=/trunk/kdenlive/; revision=4740
parent 28b39a2d
......@@ -164,7 +164,8 @@ GeometryWidget::~GeometryWidget()
delete m_timeline;
m_scene->removeItem(m_rect);
delete m_geometry;
if (m_monitor) m_monitor->slotEffectScene(false);
if (m_monitor)
m_monitor->slotEffectScene(false);
}
void GeometryWidget::updateTimecodeFormat()
......
......@@ -849,8 +849,10 @@ void Monitor::slotEffectScene(bool show)
m_monitorRefresh->setVisible(!show);
#endif
m_effectView->setVisible(show);
if (show)
m_effectScene->slotUpdateBackground(true);
if (show) {
render->doRefresh();
m_effectScene->slotZoomFit();
}
}
}
......
......@@ -73,8 +73,6 @@ void MonitorScene::setUp()
m_view = NULL;
m_view->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
slotUpdateBackground(true);
}
void MonitorScene::resetProfile()
......@@ -88,13 +86,11 @@ void MonitorScene::setEnabled(bool enabled)
m_enabled = enabled;
}
void MonitorScene::slotUpdateBackground(bool fit)
void MonitorScene::slotUpdateBackground()
{
if (m_view && m_view->isVisible()) {
if (m_lastUpdate.elapsed() > 200) {
m_background->setPixmap(QPixmap::fromImage(m_backgroundImage, Qt::ThresholdDither));
if (fit)
slotZoomFit();
m_lastUpdate.start();
}
}
......@@ -107,8 +103,10 @@ void MonitorScene::slotSetDirectUpdate(bool directUpdate)
void MonitorScene::slotSetBackgroundImage(const QImage &image)
{
m_backgroundImage = image;
slotUpdateBackground();
if (m_view && m_view->isVisible()) {
m_backgroundImage = image;
slotUpdateBackground();
}
}
......
......@@ -43,7 +43,7 @@ protected:
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
public slots:
void slotUpdateBackground(bool fit = false);
void slotUpdateBackground();
void slotSetDirectUpdate(bool directUpdate);
void slotZoom(int value);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment