Commit 625c35eb authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Merge branch '2104'

parents e677e91a 263d2657
Pipeline #56897 passed with stage
in 10 minutes and 51 seconds
......@@ -3008,7 +3008,10 @@ void Bin::doDisplayMessage(const QString &text, KMessageWidget::MessageType type
void Bin::refreshClip(const QString &id)
{
if (m_monitor->activeClipId() == id) {
m_monitor->refreshMonitorIfActive();
if (pCore->monitorManager()->clipMonitorVisible()) {
m_monitor->slotActivateMonitor();
}
m_monitor->refreshMonitorIfActive(true);
}
}
......
......@@ -611,8 +611,10 @@ void Core::refreshProjectItem(const ObjectId &id)
}
break;
case ObjectType::BinClip:
m_monitorManager->activateMonitor(Kdenlive::ClipMonitor);
m_monitorManager->refreshClipMonitor();
if (m_monitorManager->clipMonitorVisible()) {
m_monitorManager->activateMonitor(Kdenlive::ClipMonitor);
m_monitorManager->refreshClipMonitor(true);
}
if (m_monitorManager->projectMonitorVisible() && m_mainWindow->getCurrentTimeline()->controller()->refreshIfVisible(id.second)) {
m_monitorManager->refreshTimer.start();
}
......
......@@ -117,9 +117,9 @@ void MonitorManager::refreshProjectMonitor()
m_projectMonitor->refreshMonitorIfActive();
}
void MonitorManager::refreshClipMonitor()
void MonitorManager::refreshClipMonitor(bool directUpdate)
{
m_clipMonitor->refreshMonitorIfActive();
m_clipMonitor->refreshMonitorIfActive(directUpdate);
}
void MonitorManager::forceProjectMonitorRefresh()
......@@ -132,6 +132,11 @@ bool MonitorManager::projectMonitorVisible() const
return (m_projectMonitor->monitorIsFullScreen() || (m_projectMonitor->isVisible() && !m_projectMonitor->visibleRegion().isEmpty()));
}
bool MonitorManager::clipMonitorVisible() const
{
return (m_clipMonitor->monitorIsFullScreen() || (m_clipMonitor->isVisible() && !m_clipMonitor->visibleRegion().isEmpty()));
}
bool MonitorManager::activateMonitor(Kdenlive::MonitorId name)
{
if ((m_activeMonitor != nullptr) && m_activeMonitor->id() == name) {
......
......@@ -70,6 +70,8 @@ public:
bool isMultiTrack() const;
/** @brief Returns true if the project monitor is visible (and not tabbed under another dock. */
bool projectMonitorVisible() const;
/** @brief Returns true if the clip monitor is visible (and not tabbed under another dock. */
bool clipMonitorVisible() const;
QTimer refreshTimer;
static const double speedArray[5];
......@@ -98,7 +100,7 @@ public slots:
void refreshProjectMonitor();
/** @brief Refresh project monitor if the timeline cursor is inside the range. */
void refreshProjectRange(QPair<int, int>range);
void refreshClipMonitor();
void refreshClipMonitor(bool directUpdate = false);
/** @brief Switch current monitor to fullscreen. */
void slotSwitchFullscreen();
......
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