]> git.sesse.net Git - kdenlive/blobdiff - src/geometrywidget.cpp
on-monitor editing: show controls next to the edit monitor
[kdenlive] / src / geometrywidget.cpp
index cc378de928702483956f6969be7c9311c5da8b48..7e0aca9aff49f0cf32dfff0c56d699fdf8331c4e 100644 (file)
 #include "keyframehelper.h"
 #include "timecodedisplay.h"
 #include "monitorscene.h"
-#include "monitorscenecontrolwidget.h"
+#include "monitoreditwidget.h"
 #include "onmonitoritems/onmonitorrectitem.h"
 #include "kdenlivesettings.h"
 
 #include <QtCore>
 #include <QGraphicsView>
-#include <QGraphicsRectItem>
 #include <QVBoxLayout>
 #include <QGridLayout>
 
 
 
 GeometryWidget::GeometryWidget(Monitor* monitor, Timecode timecode, int clipPos, bool isEffect, QWidget* parent):
-        QWidget(parent),
-        m_monitor(monitor),
-        m_timePos(new TimecodeDisplay(timecode)),
-        m_clipPos(clipPos),
-        m_inPoint(0),
-        m_outPoint(1),
-        m_isEffect(isEffect),
-        m_rect(NULL),
-        m_geometry(NULL),
-        m_showScene(true)
+    QWidget(parent),
+    m_monitor(monitor),
+    m_timePos(new TimecodeDisplay(timecode)),
+    m_clipPos(clipPos),
+    m_inPoint(0),
+    m_outPoint(1),
+    m_isEffect(isEffect),
+    m_rect(NULL),
+    m_geometry(NULL),
+    m_showScene(true)
 {
     m_ui.setupUi(this);
-    m_scene = monitor->getEffectScene();
+
+    MonitorEditWidget *edit = monitor->getEffectEdit();
+    edit->showVisibilityButton(true);
+    m_scene = edit->getScene();
 
 
     /*
@@ -124,14 +126,7 @@ GeometryWidget::GeometryWidget(Monitor* monitor, Timecode timecode, int clipPos,
         Setup of configuration controls
     */
 
-    m_config = new MonitorSceneControlWidget(m_scene, m_ui.frameSettings);
-    QHBoxLayout *settingsLayout = new QHBoxLayout(m_ui.frameSettings);
-    settingsLayout->addWidget(m_config);
-    settingsLayout->setContentsMargins(0, 0, 0, 0);
-    ((QGridLayout *)m_ui.widgetFirstColumn->layout())->addWidget(m_config->getShowHideButton(), 1, 2);
-    connect(m_config, SIGNAL(showScene(bool)), this, SLOT(slotShowScene(bool)));
-
-
+    connect(edit, SIGNAL(showEdit(bool)), this, SLOT(slotShowScene(bool)));
 
     connect(m_scene, SIGNAL(actionFinished()), this, SLOT(slotUpdateGeometry()));
     connect(m_scene, SIGNAL(addKeyframe()),    this, SLOT(slotAddKeyframe()));
@@ -141,13 +136,15 @@ GeometryWidget::GeometryWidget(Monitor* monitor, Timecode timecode, int clipPos,
 
 GeometryWidget::~GeometryWidget()
 {
+    m_scene->setEnabled(true);
     delete m_timePos;
     delete m_timeline;
     m_scene->removeItem(m_rect);
     delete m_geometry;
-    delete m_config;
-    if (m_monitor)
+    if (m_monitor) {
+        m_monitor->getEffectEdit()->showVisibilityButton(false);
         m_monitor->slotEffectScene(false);
+    }
 }
 
 void GeometryWidget::updateTimecodeFormat()
@@ -188,7 +185,7 @@ void GeometryWidget::setupParam(const QDomElement elem, int minframe, int maxfra
 
     m_geometry->fetch(&item, 0);
     delete m_rect;
-    m_rect = new OnMonitorRectItem(QRectF(0, 0, item.w(), item.h()));
+    m_rect = new OnMonitorRectItem(QRectF(0, 0, item.w(), item.h()), m_monitor->render->dar(), m_scene);
     m_rect->setPos(item.x(), item.y());
     m_rect->setZValue(0);
     m_scene->addItem(m_rect);