- Allow adding custom widgets
Corners widget:
- Make the lines connecting the corners on the monitor optional (disabled by default). They make it harder to think of the effect working in 3D space, which can be very helpful.
svn path=/trunk/kdenlive/; revision=5031
#include "monitorscenecontrolwidget.h"
#include "onmonitoritems/onmonitorcornersitem.h"
#include "renderer.h"
#include "monitorscenecontrolwidget.h"
#include "onmonitoritems/onmonitorcornersitem.h"
#include "renderer.h"
+#include "kdenlivesettings.h"
#include <QGraphicsView>
#include <QHBoxLayout>
#include <QGraphicsView>
#include <QHBoxLayout>
layout2->setContentsMargins(0, 0, 0, 0);
layout2->addWidget(m_config->getShowHideButton());
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();
int width = m_monitor->render->frameRenderWidth();
int height = m_monitor->render->renderHeight();
slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
}
slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
}
+void CornersWidget::slotShowLines(bool show)
+{
+ KdenliveSettings::setOnmonitoreffects_cornersshowlines(show);
+ m_item->update();
+}
+
void CornersWidget::slotResetCorner1()
{
blockSignals(true);
void CornersWidget::slotResetCorner1()
{
blockSignals(true);
* @param changed (default = true) Whether to emit parameterChanged */
void slotUpdateProperties(bool changed = 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
/*
* 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 name="blitzeffect" type="Int">
<label>Effect applied to stopmotion frame overlay.</label>
<default>0</default>
+ </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>
+
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
/** @brief Adds a keyframe if scene is disabled. */
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
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:
virtual void wheelEvent(QGraphicsSceneWheelEvent *event);
public slots:
#include "monitorscene.h"
#include "kdenlivesettings.h"
#include "monitorscene.h"
#include "kdenlivesettings.h"
+#include <QGridLayout>
+
MonitorSceneControlWidget::MonitorSceneControlWidget(MonitorScene* scene, QWidget* parent) :
QWidget(parent),
MonitorSceneControlWidget::MonitorSceneControlWidget(MonitorScene* scene, QWidget* parent) :
QWidget(parent),
+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);
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 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);
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)
{
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));
painter->setRenderHint(QPainter::Antialiasing);
painter->setBrush(QBrush(Qt::yellow));