else if (type == "custom") icon = KIcon("kdenlive-custom-effect");
else icon = KIcon("kdenlive-show-video");
effecticon->setPixmap(icon.pixmap(16,16));*/
-
+ m_groupAction = new QAction(KIcon("folder-new"), i18n("Create Group"), this);
+ connect(m_groupAction, SIGNAL(triggered(bool)), this, SLOT(slotCreateGroup()));
if (!m_regionEffect) {
- m_menu->addAction(KIcon("folder-new"), i18n("Create Group"), this, SLOT(slotCreateGroup()));
+ if (m_info.groupIndex == -1) m_menu->addAction(m_groupAction);
m_menu->addAction(KIcon("folder-new"), i18n("Create Region"), this, SLOT(slotCreateRegion()));
}
setupWidget(info, metaInfo);
void CollapsibleEffect::setGroupIndex(int ix)
{
+ if (m_info.groupIndex == -1 && ix != -1) {
+ m_menu->removeAction(m_groupAction);
+ }
+ else if (m_info.groupIndex != -1 && ix == -1) {
+ m_menu->addAction(m_groupAction);
+ }
m_info.groupIndex = ix;
m_effect.setAttribute("kdenlive_info", m_info.toString());
}
void CollapsibleEffect::removeFromGroup()
{
+ if (m_info.groupIndex != -1) {
+ m_menu->addAction(m_groupAction);
+ }
m_info.groupIndex = -1;
m_info.groupName.clear();
m_effect.setAttribute("kdenlive_info", m_info.toString());
event->accept();
}
+
+void CollapsibleEffect::adjustButtons(int ix, int max)
+{
+ buttonUp->setVisible(ix > 0);
+ buttonDown->setVisible(ix < max - 1);
+}
+
ParameterContainer::ParameterContainer(QDomElement effect, ItemInfo info, EffectMetaInfo *metaInfo, QWidget * parent) :
m_keyframeEditor(NULL),
m_geometryWidget(NULL),
}
}
}
+
+
+
static const QString getStyleSheet();
/** @brief Parent group was collapsed, update. */
void groupStateChanged(bool collapsed);
+ /** @brief Show / hide up / down buttons. */
+ void adjustButtons(int ix, int max);
public slots:
void slotSyncEffectsPos(int pos);
EffectInfo m_info;
/** @brief True if this is a region effect, which behaves in a special way, like a group. */
bool m_regionEffect;
+ /** @brief The add group action. */
+ QAction *m_groupAction;
/** @brief Check if collapsed state changed and inform MLT. */
void updateCollapsedState();
}
connectEffect(currentEffect);
}
+
+ // Adjust group effects (up / down buttons)
+ QList<CollapsibleGroup *> allGroups = m_ui.container->widget()->findChildren<CollapsibleGroup *>();
+ for (int i = 0; i < allGroups.count(); i++) {
+ allGroups.at(i)->adjustEffects();
+ }
+
vbox1->addStretch(10);
slotUpdateCheckAllButton();
connect(m_effectMetaInfo.monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));