X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fscopes%2Fabstractscopewidget.cpp;h=4f94ba43297f66a4d6523b622abb09eb1e82cebf;hb=8a6e4eb1dea318ecd1c0b313c28b764e89a524c4;hp=0622bd97d72c0f325a3fc05b1ad50ead09dc6076;hpb=b4fed78d531ebfe19f26d8fb3512690328b4a1a3;p=kdenlive diff --git a/src/scopes/abstractscopewidget.cpp b/src/scopes/abstractscopewidget.cpp index 0622bd97..4f94ba43 100644 --- a/src/scopes/abstractscopewidget.cpp +++ b/src/scopes/abstractscopewidget.cpp @@ -8,18 +8,19 @@ * (at your option) any later version. * ***************************************************************************/ +#include "QtCore/qtconcurrentrun.h" + #include "abstractscopewidget.h" #include "renderer.h" #include "monitor.h" -#include -#include #include #include #include #include #include +#include // Uncomment for Scope debugging. //#define DEBUG_ASW @@ -49,20 +50,24 @@ const QPen AbstractScopeWidget::penBackground(QBrush(dark2), const QString AbstractScopeWidget::directions[] = {"North", "Northeast", "East", "Southeast"}; AbstractScopeWidget::AbstractScopeWidget(bool trackMouse, QWidget *parent) : - QWidget(parent), - m_mousePos(0, 0), - m_mouseWithinWidget(false), - offset(5), - m_accelFactorHUD(1), - m_accelFactorScope(1), - m_accelFactorBackground(1), - m_semaphoreHUD(1), - m_semaphoreScope(1), - m_semaphoreBackground(1), - initialDimensionUpdateDone(false), - m_requestForcedUpdate(false), - m_rescaleMinDist(4), - m_rescaleVerticalThreshold(2.0f) + QWidget(parent) + , m_mousePos(0, 0) + , m_mouseWithinWidget(false) + , offset(5) + , m_accelFactorHUD(1) + , m_accelFactorScope(1) + , m_accelFactorBackground(1) + , m_semaphoreHUD(1) + , m_semaphoreScope(1) + , m_semaphoreBackground(1) + , initialDimensionUpdateDone(false) + , m_requestForcedUpdate(false) + , m_rescaleMinDist(4) + , m_rescaleVerticalThreshold(2.0f) + , m_rescaleActive(false) + , m_rescalePropertiesLocked(false) + , m_rescaleFirstRescaleDone(true) + , m_rescaleDirection(North) { m_scopePalette = QPalette(); @@ -81,7 +86,8 @@ AbstractScopeWidget::AbstractScopeWidget(bool trackMouse, QWidget *parent) : m_aRealtime->setCheckable(true); m_menu = new QMenu(this); - m_menu->setPalette(m_scopePalette); + // Disabled dark palette on menus since it breaks up with some themes: kdenlive issue #2950 + //m_menu->setPalette(m_scopePalette); m_menu->addAction(m_aAutoRefresh); m_menu->addAction(m_aRealtime); @@ -90,9 +96,9 @@ AbstractScopeWidget::AbstractScopeWidget(bool trackMouse, QWidget *parent) : bool b = true; b &= connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint))); - b &= connect(this, SIGNAL(signalHUDRenderingFinished(uint, uint)), this, SLOT(slotHUDRenderingFinished(uint, uint))); - b &= connect(this, SIGNAL(signalScopeRenderingFinished(uint, uint)), this, SLOT(slotScopeRenderingFinished(uint, uint))); - b &= connect(this, SIGNAL(signalBackgroundRenderingFinished(uint, uint)), this, SLOT(slotBackgroundRenderingFinished(uint, uint))); + b &= connect(this, SIGNAL(signalHUDRenderingFinished(uint,uint)), this, SLOT(slotHUDRenderingFinished(uint,uint))); + b &= connect(this, SIGNAL(signalScopeRenderingFinished(uint,uint)), this, SLOT(slotScopeRenderingFinished(uint,uint))); + b &= connect(this, SIGNAL(signalBackgroundRenderingFinished(uint,uint)), this, SLOT(slotBackgroundRenderingFinished(uint,uint))); b &= connect(m_aRealtime, SIGNAL(toggled(bool)), this, SLOT(slotResetRealtimeFactor(bool))); b &= connect(m_aAutoRefresh, SIGNAL(toggled(bool)), this, SLOT(slotAutoRefreshToggled(bool))); Q_ASSERT(b); @@ -427,7 +433,7 @@ void AbstractScopeWidget::slotHUDRenderingFinished(uint mseconds, uint oldFactor qDebug() << "Trying to start a new HUD thread for " << m_widgetName << ". New frames/updates: " << m_newHUDFrames << "/" << m_newHUDUpdates; #endif - prodHUDThread();; + prodHUDThread(); } } @@ -531,7 +537,7 @@ void AbstractScopeWidget::slotResetRealtimeFactor(bool realtimeChecked) } } -bool AbstractScopeWidget::autoRefreshEnabled() +bool AbstractScopeWidget::autoRefreshEnabled() const { return m_aAutoRefresh->isChecked(); } @@ -559,3 +565,5 @@ void AbstractScopeWidget::handleMouseDrag(const QPoint &, const RescaleDirection #ifdef DEBUG_ASW #undef DEBUG_ASW #endif + +#include "abstractscopewidget.moc"