From 5ec91b2a42472711c8336f4171d011fc8f2363fd Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Fri, 6 Apr 2012 04:46:33 +0200 Subject: [PATCH] improvements to effect stack UI & fix timeline keyframes not refreshing --- icons/CMakeLists.txt | 11 ++- icons/novisible.png | Bin 0 -> 742 bytes icons/visible.png | Bin 0 -> 739 bytes src/clipitem.cpp | 3 +- src/clipitem.h | 2 +- src/customtrackview.cpp | 21 +++--- src/effectstack/collapsibleeffect.cpp | 103 ++++++++++++++------------ src/effectstack/collapsibleeffect.h | 2 +- src/effectstack/collapsiblegroup.cpp | 35 +++++---- src/effectstack/effectstackview2.cpp | 17 +++-- src/widgets/collapsiblegroup_ui.ui | 33 +++------ src/widgets/collapsiblewidget_ui.ui | 33 +++------ src/widgets/keyframeeditor_ui.ui | 19 ++--- 13 files changed, 134 insertions(+), 145 deletions(-) create mode 100644 icons/novisible.png create mode 100644 icons/visible.png diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt index c41644a6..39197800 100644 --- a/icons/CMakeLists.txt +++ b/icons/CMakeLists.txt @@ -1,3 +1,8 @@ -#FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.svg*") -kde4_install_icons( ${DATA_INSTALL_DIR}/kdenlive/icons ) -#install( FILES ${files} DESTINATION ${ICON_INSTALL_DIR} ) +install(FILES + visible.png + novisible.png + DESTINATION ${DATA_INSTALL_DIR}/kdenlive/pics) + +kde4_install_icons( ${ICON_INSTALL_DIR} ) + + diff --git a/icons/novisible.png b/icons/novisible.png new file mode 100644 index 0000000000000000000000000000000000000000..28df3a0dd8cd84bf8e7f194d24acafe894c01ce7 GIT binary patch literal 742 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{3?%2B3|#`GI14-?iy0WWg+Z8+Vb&Z8pdd@S zqpu?a!^Xav-+_~Xe1&9>AYTTCDpdxChGqtapZ|gMO9qBg0|tgy2@DKYGZ+}e^C!h0 zbz@*)R1WY7aRuu6|Nnm)82I`50qM}tPzV=|0punoCc>qF+&_Q*goTCu{{0)G5}B;8 zuLqijEK*QVuyg0mfPes?2?q`wfH1ah-RkM-2^6WSsycDvgs-n}U|`_Iix<7TynuqI zPoMq<28M=)rlzLW*4DPRwvLXD&d$zmZf@S*-bqPGKxNt4*(D_RV=jXHDY%$+-T9zA;W=FOXT@7{g<`0>-HPoF=3{_^F^ z*RNlJ_I&^T{l||VKY#xG_3IbVQ$XMS{rmUdzkdxKQ-1-2$-E@UFBlkXOspKdynOup za`N)}`ugT}_AajO{{Hdt`S}G^_4N(&=g(iie*6CY`_G?0fBpXbx9{J7`SowxnZ=KQ zM!fQLaSV~ToSblkO~OMsH6h`_)W86Nga)P=E2eB@7RdOtsKblFRYb%@wnue>%g&yu z2Ug7x?O7_Y$SY{hp-oY*w0d}atbz&x15?Gz??2d3U>s~~=*zfb#hk^vm-`oZM7V_b z%<1fq5_bu?b?U6Ofr*Zik(HU=y$QjLSxu{Y>jgXv)b#A^{HDh<>6|*XELU7WPE?jT zWR}4DRT>89ZJ6 KT-G@yGywo5c|eW; literal 0 HcmV?d00001 diff --git a/icons/visible.png b/icons/visible.png new file mode 100644 index 0000000000000000000000000000000000000000..9c1f2307168c1cfa2dfc28c9f8c16a374aa40f54 GIT binary patch literal 739 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{3?%2B3|#`GI14-?iy0WWg+Z8+Vb&Z8pdd@S zqpu?a!^Xav-+_~Xe1&9>AYTTCDpdxChGqtapZ|gMO9qBg0|tgy2@DKYGZ+}e^C!h0 zbz@*)G!5_xaRuu6|NnnzXlPnm8YcPv{d-Ko`uh5J@80?O`9Y*IGc%7JI|kHVP*5;+ z>ePUM03aJedU|>S*;Q3lzP`SJfq`CLUO?{Q!-sWrbPNp*jg5^>O--$>t!-^>?d|Oy z9UYyWo!#8ryuH1F>Vt!Wfr_)Uvx|y~Dk>^!YHI50>VQ^HoH%jr+_?)EE?l%|(c;C6 zSFBjEX3d(78#iv+v}xgIzkc)P z&D*zcfj<5C@#CjYpT2(m`u+R&A3uHogKHKkCdsh0%#1v4=4^UKTY>jQn@?;jtZ z4+KD0*4NLUKY#uD{riD7-MEak7aXC5R2%Ch5aB4zAf~bIKYI+0H z42}7#I0a5@T-5Q2!PUj}sZU7d1eckiss~oha1H$_ut>5gGq|dxr#`;c7o^xq;LbkE3Zlqe8WZDXi?yiZ^5wkY$Uc7XgjqqlTkdPw^*Q_m1 zoVs&b?M}eF&bjPbuck>oNL#l0WxljDqsX(C4kOKD$8X=tlKOp9Rkh`X_u-u6pq|f# zUpYRNc=dFDy6~{Qy?I9dg66&6MNTCtD^?oBOlfrW(p9xoR67zlshLrcizUYCQIm{M e!TvxAaR$-D@=ENB3UYxSX7F_Nb6Mw<&;$U!vPs(j literal 0 HcmV?d00001 diff --git a/src/clipitem.cpp b/src/clipitem.cpp index 04082138..3e77c933 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -1371,7 +1371,7 @@ QDomElement ClipItem::getEffectAt(int ix) const return m_effectList.itemFromIndex(ix); } -bool ClipItem::updateEffect(QDomElement effect) +void ClipItem::updateEffect(QDomElement effect) { //kDebug() << "CHange EFFECT AT: " << ix << ", CURR: " << m_effectList.at(ix).attribute("tag") << ", NEW: " << effect.attribute("tag"); m_effectList.updateEffect(effect); @@ -1384,7 +1384,6 @@ bool ClipItem::updateEffect(QDomElement effect) r.setHeight(20); update(r); } - return true; } bool ClipItem::moveEffect(QDomElement effect, int ix) diff --git a/src/clipitem.h b/src/clipitem.h index f5c8a5b8..682bb9fc 100644 --- a/src/clipitem.h +++ b/src/clipitem.h @@ -99,7 +99,7 @@ public: /** @brief Replaces an effect. * @param ix The effect's index in effectlist * @param effect The new effect */ - bool updateEffect(QDomElement effect); + void updateEffect(QDomElement effect); bool moveEffect(QDomElement effect, int ix); void flashClip(); void addTransition(Transition*); diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index bfa14d95..6a28783f 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -1941,13 +1941,12 @@ void CustomTrackView::updateEffect(int track, GenTime pos, QDomElement insertedE if (strobe == 0) strobe = 1; doChangeClipSpeed(clip->info(), clip->speedIndependantInfo(), speed, clip->speed(), strobe, clip->baseClip()->getId()); } - if (clip->updateEffect(effect)) { - if (updateEffectStack && clip->isSelected()) - emit clipItemSelected(clip, ix); - /*if (ix == clip->selectedEffectIndex()) { - clip->setSelectedEffect(ix); - - }*/ + clip->updateEffect(effect); + if (updateEffectStack && clip->isSelected()) + emit clipItemSelected(clip, ix); + if (ix == clip->selectedEffectIndex()) { + // make sure to update display of clip keyframes + clip->setSelectedEffect(ix); } else emit displayMessage(i18n("Problem editing effect"), ErrorMessage); return; } @@ -1972,13 +1971,15 @@ void CustomTrackView::updateEffect(int track, GenTime pos, QDomElement insertedE } bool success = m_document->renderer()->mltEditEffect(m_document->tracksCount() - clip->track(), clip->startPos(), effectParams); - if (success && clip->updateEffect(effect)) { + if (success) { + clip->updateEffect(effect); if (updateEffectStack && clip->isSelected()) { emit clipItemSelected(clip, ix); } - /*if (ix == clip->selectedEffectIndex()) { + if (ix == clip->selectedEffectIndex()) { + // make sure to update display of clip keyframes clip->setSelectedEffect(ix); - }*/ + } } else emit displayMessage(i18n("Problem editing effect"), ErrorMessage); } diff --git a/src/effectstack/collapsibleeffect.cpp b/src/effectstack/collapsibleeffect.cpp index 5dae8b35..ecb28ff2 100644 --- a/src/effectstack/collapsibleeffect.cpp +++ b/src/effectstack/collapsibleeffect.cpp @@ -59,6 +59,7 @@ #include #include #include +#include class Boolval: public QWidget, public Ui::Boolval_UI { @@ -131,7 +132,6 @@ CollapsibleEffect::CollapsibleEffect(QDomElement effect, QDomElement original_ef filterWheelEvent = true; m_info.fromString(effect.attribute("kdenlive_info")); setFont(KGlobalSettings::smallestReadableFont()); - buttonUp->setIcon(KIcon("kdenlive-up")); buttonUp->setToolTip(i18n("Move effect up")); if (!lastEffect) { @@ -157,13 +157,16 @@ CollapsibleEffect::CollapsibleEffect(QDomElement effect, QDomElement original_ef QDomElement namenode = m_effect.firstChildElement("name"); if (namenode.isNull()) return; title->setText(i18n(namenode.text().toUtf8().data())); + /* + * Do not show icon, makes too much visual noise QString type = m_effect.attribute("type", QString()); KIcon icon; if (type == "audio") icon = KIcon("kdenlive-show-audio"); else if (m_effect.attribute("tag") == "region") icon = KIcon("kdenlive-mask-effect"); else if (type == "custom") icon = KIcon("kdenlive-custom-effect"); else icon = KIcon("kdenlive-show-video"); - effecticon->setPixmap(icon.pixmap(16,16)); + effecticon->setPixmap(icon.pixmap(16,16));*/ + m_menu->addAction(KIcon("folder-new"), i18n("Create Group"), this, SLOT(slotCreateGroup())); setupWidget(info, metaInfo); setAcceptDrops(true); @@ -172,14 +175,16 @@ CollapsibleEffect::CollapsibleEffect(QDomElement effect, QDomElement original_ef if (m_effect.attribute("disable") == "1") { title->setEnabled(false); - enabledBox->setChecked(false); + enabledButton->setChecked(true); + enabledButton->setIcon(KIcon("novisible")); } else { - enabledBox->setChecked(true); + enabledButton->setChecked(false); + enabledButton->setIcon(KIcon("visible")); } connect(collapseButton, SIGNAL(clicked()), this, SLOT(slotSwitch())); - connect(enabledBox, SIGNAL(toggled(bool)), this, SLOT(slotEnable(bool))); + 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(slotDeleteEffect())); @@ -208,44 +213,40 @@ CollapsibleEffect::~CollapsibleEffect() const QString CollapsibleEffect::getStyleSheet() { KColorScheme scheme(QApplication::palette().currentColorGroup(), KColorScheme::View, KSharedConfig::openConfig(KdenliveSettings::colortheme())); - QColor dark_bg = scheme.shade(KColorScheme::DarkShade); QColor selected_bg = scheme.decoration(KColorScheme::FocusColor).color(); + QColor hgh = KColorUtils::mix(QApplication::palette().window().color(), selected_bg, 0.2); QColor hover_bg = scheme.decoration(KColorScheme::HoverColor).color(); QColor light_bg = scheme.shade(KColorScheme::LightShade); - //QColor midlight_bg = scheme.shade(KColorScheme::MidlightShade); - QColor normal_bg = scheme.background(KColorScheme::AlternateBackground).color(); QColor alt_bg = scheme.background(KColorScheme::NormalBackground).color(); - KColorScheme scheme2(QApplication::palette().currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme())); - QColor normal_bg2 = scheme2.background(KColorScheme::NormalBackground).color(); - QColor normal_bg3 = scheme2.background(KColorScheme::AlternateBackground).color(); - QString stylesheet; // group editable labels - stylesheet.append(QString("MyEditableLabel { background-color: transparent;} ")); + stylesheet.append(QString("MyEditableLabel { background-color: transparent;color: palette(bright-text);} ")); // effect background - stylesheet.append(QString("QFrame#decoframe {border-radius:5px;border:0px solid %1;background:%3;} QFrame:hover#decoframe {background:%4;} QFrame#decoframe[active=\"true\"] {background:%2;} ").arg(dark_bg.name()).arg(alt_bg.name()).arg(normal_bg2.name()).arg(normal_bg.name())); + 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())); - // effect group background - stylesheet.append(QString("QFrame#decoframegroup {border-radius:5px;border:1px solid %1;background:%2;} QFrame#decoframegroup[active=\"true\"] {background:%3;} ").arg(dark_bg.name()).arg(normal_bg2.name()).arg(alt_bg.name())); + // group background + stylesheet.append(QString("QFrame#decoframegroup {border-top-left-radius:5px;border-top-right-radius:5px;border:2px solid palette(dark);margin:0px;margin-top:2px;} ")); // effect title bar - stylesheet.append(QString("QFrame#frame {border-radius: 5px;} QFrame#frame[active=\"true\"] {background:%1;}").arg(selected_bg.name())); - + stylesheet.append(QString("QFrame#frame {margin-bottom:2px;border-top-left-radius:5px;border-top-right-radius:5px;} QFrame#frame[target=\"true\"] {background: palette(highlight);}")); + // group effect title bar - stylesheet.append(QString("QFrame#framegroup {border-radius: 5px; background: %2;} QFrame#framegroup[active=\"true\"] {background:%1;} ").arg(selected_bg.name()).arg(normal_bg3.name())); - - // draggable effect content bar - stylesheet.append(QString("QProgressBar::chunk:horizontal {background: %1;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal#dragOnly {background: %2;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal:hover {background: %3;}").arg(normal_bg2.name()).arg(alt_bg.name()).arg(selected_bg.name())); + stylesheet.append(QString("QFrame#framegroup {border-top-left-radius:2px;border-top-right-radius:2px;background: palette(dark);} QFrame#framegroup[target=\"true\"] {background: palette(highlight);} ")); - // draggable effect content bar - stylesheet.append(QString("QProgressBar:horizontal {border: 1px solid %1;border-top-left-radius: 4px;border-bottom-left-radius: 4px;border-right:0px;background:%4;padding: 0px;text-align:left center} QProgressBar:horizontal:disabled {border: 1px solid %5} QProgressBar:horizontal#dragOnly {background: %4} QProgressBar:horizontal[inTimeline=\"true\"] { border: 1px solid %2;border-right: 0px;background: %3;padding: 0px;text-align:left center } QProgressBar::chunk:horizontal[inTimeline=\"true\"] {background: %2;}").arg(dark_bg.name()).arg(hover_bg.name()).arg(light_bg.name()).arg(alt_bg.name()).arg(normal_bg2.name())); + // draggable effect bar content + stylesheet.append(QString("QProgressBar::chunk:horizontal {background: palette(button);border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal#dragOnly {background: %1;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal:hover {background: %2;}").arg(alt_bg.name()).arg(selected_bg.name())); + // draggable effect bar + stylesheet.append(QString("QProgressBar:horizontal {border: 1px solid palette(dark);border-top-left-radius: 4px;border-bottom-left-radius: 4px;border-right:0px;background:%3;padding: 0px;text-align:left center} QProgressBar:horizontal:disabled {border: 1px solid palette(button)} QProgressBar:horizontal#dragOnly {background: %3} QProgressBar:horizontal[inTimeline=\"true\"] { border: 1px solid %1;border-right: 0px;background: %2;padding: 0px;text-align:left center } QProgressBar::chunk:horizontal[inTimeline=\"true\"] {background: %1;}").arg(hover_bg.name()).arg(light_bg.name()).arg(alt_bg.name())); // spin box for draggable widget - stylesheet.append(QString("QAbstractSpinBox#dragBox {border: 1px solid %1;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 %4;} QAbstractSpinBox::up-button#dragBox {width:0px;padding:0px;} QAbstractSpinBox[inTimeline=\"true\"]#dragBox { border: 1px solid %2;} QAbstractSpinBox:hover#dragBox {border: 1px solid %3;} ").arg(dark_bg.name()).arg(hover_bg.name()).arg(selected_bg.name()).arg(normal_bg2.name())); + 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())); return stylesheet; } @@ -262,6 +263,11 @@ void CollapsibleEffect::slotUnGroup() bool CollapsibleEffect::eventFilter( QObject * o, QEvent * e ) { + if (e->type() == QEvent::Enter) { + frame->setProperty("mouseover", true); + frame->setStyleSheet(frame->styleSheet()); + return QWidget::eventFilter(o, e); + } if (e->type() == QEvent::Wheel) { QWheelEvent *we = static_cast(e); if (!filterWheelEvent || we->modifiers() != Qt::NoModifier) { @@ -326,29 +332,31 @@ void CollapsibleEffect::setActive(bool activate) void CollapsibleEffect::mouseDoubleClickEvent ( QMouseEvent * event ) { - if (frame->underMouse() && collapseButton->isEnabled()) slotSwitch(); - QWidget::mouseDoubleClickEvent(event); + if (frame->underMouse() && collapseButton->isEnabled()) { + event->accept(); + slotSwitch(); + } + else event->ignore(); } -void CollapsibleEffect::mousePressEvent ( QMouseEvent *event ) +void CollapsibleEffect::mouseReleaseEvent( QMouseEvent *event ) { - - if (!decoframe->property("active").toBool() && !isGroup()) emit activateEffect(effectIndex()); - QWidget::mousePressEvent(event); + if (!decoframe->property("active").toBool()) emit activateEffect(effectIndex()); + QWidget::mouseReleaseEvent(event); } - -void CollapsibleEffect::slotEnable(bool enable) +void CollapsibleEffect::slotEnable(bool disable) { - title->setEnabled(enable); - enabledBox->blockSignals(true); - enabledBox->setChecked(enable); - enabledBox->blockSignals(false); - m_effect.setAttribute("disable", enable ? 0 : 1); - if (enable || KdenliveSettings::disable_effect_parameters()) { - widgetFrame->setEnabled(enable); + title->setEnabled(!disable); + enabledButton->blockSignals(true); + enabledButton->setChecked(disable); + enabledButton->blockSignals(false); + enabledButton->setIcon(disable ? KIcon("novisible") : KIcon("visible")); + m_effect.setAttribute("disable", disable ? 1 : 0); + if (disable || KdenliveSettings::disable_effect_parameters()) { + widgetFrame->setEnabled(!disable); } - emit effectStateChanged(!enable, effectIndex()); + emit effectStateChanged(disable, effectIndex()); } void CollapsibleEffect::slotDeleteEffect() @@ -480,7 +488,7 @@ void CollapsibleEffect::setupWidget(ItemInfo info, EffectMetaInfo *metaInfo) if (m_effect.attribute("tag") == "region") { QVBoxLayout *vbox = new QVBoxLayout(widgetFrame); - vbox->setContentsMargins(2, 0, 2, 0); + vbox->setContentsMargins(0, 0, 0, 0); vbox->setSpacing(2); QDomNodeList effects = m_effect.elementsByTagName("effect"); QDomNodeList origin_effects = m_original_effect.elementsByTagName("effect"); @@ -545,7 +553,7 @@ void CollapsibleEffect::slotSyncEffectsPos(int pos) void CollapsibleEffect::dragEnterEvent(QDragEnterEvent *event) { if (event->mimeData()->hasFormat("kdenlive/effectslist")) { - frame->setProperty("active", true); + frame->setProperty("target", true); frame->setStyleSheet(frame->styleSheet()); event->acceptProposedAction(); } @@ -553,13 +561,13 @@ void CollapsibleEffect::dragEnterEvent(QDragEnterEvent *event) void CollapsibleEffect::dragLeaveEvent(QDragLeaveEvent */*event*/) { - frame->setProperty("active", false); + frame->setProperty("target", false); frame->setStyleSheet(frame->styleSheet()); } void CollapsibleEffect::dropEvent(QDropEvent *event) { - frame->setProperty("active", false); + frame->setProperty("target", false); frame->setStyleSheet(frame->styleSheet()); const QString effects = QString::fromUtf8(event->mimeData()->data("kdenlive/effectslist")); //event->acceptProposedAction(); @@ -607,7 +615,7 @@ ParameterContainer::ParameterContainer(QDomElement effect, ItemInfo info, Effect bool stretch = true; m_vbox = new QVBoxLayout(parent); - m_vbox->setContentsMargins(2, 0, 2, 0); + m_vbox->setContentsMargins(4, 0, 4, 0); m_vbox->setSpacing(2); for (int i = 0; i < namenode.count() ; i++) { @@ -1216,8 +1224,9 @@ void ParameterContainer::slotCollectAllParameters() QString val = m_keyframeEditor->getValue(realName); elem.setAttribute("keyframes", val); - if (m_keyframeEditor->isVisibleParam(realName)) + if (m_keyframeEditor->isVisibleParam(realName)) { elem.setAttribute("intimeline", "1"); + } else if (elem.hasAttribute("intimeline")) elem.removeAttribute("intimeline"); } else if (type == "url") { diff --git a/src/effectstack/collapsibleeffect.h b/src/effectstack/collapsibleeffect.h index 30ab1547..6b12a873 100644 --- a/src/effectstack/collapsibleeffect.h +++ b/src/effectstack/collapsibleeffect.h @@ -177,7 +177,7 @@ private: protected: virtual void mouseDoubleClickEvent ( QMouseEvent * event ); - virtual void mousePressEvent ( QMouseEvent * event ); + virtual void mouseReleaseEvent( QMouseEvent *event ); virtual void dragEnterEvent(QDragEnterEvent *event); virtual void dragLeaveEvent(QDragLeaveEvent *event); virtual void dropEvent(QDropEvent *event); diff --git a/src/effectstack/collapsiblegroup.cpp b/src/effectstack/collapsiblegroup.cpp index 3c43a678..d46e20f9 100644 --- a/src/effectstack/collapsiblegroup.cpp +++ b/src/effectstack/collapsiblegroup.cpp @@ -62,7 +62,7 @@ CollapsibleGroup::CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, QStr setFont(KGlobalSettings::smallestReadableFont()); QHBoxLayout *l = static_cast (framegroup->layout()); m_title = new MyEditableLabel(this); - l->insertWidget(4, m_title); + l->insertWidget(3, m_title); m_title->setText(groupName.isEmpty() ? i18n("Effect Group") : groupName); connect(m_title, SIGNAL(editingFinished()), this, SLOT(slotRenameGroup())); buttonUp->setIcon(KIcon("kdenlive-up")); @@ -78,16 +78,16 @@ CollapsibleGroup::CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, QStr m_menu->addAction(KIcon("view-refresh"), i18n("Reset Group"), this, SLOT(slotResetGroup())); m_menu->addAction(KIcon("document-save"), i18n("Save Group"), this, SLOT(slotSaveGroup())); - effecticon->setPixmap(KIcon("folder").pixmap(16,16)); m_menu->addAction(KIcon("list-remove"), i18n("Ungroup"), this, SLOT(slotUnGroup())); setAcceptDrops(true); menuButton->setIcon(KIcon("kdenlive-menu")); menuButton->setMenu(m_menu); - enabledBox->setChecked(true); + enabledButton->setChecked(false); + enabledButton->setIcon(KIcon("visible")); connect(collapseButton, SIGNAL(clicked()), this, SLOT(slotSwitch())); - connect(enabledBox, SIGNAL(toggled(bool)), this, SLOT(slotEnable(bool))); + 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())); @@ -122,18 +122,15 @@ void CollapsibleGroup::mouseDoubleClickEvent ( QMouseEvent * event ) } -void CollapsibleGroup::slotEnable(bool enable) +void CollapsibleGroup::slotEnable(bool disable) { - m_title->setEnabled(enable); - enabledBox->blockSignals(true); - enabledBox->setChecked(enable); - enabledBox->blockSignals(false); - QVBoxLayout *vbox = static_cast(widgetFrame->layout()); - if (vbox == NULL) return; - for (int i = 0; i < vbox->count(); i++) { - CollapsibleGroup *e = static_cast(vbox->itemAt(i)->widget()); - if (e) e->enabledBox->setChecked(enable);// slotEnable(enable); - } + m_title->setEnabled(!disable); + enabledButton->blockSignals(true); + enabledButton->setChecked(disable); + enabledButton->setIcon(disable ? KIcon("novisible") : KIcon("visible")); + enabledButton->blockSignals(false); + for (int i = 0; i < m_subWidgets.count(); i++) + m_subWidgets.at(i)->slotEnable(disable); } void CollapsibleGroup::slotDeleteGroup() @@ -234,6 +231,7 @@ void CollapsibleGroup::addGroupEffect(CollapsibleEffect *effect) } effect->setGroupIndex(groupIndex()); effect->setGroupName(m_title->text()); + effect->decoframe->setObjectName("decoframesub"); m_subWidgets.append(effect); vbox->addWidget(effect); } @@ -251,6 +249,7 @@ void CollapsibleGroup::removeGroup(int ix, QVBoxLayout *layout) for (int i = m_subWidgets.count() - 1; i >= 0 ; i--) { vbox->removeWidget(m_subWidgets.at(i)); layout->insertWidget(ix, m_subWidgets.at(i)); + m_subWidgets.at(i)->decoframe->setObjectName("decoframe"); m_subWidgets.at(i)->removeFromGroup(); } m_subWidgets.clear(); @@ -279,7 +278,7 @@ void CollapsibleGroup::updateTimecodeFormat() void CollapsibleGroup::dragEnterEvent(QDragEnterEvent *event) { if (event->mimeData()->hasFormat("kdenlive/effectslist")) { - framegroup->setProperty("active", true); + framegroup->setProperty("target", true); framegroup->setStyleSheet(framegroup->styleSheet()); event->acceptProposedAction(); } @@ -287,13 +286,13 @@ void CollapsibleGroup::dragEnterEvent(QDragEnterEvent *event) void CollapsibleGroup::dragLeaveEvent(QDragLeaveEvent */*event*/) { - framegroup->setProperty("active", false); + framegroup->setProperty("target", false); framegroup->setStyleSheet(framegroup->styleSheet()); } void CollapsibleGroup::dropEvent(QDropEvent *event) { - framegroup->setProperty("active", false); + framegroup->setProperty("target", false); framegroup->setStyleSheet(framegroup->styleSheet()); const QString effects = QString::fromUtf8(event->mimeData()->data("kdenlive/effectslist")); //event->acceptProposedAction(); diff --git a/src/effectstack/effectstackview2.cpp b/src/effectstack/effectstackview2.cpp index dabad6e0..8d64110e 100644 --- a/src/effectstack/effectstackview2.cpp +++ b/src/effectstack/effectstackview2.cpp @@ -445,7 +445,7 @@ void EffectStackView2::slotUpdateCheckAllButton() bool hasDisabled = false; for (int i = 0; i < m_effects.count(); i++) { - if (m_effects.at(i)->enabledBox->isChecked()) hasEnabled = true; + if (!m_effects.at(i)->enabledButton->isChecked()) hasEnabled = true; else hasDisabled = true; } @@ -505,15 +505,16 @@ void EffectStackView2::slotUpdateEffectParams(const QDomElement old, const QDomE void EffectStackView2::slotSetCurrentEffect(int ix) { - if (m_clipref && ix != m_clipref->selectedEffectIndex()) + if (m_clipref && ix != m_clipref->selectedEffectIndex()) { m_clipref->setSelectedEffect(ix); - for (int i = 0; i < m_effects.count(); i++) { - if (m_effects.at(i)->effectIndex() == ix) { - m_effects.at(i)->setActive(true); - m_ui.labelComment->setText(i18n(m_effects.at(i)->effect().firstChildElement("description").firstChildElement("full").text().toUtf8().data())); - m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty()); + for (int i = 0; i < m_effects.count(); i++) { + if (m_effects.at(i)->effectIndex() == ix) { + m_effects.at(i)->setActive(true); + m_ui.labelComment->setText(i18n(m_effects.at(i)->effect().firstChildElement("description").firstChildElement("full").text().toUtf8().data())); + m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty()); + } + else m_effects.at(i)->setActive(false); } - else m_effects.at(i)->setActive(false); } } diff --git a/src/widgets/collapsiblegroup_ui.ui b/src/widgets/collapsiblegroup_ui.ui index 16519b55..5c97c3dd 100644 --- a/src/widgets/collapsiblegroup_ui.ui +++ b/src/widgets/collapsiblegroup_ui.ui @@ -79,23 +79,21 @@ - - - Qt::Vertical + + + + 22 + 22 + - - - - - + ... - - - - - - + + true + + + true @@ -197,13 +195,6 @@ - - - KSeparator - QFrame -
kseparator.h
-
-
diff --git a/src/widgets/collapsiblewidget_ui.ui b/src/widgets/collapsiblewidget_ui.ui index 658d0b5c..0bcceb8e 100644 --- a/src/widgets/collapsiblewidget_ui.ui +++ b/src/widgets/collapsiblewidget_ui.ui @@ -79,23 +79,21 @@ - - - Qt::Vertical + + + + 22 + 22 + - - - - - + ... - - - - - - + + true + + + true @@ -204,13 +202,6 @@ - - - KSeparator - QFrame -
kseparator.h
-
-
diff --git a/src/widgets/keyframeeditor_ui.ui b/src/widgets/keyframeeditor_ui.ui index 122925d4..c7fea529 100644 --- a/src/widgets/keyframeeditor_ui.ui +++ b/src/widgets/keyframeeditor_ui.ui @@ -6,8 +6,8 @@ 0 0 - 343 - 178 + 267 + 157 @@ -20,21 +20,21 @@ 0 - + Qt::Horizontal - + QFrame::NoFrame - + @@ -108,14 +108,7 @@ - - - - Qt::Horizontal - - - - + Add keyframes -- 2.39.5