layout2->addWidget(m_config->getShowHideButton());
QToolButton *buttonShowLines = new QToolButton(m_config);
- // TODO: Better Icon
+ // TODO: Better Icons
buttonShowLines->setIcon(KIcon("insert-horizontal-rule"));
buttonShowLines->setToolTip(i18n("Show/Hide the lines connecting the corners"));
buttonShowLines->setCheckable(true);
+ buttonShowLines->setChecked(KdenliveSettings::onmonitoreffects_cornersshowlines());
connect(buttonShowLines, SIGNAL(toggled(bool)), this, SLOT(slotShowLines(bool)));
m_config->addWidget(buttonShowLines, 0, 2);
+ QToolButton *buttonShowControls = new QToolButton(m_config);
+ buttonShowControls->setIcon(KIcon("transform-move"));
+ buttonShowControls->setToolTip(i18n("Show additional controls"));
+ buttonShowControls->setCheckable(true);
+ buttonShowControls->setChecked(KdenliveSettings::onmonitoreffects_cornersshowcontrols());
+ connect(buttonShowControls, SIGNAL(toggled(bool)), this, SLOT(slotShowControls(bool)));
+ m_config->addWidget(buttonShowControls, 0, 3);
int width = m_monitor->render->frameRenderWidth();
int height = m_monitor->render->renderHeight();
m_item->update();
}
+void CornersWidget::slotShowControls(bool show)
+{
+ KdenliveSettings::setOnmonitoreffects_cornersshowcontrols(show);
+ m_item->update();
+}
+
void CornersWidget::slotResetCorner1()
{
blockSignals(true);
/** @brief Shows/Hides the lines connecting the corners in the on-monitor item according to @param show. */
void slotShowLines(bool show = true);
+ void slotShowControls(bool show = true);
+
/*
* These functions reset the positions of the corners.
* The default values in the effect XML file are not considered, but
<label>Connect the corners in the widget for the c0rners effect with lines.</label>
<default>false</default>
</entry>
+
+ <entry name="onmonitoreffects_cornersshowcontrols" type="Bool">
+ <label>Show additional controls in the c0rners on-monitor widget.</label>
+ <default>false</default>
+ </entry>
<entry name="projectloading_avformatnovalidate" type="Bool">
<label>Do not validate the video files when loading a project for the sake of speed.</label>
#include <QStyleOptionGraphicsItem>
#include <QCursor>
-#include <KDebug>
OnMonitorCornersItem::OnMonitorCornersItem(MonitorScene* scene, QGraphicsItem* parent) :
AbstractOnMonitorItem(scene),
QGraphicsPolygonItem(parent)
return Corner3;
else if (mouseArea.contains(polygon().at(3)))
return Corner4;
- else if (mouseArea.contains(getCentroid()))
+ else if (KdenliveSettings::onmonitoreffects_cornersshowcontrols() && mouseArea.contains(getCentroid()))
return Move;
else
return NoAction;
case NoAction:
emit requestCursor(QCursor(Qt::ArrowCursor));
break;
+ case Move:
+ emit requestCursor(QCursor(Qt::SizeAllCursor));
+ break;
default:
emit requestCursor(QCursor(Qt::OpenHandCursor));
break;
painter->drawEllipse(polygon().at(2), handleSize, handleSize);
painter->drawEllipse(polygon().at(3), handleSize, handleSize);
- // TODO: allow to disable
- if (1) {
+ if (KdenliveSettings::onmonitoreffects_cornersshowcontrols()) {
painter->setPen(QPen(Qt::red, 2, Qt::SolidLine));
QPointF c = getCentroid();
handleSize *= 1.5;
std::swap(a, c);
}
}
+ return points;
}
#include "onmonitorcornersitem.moc"