CollapsibleGroup::CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, EffectInfo info, QWidget * parent) : AbstractCollapsibleWidget(parent) { m_info.groupIndex = ix; m_subWidgets = QList <CollapsibleEffect *> (); setFont(KGlobalSettings::smallestReadableFont()); frame->setObjectName("framegroup"); decoframe->setObjectName("decoframegroup"); QHBoxLayout *l = static_cast <QHBoxLayout *>(frame->layout()); m_title = new MyEditableLabel(this); 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())); buttonUp->setIcon(KIcon("kdenlive-up")); buttonUp->setToolTip(i18n("Move effect up")); buttonDown->setIcon(KIcon("kdenlive-down")); buttonDown->setToolTip(i18n("Move effect down")); buttonDel->setIcon(KIcon("kdenlive-deleffect")); buttonDel->setToolTip(i18n("Delete effect")); if (firstGroup) buttonUp->setVisible(false); if (lastGroup) buttonDown->setVisible(false); m_menu = new QMenu; m_menu->addAction(KIcon("view-refresh"), i18n("Reset Group"), this, SLOT(slotResetGroup())); m_menu->addAction(KIcon("document-save"), i18n("Save Group"), this, SLOT(slotSaveGroup())); m_menu->addAction(KIcon("list-remove"), i18n("Ungroup"), this, SLOT(slotUnGroup())); setAcceptDrops(true); menuButton->setIcon(KIcon("kdenlive-menu")); menuButton->setMenu(m_menu); enabledButton->setChecked(false); enabledButton->setIcon(KIcon("visible")); if (info.groupIsCollapsed) { slotShow(false); } connect(collapseButton, SIGNAL(clicked()), this, SLOT(slotSwitch())); connect(enabledButton, SIGNAL(toggled(bool)), this, SLOT(slotEnable(bool))); connect(buttonUp, SIGNAL(clicked()), this, SLOT(slotEffectUp())); connect(buttonDown, SIGNAL(clicked()), this, SLOT(slotEffectDown())); connect(buttonDel, SIGNAL(clicked()), this, SLOT(slotDeleteGroup())); }
CollapsibleGroup::CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, const EffectInfo &info, QWidget * parent) : AbstractCollapsibleWidget(parent) { m_info.groupIndex = ix; m_subWidgets = QList <CollapsibleEffect *> (); setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont)); frame->setObjectName(QStringLiteral("framegroup")); decoframe->setObjectName(QStringLiteral("decoframegroup")); QHBoxLayout *l = static_cast <QHBoxLayout *>(frame->layout()); m_title = new MyEditableLabel(this); 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())); buttonUp->setIcon(KoIconUtils::themedIcon(QStringLiteral("kdenlive-up"))); buttonUp->setToolTip(i18n("Move effect up")); buttonDown->setIcon(KoIconUtils::themedIcon(QStringLiteral("kdenlive-down"))); buttonDown->setToolTip(i18n("Move effect down")); buttonDel->setIcon(KoIconUtils::themedIcon(QStringLiteral("kdenlive-deleffect"))); buttonDel->setToolTip(i18n("Delete effect")); if (firstGroup) buttonUp->setVisible(false); if (lastGroup) buttonDown->setVisible(false); m_menu = new QMenu; m_menu->addAction(KoIconUtils::themedIcon(QStringLiteral("view-refresh")), i18n("Reset Group"), this, SLOT(slotResetGroup())); m_menu->addAction(KoIconUtils::themedIcon(QStringLiteral("document-save")), i18n("Save Group"), this, SLOT(slotSaveGroup())); m_menu->addAction(KoIconUtils::themedIcon(QStringLiteral("list-remove")), i18n("Ungroup"), this, SLOT(slotUnGroup())); setAcceptDrops(true); menuButton->setIcon(KoIconUtils::themedIcon(QStringLiteral("kdenlive-menu"))); menuButton->setMenu(m_menu); m_enabledButton = new KDualAction(i18n("Disable Effect"), i18n("Enable Effect"), this); m_enabledButton->setActiveIcon(KoIconUtils::themedIcon(QStringLiteral("hint"))); m_enabledButton->setInactiveIcon(KoIconUtils::themedIcon(QStringLiteral("visibility"))); enabledButton->setDefaultAction(m_enabledButton); if (info.groupIsCollapsed) { slotShow(false); } connect(collapseButton, SIGNAL(clicked()), this, SLOT(slotSwitch())); connect(m_enabledButton, SIGNAL(activeChangedByUser(bool)), this, SLOT(slotEnable(bool))); connect(buttonUp, SIGNAL(clicked()), this, SLOT(slotEffectUp())); connect(buttonDown, SIGNAL(clicked()), this, SLOT(slotEffectDown())); connect(buttonDel, SIGNAL(clicked()), this, SLOT(slotDeleteGroup())); }