#include "monitorscenecontrolwidget.h"
#include "onmonitoritems/onmonitorcornersitem.h"
#include "renderer.h"
+#include "kdenlivesettings.h"
#include <QGraphicsView>
#include <QHBoxLayout>
m_config = new MonitorSceneControlWidget(m_scene, m_ui.frameConfig);
QHBoxLayout *layout = new QHBoxLayout(m_ui.frameConfig);
- layout->addWidget(m_config->getShowHideButton());
+ layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_config);
+ QHBoxLayout *layout2 = new QHBoxLayout(m_ui.widgetConfigButton);
+ layout2->setContentsMargins(0, 0, 0, 0);
+ layout2->addWidget(m_config->getShowHideButton());
+
+ QToolButton *buttonShowLines = new QToolButton(m_config);
+ // TODO: Better Icon
+ buttonShowLines->setIcon(KIcon("insert-horizontal-rule"));
+ buttonShowLines->setToolTip(i18n("Show/Hide the lines connecting the corners"));
+ buttonShowLines->setCheckable(true);
+ connect(buttonShowLines, SIGNAL(toggled(bool)), this, SLOT(slotShowLines(bool)));
+ m_config->addWidget(buttonShowLines, 0, 2);
int width = m_monitor->render->frameRenderWidth();
int height = m_monitor->render->renderHeight();
connect(m_ui.spinY3, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateItem()));
connect(m_ui.spinY4, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateItem()));
+ connect(m_ui.toolReset1, SIGNAL(clicked()), this, SLOT(slotResetCorner1()));
+ connect(m_ui.toolReset2, SIGNAL(clicked()), this, SLOT(slotResetCorner2()));
+ connect(m_ui.toolReset3, SIGNAL(clicked()), this, SLOT(slotResetCorner3()));
+ connect(m_ui.toolReset4, SIGNAL(clicked()), this, SLOT(slotResetCorner4()));
+
connect(m_config, SIGNAL(showScene(bool)), this, SLOT(slotShowScene(bool)));
connect(m_monitor, SIGNAL(renderPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
connect(m_scene, SIGNAL(actionFinished()), this, SLOT(slotUpdateProperties()));
slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
}
+void CornersWidget::slotShowLines(bool show)
+{
+ KdenliveSettings::setOnmonitoreffects_cornersshowlines(show);
+ m_item->update();
+}
+
+void CornersWidget::slotResetCorner1()
+{
+ blockSignals(true);
+ m_ui.spinX1->setValue(0);
+ m_ui.spinY1->setValue(0);
+ blockSignals(false);
+ slotUpdateItem();
+}
+
+void CornersWidget::slotResetCorner2()
+{
+ blockSignals(true);
+ m_ui.spinX2->setValue(m_monitor->render->frameRenderWidth());
+ m_ui.spinY2->setValue(0);
+ blockSignals(false);
+ slotUpdateItem();
+}
+
+void CornersWidget::slotResetCorner3()
+{
+ blockSignals(true);
+ m_ui.spinX3->setValue(m_monitor->render->frameRenderWidth());
+ m_ui.spinY3->setValue(m_monitor->render->renderHeight());
+ blockSignals(false);
+ slotUpdateItem();
+}
+
+void CornersWidget::slotResetCorner4()
+{
+ blockSignals(true);
+ m_ui.spinX4->setValue(0);
+ m_ui.spinY4->setValue(m_monitor->render->renderHeight());
+ blockSignals(false);
+ slotUpdateItem();
+}
+
#include "cornerswidget.moc"