#include "monitorscenecontrolwidget.h"
#include "onmonitoritems/onmonitorcornersitem.h"
#include "renderer.h"
+#include "kdenlivesettings.h"
#include <QGraphicsView>
#include <QHBoxLayout>
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();
slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
}
+void CornersWidget::slotShowLines(bool show)
+{
+ KdenliveSettings::setOnmonitoreffects_cornersshowlines(show);
+ m_item->update();
+}
+
void CornersWidget::slotResetCorner1()
{
blockSignals(true);
* @param changed (default = true) Whether to emit parameterChanged */
void slotUpdateProperties(bool changed = true);
+ /** @brief Shows/Hides the lines connecting the corners in the on-monitor item according to @param show. */
+ void slotShowLines(bool show = true);
+
/*
* These functions reset the positions of the corners.
* The default values in the effect XML file are not considered, but
<entry name="blitzeffect" type="Int">
<label>Effect applied to stopmotion frame overlay.</label>
<default>0</default>
- </entry>
+ </entry>
+
+ <entry name="onmonitoreffects_cornersshowlines" type="Bool">
+ <label>Connect the corners in the widget for the c0rners effect with lines.</label>
+ <default>false</default>
+ </entry>
+
</group>
</kcfg>
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
/** @brief Adds a keyframe if scene is disabled. */
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
+ /** @brief Reimplemented to allow zooming using ctrl + mouse wheel. */
virtual void wheelEvent(QGraphicsSceneWheelEvent *event);
public slots:
#include "monitorscene.h"
#include "kdenlivesettings.h"
+#include <QGridLayout>
+
MonitorSceneControlWidget::MonitorSceneControlWidget(MonitorScene* scene, QWidget* parent) :
QWidget(parent),
return m_buttonConfig;
}
+void MonitorSceneControlWidget::addWidget(QWidget* widget, int row, int column)
+{
+ ((QGridLayout*)m_ui.groupBox->layout())->addWidget(widget, row, column);
+}
+
void MonitorSceneControlWidget::slotSetDirectUpdate(bool directUpdate)
{
KdenliveSettings::setMonitorscene_directupdate(directUpdate);
/** @brief Returns a button for showing and hiding the monitor scene controls (this widget). */
QToolButton *getShowHideButton();
+ /** @brief Adds a custom widget to the controls. */
+ void addWidget(QWidget *widget, int row, int column);
+
private slots:
/** @brief Sets the KdenliveSetting directupdate with true = update parameters (rerender frame) during mouse move (before mouse button is released) */
void slotSetDirectUpdate(bool directUpdate);
void OnMonitorCornersItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
{
- QGraphicsPolygonItem::paint(painter, option, widget);
+ if (KdenliveSettings::onmonitoreffects_cornersshowlines())
+ QGraphicsPolygonItem::paint(painter, option, widget);
painter->setRenderHint(QPainter::Antialiasing);
painter->setBrush(QBrush(Qt::yellow));