Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Small improvments to effectstack look

parent a5a04be3
......@@ -101,8 +101,8 @@ const QString AssetPanel::getStyleSheet()
QString stylesheet;
// effect background
stylesheet.append(QStringLiteral("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;}")
stylesheet.append(QStringLiteral("QFrame#decoframe {border-bottom:2px solid "
"palette(mid);background: transparent} QFrame#decoframe[active=\"true\"] {background: %1;}")
.arg(hgh.name()));
// effect in group background
......@@ -111,14 +111,14 @@ const QString AssetPanel::getStyleSheet()
// group background
stylesheet.append(QStringLiteral(
"QFrame#decoframegroup {border-top-left-radius:5px;border-top-right-radius:5px;border:2px solid palette(dark);margin:0px;margin-top:2px;} "));
"QFrame#decoframegroup {border:2px solid palette(dark);margin:0px;margin-top:2px;} "));
// effect title bar
stylesheet.append(QStringLiteral("QFrame#frame {margin-bottom:2px;border-top-left-radius:5px;border-top-right-radius:5px;} QFrame#frame[target=\"true\"] "
stylesheet.append(QStringLiteral("QFrame#frame {margin-bottom:2px;} QFrame#frame[target=\"true\"] "
"{background: palette(highlight);}"));
// group effect title bar
stylesheet.append(QStringLiteral("QFrame#framegroup {border-top-left-radius:2px;border-top-right-radius:2px;background: palette(dark);} "
stylesheet.append(QStringLiteral("QFrame#framegroup {background: palette(dark);} "
"QFrame#framegroup[target=\"true\"] {background: palette(highlight);} "));
// draggable effect bar content
......
......@@ -62,7 +62,6 @@ CollapsibleEffectView::CollapsibleEffectView(std::shared_ptr<EffectItemModel> ef
{
QString effectId = effectModel->getAssetId();
QString effectName = EffectsRepository::get()->getName(effectId);
qDebug()<<" * * *DISPLAYING EFFECT; "<<effectName<<" = "<<effectId;
if (effectId == QLatin1String("region")) {
m_regionEffect = true;
decoframe->setObjectName(QStringLiteral("decoframegroup"));
......@@ -101,16 +100,17 @@ CollapsibleEffectView::CollapsibleEffectView(std::shared_ptr<EffectItemModel> ef
// checkAll->setToolTip(i18n("Enable/Disable all effects"));
// buttonShowComments->setIcon(KoIconUtils::themedIcon("help-about"));
// buttonShowComments->setToolTip(i18n("Show additional information for the parameters"));
m_menu = new QMenu(this);
if (effectModel->rowCount() > 0) {
m_menu->addAction(KoIconUtils::themedIcon(QStringLiteral("view-refresh")), i18n("Reset Effect"), this, SLOT(slotResetEffect()));
}
m_menu->addAction(KoIconUtils::themedIcon(QStringLiteral("document-save")), i18n("Save Effect"), this, SLOT(slotSaveEffect()));
m_collapse = new KDualAction(i18n("Collapse Effect"), i18n("Expand Effect"), this);
m_collapse->setActiveIcon(KoIconUtils::themedIcon(QStringLiteral("arrow-right")));
m_collapse->setInactiveIcon(KoIconUtils::themedIcon(QStringLiteral("arrow-down")));
collapseButton->setDefaultAction(m_collapse);
connect(m_collapse, &KDualAction::activeChanged, this, &CollapsibleEffectView::slotSwitch);
QHBoxLayout *l = static_cast<QHBoxLayout *>(frame->layout());
m_colorIcon = new QLabel(this);
l->insertWidget(0, m_colorIcon);
m_colorIcon->setMinimumSize(iconSize);
m_colorIcon->setFixedSize(icon.size());
title = new QLabel(this);
l->insertWidget(2, title);
......@@ -130,18 +130,28 @@ CollapsibleEffectView::CollapsibleEffectView(std::shared_ptr<EffectItemModel> ef
m_colorIcon->setPixmap(QPixmap::fromImage(icon));
title->setText(effectName);
if (!m_regionEffect) {
if (m_info.groupIndex == -1) {
m_menu->addAction(m_groupAction);
}
m_menu->addAction(KoIconUtils::themedIcon(QStringLiteral("folder-new")), i18n("Create Region"), this, SLOT(slotCreateRegion()));
}
m_view = new AssetParameterView(this);
m_view->setModel(std::static_pointer_cast<AssetParameterModel>(effectModel));
QVBoxLayout *lay = new QVBoxLayout(widgetFrame);
lay->setContentsMargins(0, 0, 0, 0);
lay->setSpacing(0);
lay->addWidget(m_view);
m_menu = new QMenu(this);
if (effectModel->rowCount() > 0) {
m_menu->addAction(KoIconUtils::themedIcon(QStringLiteral("view-refresh")), i18n("Reset Effect"), this, SLOT(slotResetEffect()));
} else {
collapseButton->setEnabled(false);
m_view->setVisible(false);
}
m_menu->addAction(KoIconUtils::themedIcon(QStringLiteral("document-save")), i18n("Save Effect"), this, SLOT(slotSaveEffect()));
if (!m_regionEffect) {
if (m_info.groupIndex == -1) {
m_menu->addAction(m_groupAction);
}
m_menu->addAction(KoIconUtils::themedIcon(QStringLiteral("folder-new")), i18n("Create Region"), this, SLOT(slotCreateRegion()));
}
//setupWidget(info, metaInfo);
menuButton->setIcon(KoIconUtils::themedIcon(QStringLiteral("kdenlive-menu")));
menuButton->setMenu(m_menu);
......@@ -157,12 +167,6 @@ CollapsibleEffectView::CollapsibleEffectView(std::shared_ptr<EffectItemModel> ef
m_enabledButton->setActive(false);
}
m_collapse = new KDualAction(i18n("Collapse Effect"), i18n("Expand Effect"), this);
m_collapse->setActiveIcon(KoIconUtils::themedIcon(QStringLiteral("arrow-right")));
m_collapse->setInactiveIcon(KoIconUtils::themedIcon(QStringLiteral("arrow-down")));
collapseButton->setDefaultAction(m_collapse);
connect(m_collapse, &KDualAction::activeChanged, this, &CollapsibleEffectView::slotSwitch);
connect(m_enabledButton, SIGNAL(activeChangedByUser(bool)), this, SLOT(slotDisable(bool)));
connect(buttonUp, &QAbstractButton::clicked, this, &CollapsibleEffectView::slotEffectUp);
connect(buttonDown, &QAbstractButton::clicked, this, &CollapsibleEffectView::slotEffectDown);
......@@ -431,8 +435,8 @@ void CollapsibleEffectView::slotResetEffect()
void CollapsibleEffectView::slotSwitch(bool expand)
{
slotShow(expand);
emit switchHeight(m_model, expand ? frame->height() : frame->height() + m_view->contentHeight());
setFixedHeight(expand ? frame->height() : frame->height() + m_view->contentHeight());
emit switchHeight(m_model, expand ? frame->height() + 4 : frame->height() + m_view->contentHeight() + 4);
setFixedHeight(expand ? frame->height() + 4 : frame->height() + m_view->contentHeight() + 4);
widgetFrame->setVisible(!expand);
/*if (!expand) {
widgetFrame->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
......
......@@ -176,7 +176,7 @@ void EffectStackView::loadEffects(int start, int end)
view->buttonDown->setEnabled(i < max - 1);
connect(view, &CollapsibleEffectView::deleteEffect, m_model.get(), &EffectStackModel::removeEffect);
connect(view, &CollapsibleEffectView::moveEffect, m_model.get(), &EffectStackModel::moveEffect);
connect(view, &CollapsibleEffectView::switchHeight, this, &EffectStackView::slotAdjustDelegate);
connect(view, &CollapsibleEffectView::switchHeight, this, &EffectStackView::slotAdjustDelegate, Qt::DirectConnection);
connect(view, &CollapsibleEffectView::startDrag, this, &EffectStackView::slotStartDrag);
connect(view, &CollapsibleEffectView::createGroup, m_model.get(), &EffectStackModel::slotCreateGroup);
connect(view, &CollapsibleEffectView::activateEffect, this, &EffectStackView::slotActivateEffect);
......
......@@ -66,13 +66,13 @@
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>2</number>
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>2</number>
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment