widgets/clipproperties_ui.ui
widgets/cliptranscode_ui.ui
widgets/collapsiblewidget_ui.ui
- widgets/collapsiblegroup_ui.ui
widgets/clipstabilize_ui.ui
widgets/colorclip_ui.ui
widgets/colorplaneexport_ui.ui
AbstractCollapsibleWidget::AbstractCollapsibleWidget(QWidget * parent) :
QWidget(parent)
{
-
-}
\ No newline at end of file
+ setupUi(this);
+}
#ifndef ABSTRACTCOLLAPSIBLEWIDGET_H
#define ABSTRACTCOLLAPSIBLEWIDGET_H
+#include "ui_collapsiblewidget_ui.h"
+
#include <QWidget>
+#include <QDomElement>
-class AbstractCollapsibleWidget : public QWidget
+class AbstractCollapsibleWidget : public QWidget, public Ui::CollapsibleWidget_UI
{
Q_OBJECT
AbstractCollapsibleWidget(QWidget * parent = 0);
virtual void setActive(bool activate) = 0;
virtual bool isGroup() const = 0;
+
+signals:
+ void addEffect(QDomElement e);
+ /** @brief Move effects in the stack one step up or down. */
+ void changeEffectPosition(QList <int>, bool upwards);
+ /** @brief Move effects in the stack. */
+ void moveEffect(QList <int> current_pos, int new_pos, int groupIndex, QString groupName);
+ /** @brief An effect was saved, trigger effect list reload. */
+ void reloadEffects();
};
m_lastEffect(lastEffect),
m_regionEffect(false)
{
- setupUi(this);
if (m_effect.attribute("tag") == "region") {
m_regionEffect = true;
decoframe->setObjectName("decoframegroup");
if (namenode.isNull()) return;
QString effectname = i18n(namenode.text().toUtf8().data());
if (m_regionEffect) effectname.append(":" + KUrl(EffectsList::parameter(m_effect, "resource")).fileName());
+
+ QHBoxLayout *l = static_cast <QHBoxLayout *>(frame->layout());
+ title = new QLabel(this);
+ l->insertWidget(2, title);
+
title->setText(effectname);
/*
* Do not show icon, makes too much visual noise
QString stylesheet;
- // group editable labels
- stylesheet.append(QString("MyEditableLabel { background-color: transparent;color: palette(bright-text);} "));
-
// effect background
stylesheet.append(QString("QFrame#decoframe {border-top-left-radius:5px;border-top-right-radius:5px;border-bottom:2px solid palette(mid);border-top:1px solid palette(light);} QFrame#decoframe[active=\"true\"] {background: %1;}").arg(hgh.name()));
-
+
// effect in group background
stylesheet.append(QString("QFrame#decoframesub {border-top:1px solid palette(light);} QFrame#decoframesub[active=\"true\"] {background: %1;}").arg(hgh.name()));
// spin box for draggable widget
stylesheet.append(QString("QAbstractSpinBox#dragBox {border: 1px solid palette(dark);border-top-right-radius: 4px;border-bottom-right-radius: 4px;padding-right:0px;} QAbstractSpinBox::down-button#dragBox {width:0px;padding:0px;} QAbstractSpinBox:disabled#dragBox {border: 1px solid palette(button);} QAbstractSpinBox::up-button#dragBox {width:0px;padding:0px;} QAbstractSpinBox[inTimeline=\"true\"]#dragBox { border: 1px solid %1;} QAbstractSpinBox:hover#dragBox {border: 1px solid %2;} ").arg(hover_bg.name()).arg(selected_bg.name()));
-
+
+ // group editable labels
+ stylesheet.append(QString("MyEditableLabel { background-color: transparent; color: palette(bright-text); border-radius: 2px;border: 1px solid transparent;} MyEditableLabel:hover {border: 1px solid palette(highlight);} "));
+
return stylesheet;
}
void CollapsibleEffect::slotEffectUp()
{
- emit changeEffectPosition(effectIndex(), true);
+ emit changeEffectPosition(QList <int>() <<effectIndex(), true);
}
void CollapsibleEffect::slotEffectDown()
{
- emit changeEffectPosition(effectIndex(), false);
+ emit changeEffectPosition(QList <int>() <<effectIndex(), false);
}
void CollapsibleEffect::slotSaveEffect()
#ifndef COLLAPSIBLEEFFECT_H
#define COLLAPSIBLEEFFECT_H
-
-#include "ui_collapsiblewidget_ui.h"
-
#include "abstractcollapsiblewidget.h"
#include "timecode.h"
#include "keyframeedit.h"
#include <QToolButton>
class QFrame;
+class QLabel;
+
class Monitor;
class GeometryWidget;
* @author Jean-Baptiste Mardelle
*/
-class CollapsibleEffect : public AbstractCollapsibleWidget, public Ui::CollapsibleWidget_UI
+class CollapsibleEffect : public AbstractCollapsibleWidget
{
Q_OBJECT
CollapsibleEffect(QDomElement effect, QDomElement original_effect, ItemInfo info, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent = 0);
~CollapsibleEffect();
static QMap<QString, QImage> iconCache;
+ QLabel *title;
+
void setupWidget(ItemInfo info, EffectMetaInfo *metaInfo);
void updateTimecodeFormat();
void setActive(bool activate);
void syncEffectsPos(int);
void effectStateChanged(bool, int ix = -1, bool updateMainStatus = true);
void deleteEffect(const QDomElement);
- void changeEffectPosition(int, bool);
void activateEffect(int);
void checkMonitorPosition(int);
void seekTimeline(int);
/** @brief Start an MLT filter job on this clip. */
void startFilterJob(QString filterName, QString filterParams, QString finalFilterName, QString consumer, QString consumerParams, QString properties);
- /** @brief An effect was saved, trigger effect list reload. */
- void reloadEffects();
/** @brief An effect was reset, trigger param reload. */
void resetEffect(int ix);
/** @brief Ask for creation of a group. */
void createGroup(int ix);
- void moveEffect(QList <int> current_pos, int new_pos, int groupIndex, QString groupName);
void unGroup(CollapsibleEffect *);
- void addEffect(QDomElement e);
void createRegion(int, KUrl);
void deleteGroup(QDomDocument);
};
{
setFrame(false);
setReadOnly(true);
- setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
+ setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
}
void MyEditableLabel::mouseDoubleClickEvent ( QMouseEvent * e )
CollapsibleGroup::CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, EffectInfo info, QWidget * parent) :
AbstractCollapsibleWidget(parent)
{
- setupUi(this);
m_info.groupIndex = ix;
m_subWidgets = QList <CollapsibleEffect *> ();
setFont(KGlobalSettings::smallestReadableFont());
- QHBoxLayout *l = static_cast <QHBoxLayout *>(framegroup->layout());
+ frame->setObjectName("framegroup");
+ decoframe->setObjectName("decoframegroup");
+ QHBoxLayout *l = static_cast <QHBoxLayout *>(frame->layout());
m_title = new MyEditableLabel(this);
- l->insertWidget(3, m_title);
+ l->insertWidget(2, m_title);
m_title->setText(info.groupName.isEmpty() ? i18n("Effect Group") : info.groupName);
m_info.groupName = m_title->text();
connect(m_title, SIGNAL(editingFinished()), this, SLOT(slotRenameGroup()));
bool CollapsibleGroup::isActive() const
{
- return decoframegroup->property("active").toBool();
+ return decoframe->property("active").toBool();
}
void CollapsibleGroup::setActive(bool activate)
{
- decoframegroup->setProperty("active", activate);
- decoframegroup->setStyleSheet(decoframegroup->styleSheet());
+ decoframe->setProperty("active", activate);
+ decoframe->setStyleSheet(decoframe->styleSheet());
}
void CollapsibleGroup::mouseDoubleClickEvent ( QMouseEvent * event )
{
- if (framegroup->underMouse() && collapseButton->isEnabled()) slotSwitch();
+ if (frame->underMouse() && collapseButton->isEnabled()) slotSwitch();
QWidget::mouseDoubleClickEvent(event);
}
void CollapsibleGroup::slotEffectUp()
{
- emit changeGroupPosition(groupIndex(), true);
+ QList <int> indexes;
+ for (int i = 0; i < m_subWidgets.count(); i++)
+ indexes << m_subWidgets.at(i)->effectIndex();
+ emit changeEffectPosition(indexes, true);
}
void CollapsibleGroup::slotEffectDown()
{
- emit changeGroupPosition(groupIndex(), false);
+ QList <int> indexes;
+ for (int i = 0; i < m_subWidgets.count(); i++)
+ indexes << m_subWidgets.at(i)->effectIndex();
+ emit changeEffectPosition(indexes, false);
}
void CollapsibleGroup::slotSaveGroup()
void CollapsibleGroup::dragEnterEvent(QDragEnterEvent *event)
{
if (event->mimeData()->hasFormat("kdenlive/effectslist")) {
- framegroup->setProperty("target", true);
- framegroup->setStyleSheet(framegroup->styleSheet());
+ frame->setProperty("target", true);
+ frame->setStyleSheet(frame->styleSheet());
event->acceptProposedAction();
}
}
void CollapsibleGroup::dragLeaveEvent(QDragLeaveEvent */*event*/)
{
- framegroup->setProperty("target", false);
- framegroup->setStyleSheet(framegroup->styleSheet());
+ frame->setProperty("target", false);
+ frame->setStyleSheet(frame->styleSheet());
}
void CollapsibleGroup::dropEvent(QDropEvent *event)
{
- framegroup->setProperty("target", false);
- framegroup->setStyleSheet(framegroup->styleSheet());
+ frame->setProperty("target", false);
+ frame->setStyleSheet(frame->styleSheet());
const QString effects = QString::fromUtf8(event->mimeData()->data("kdenlive/effectslist"));
//event->acceptProposedAction();
QDomDocument doc;
* @author Jean-Baptiste Mardelle
*/
-class CollapsibleGroup : public AbstractCollapsibleWidget, public Ui::CollapsibleGroup_UI
+class CollapsibleGroup : public AbstractCollapsibleWidget
{
Q_OBJECT
virtual void dropEvent(QDropEvent *event);
signals:
- void syncEffectsPos(int);
- void effectStateChanged(bool, int ix = -1);
void deleteGroup(QDomDocument);
- void changeGroupPosition(int, bool);
- void activateEffect(int);
- void moveEffect(QList <int> current_pos, int new_pos, int groupIndex, QString groupName);
- void addEffect(QDomElement e);
void unGroup(CollapsibleGroup *);
void groupRenamed(CollapsibleGroup *);
- void reloadEffects();
+
};
connect(currentEffect, SIGNAL(deleteEffect(const QDomElement)), this , SLOT(slotDeleteEffect(const QDomElement)));
connect(currentEffect, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
connect(currentEffect, SIGNAL(resetEffect(int)), this , SLOT(slotResetEffect(int)));
- connect(currentEffect, SIGNAL(changeEffectPosition(int,bool)), this , SLOT(slotMoveEffectUp(int , bool)));
+ connect(currentEffect, SIGNAL(changeEffectPosition(QList <int>,bool)), this , SLOT(slotMoveEffectUp(QList <int>,bool)));
connect(currentEffect, SIGNAL(effectStateChanged(bool,int,bool)), this, SLOT(slotUpdateEffectState(bool,int,bool)));
connect(currentEffect, SIGNAL(activateEffect(int)), this, SLOT(slotSetCurrentEffect(int)));
connect(currentEffect, SIGNAL(checkMonitorPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
m_draggedGroup = qobject_cast<CollapsibleGroup*>(o);
if (m_draggedGroup) {
QMouseEvent *me = static_cast<QMouseEvent *>(e);
- if (me->button() == Qt::LeftButton && (m_draggedGroup->framegroup->underMouse() || m_draggedGroup->title()->underMouse()))
+ if (me->button() == Qt::LeftButton && (m_draggedGroup->frame->underMouse() || m_draggedGroup->title()->underMouse()))
m_clickPoint = me->globalPos();
else {
m_clickPoint = QPoint();
emit addEffect(m_clipref, effect);
}
-void EffectStackView2::slotMoveEffectUp(int index, bool up)
+void EffectStackView2::slotMoveEffectUp(QList <int> indexes, bool up)
{
- if (up && index <= 1) return;
- if (!up && index >= m_currentEffectList.count()) return;
+ if (up && indexes.first() <= 1) return;
+ if (!up && indexes.last() >= m_currentEffectList.count()) return;
int endPos;
if (up) {
- endPos = index - 1;
+ endPos = indexes.first() - 1;
}
else {
- endPos = index + 1;
+ endPos = indexes.last() + 1;
}
- if (m_effectMetaInfo.trackMode) emit changeEffectPosition(NULL, m_trackindex, QList <int>() <<index, endPos);
- else emit changeEffectPosition(m_clipref, -1, QList <int>() <<index, endPos);
+ if (m_effectMetaInfo.trackMode) emit changeEffectPosition(NULL, m_trackindex, indexes, endPos);
+ else emit changeEffectPosition(m_clipref, -1, indexes, endPos);
}
void EffectStackView2::slotStartFilterJob(const QString&filterName, const QString&filterParams, const QString&finalFilterName, const QString&consumer, const QString&consumerParams, const QString&properties)
connect(group, SIGNAL(groupRenamed(CollapsibleGroup *)), this , SLOT(slotRenameGroup(CollapsibleGroup*)));
connect(group, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
connect(group, SIGNAL(deleteGroup(QDomDocument)), this , SLOT(slotDeleteGroup(QDomDocument)));
+ connect(group, SIGNAL(changeEffectPosition(QList <int>,bool)), this , SLOT(slotMoveEffectUp(QList <int>,bool)));
}
void EffectStackView2::slotMoveEffect(QList <int> currentIndexes, int newIndex, int groupIndex, QString groupName)
void slotUpdateEffectParams(const QDomElement old, const QDomElement e, int ix);
/** @brief Move an effect in the stack.
- * @param index The effect index in the stack
+ * @param indexes The list of effect index in the stack
* @param up true if we want to move effect up, false for down */
- void slotMoveEffectUp(int index, bool up);
+ void slotMoveEffectUp(QList <int> indexes, bool up);
/** @brief Delete an effect in the stack. */
void slotDeleteEffect(const QDomElement effect);
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>CollapsibleGroup_UI</class>
- <widget class="QWidget" name="CollapsibleGroup_UI">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>245</width>
- <height>48</height>
- </rect>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <property name="margin">
- <number>0</number>
- </property>
- <item row="0" column="0">
- <widget class="QFrame" name="decoframegroup">
- <property name="autoFillBackground">
- <bool>true</bool>
- </property>
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <property name="verticalSpacing">
- <number>0</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item row="0" column="0">
- <widget class="QFrame" name="framegroup">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <property name="spacing">
- <number>0</number>
- </property>
- <property name="leftMargin">
- <number>2</number>
- </property>
- <property name="topMargin">
- <number>0</number>
- </property>
- <property name="rightMargin">
- <number>2</number>
- </property>
- <property name="bottomMargin">
- <number>0</number>
- </property>
- <item>
- <widget class="QToolButton" name="collapseButton">
- <property name="text">
- <string>...</string>
- </property>
- <property name="autoRaise">
- <bool>true</bool>
- </property>
- <property name="arrowType">
- <enum>Qt::DownArrow</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="enabledButton">
- <property name="maximumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="autoRaise">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>80</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QToolButton" name="menuButton">
- <property name="maximumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- <property name="popupMode">
- <enum>QToolButton::InstantPopup</enum>
- </property>
- <property name="autoRaise">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="buttonUp">
- <property name="maximumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- <property name="autoRaise">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="buttonDown">
- <property name="maximumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- <property name="autoRaise">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="buttonDel">
- <property name="maximumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- <property name="autoRaise">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QFrame" name="widgetFrame">
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
</property>
</widget>
</item>
- <item>
- <widget class="QLabel" name="title">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">