#include "renderer.h"
#include "monitorscene.h"
+#include <QGraphicsView>
#include <QGraphicsRectItem>
GeometryWidget::GeometryWidget(Monitor* monitor, int clipPos, QWidget* parent ):
QWidget(parent),
m_monitor(monitor),
- m_rect(NULL),
- m_geometry(NULL),
m_clipPos(clipPos),
m_inPoint(0),
- m_outPoint(1)
+ m_outPoint(1),
+ m_rect(NULL),
+ m_geometry(NULL)
{
m_ui.setupUi(this);
m_scene = monitor->getEffectScene();
void GeometryWidget::slotCheckPosition(int renderPos)
{
- if (renderPos >= m_clipPos && renderPos <= m_clipPos + m_outPoint - m_inPoint)
- m_monitor->slotEffectScene(true);
- else
+ if (renderPos >= m_clipPos && renderPos <= m_clipPos + m_outPoint - m_inPoint) {
+ if (!m_scene->views().at(0)->isVisible())
+ m_monitor->slotEffectScene(true);
+ } else
m_monitor->slotEffectScene(false);
}
private:
Ui::GeometryWidget_UI m_ui;
+ Monitor *m_monitor;
int m_clipPos;
int m_inPoint;
int m_outPoint;
- Monitor *m_monitor;
MonitorScene *m_scene;
QGraphicsRectItem *m_rect;
Mlt::Geometry *m_geometry;
#include <QIntValidator>
#include <QVBoxLayout>
#include <QGraphicsView>
-#include <QGraphicsPixmapItem>
Monitor::Monitor(QString name, MonitorManager *manager, QString profile, QWidget *parent) :
void Monitor::mousePressEvent(QMouseEvent * event)
{
if (event->button() != Qt::RightButton) {
- if (m_ui.video_frame->underMouse() && !m_effectView->isVisible()) {
+ if (m_ui.video_frame->underMouse()) {
m_dragStarted = true;
m_DragStartPosition = event->pos();
}
void Monitor::mouseReleaseEvent(QMouseEvent * event)
{
if (m_dragStarted) {
- if (m_ui.video_frame->underMouse() && !m_effectView->isVisible()) {
+ if (m_ui.video_frame->underMouse()) {
if (isActive()) slotPlay();
else activateMonitor();
} else QWidget::mouseReleaseEvent(event);
#include "monitorscene.h"
#include "renderer.h"
+#include "kdenlivesettings.h"
#include <QGraphicsView>
#include <QGraphicsPixmapItem>
void MonitorScene::setUp()
{
- setBackgroundBrush(QBrush(QColor(0, 0, 255)));
+ setBackgroundBrush(QBrush(QColor(KdenliveSettings::window_background().name())));
QPen framepen(Qt::DotLine);
framepen.setColor(Qt::red);
connect(m_renderer, SIGNAL(rendererPosition(int)), this, SLOT(slotUpdateBackground()));
connect(m_renderer, SIGNAL(frameUpdated(int)), this, SLOT(slotUpdateBackground()));
slotUpdateBackground();
- views().at(0)->fitInView(m_frameBorder, Qt::KeepAspectRatio);
- views().at(0)->centerOn(m_frameBorder);
}
void MonitorScene::slotUpdateBackground()