diff --git a/src/app/GUI/BoxesList/boxsinglewidget.cpp b/src/app/GUI/BoxesList/boxsinglewidget.cpp index ca168a66a..96a7a6e4e 100644 --- a/src/app/GUI/BoxesList/boxsinglewidget.cpp +++ b/src/app/GUI/BoxesList/boxsinglewidget.cpp @@ -177,12 +177,12 @@ BoxSingleWidget::BoxSingleWidget(BoxScroller * const parent) } else if (const auto eEff = enve_cast(target)) { if (eEff->isVisible()) { return BoxSingleWidget::VISIBLE_ICON; } return BoxSingleWidget::INVISIBLE_ICON; - } else if (enve_cast(target)) { + } /*else if (enve_cast(target)) { const auto bsvt = static_cast(mParent); const auto keysView = bsvt->getKeysView(); if (keysView) { return BoxSingleWidget::GRAPH_PROPERTY_ICON; } return static_cast(nullptr); - } + }*/ return static_cast(nullptr); }); @@ -382,6 +382,24 @@ void BoxSingleWidget::setComboProperty(ComboBoxProperty* const combo) { mPropertyComboBox->show(); } +void BoxSingleWidget::handlePropertySelectedChanged(const Property *prop) +{ + if (const auto graph = enve_cast(prop)) { + const auto bsvt = static_cast(mParent); + const auto keysView = bsvt->getKeysView(); + if (keysView) { + const bool graphSelected = keysView->graphIsSelected(graph); + const bool isSelected = prop->prp_isSelected(); + if (graphSelected) { + if (!isSelected) { keysView->graphRemoveViewedAnimator(graph); } + } else { + if (isSelected) { keysView->graphAddViewedAnimator(graph); } + } + Document::sInstance->actionFinished(); + } + } +} + ColorAnimator *BoxSingleWidget::getColorTarget() const { const auto swt = mTarget->getTarget(); ColorAnimator * color = nullptr; @@ -561,6 +579,8 @@ void BoxSingleWidget::setTargetAbstraction(SWT_Abstraction *abs) { if(!boundingBox && !eindependentSound) { mTargetConn << connect(prop, &Property::prp_selectionChanged, this, qOverload<>(&QWidget::update)); + mTargetConn << connect(prop, &Property::prp_selectionChanged, + this, [this, prop]() { handlePropertySelectedChanged(prop); }); } mValueSlider->setVisible(valueSliderVisible); @@ -878,7 +898,7 @@ void BoxSingleWidget::switchBoxVisibleAction() { ebos->switchVisible(); } else if(const auto eEff = enve_cast(target)) { eEff->switchVisible(); - } else if(const auto graph = enve_cast(target)) { + } /*else if(const auto graph = enve_cast(target)) { const auto bsvt = static_cast(mParent); const auto keysView = bsvt->getKeysView(); if(keysView) { @@ -889,7 +909,7 @@ void BoxSingleWidget::switchBoxVisibleAction() { } Document::sInstance->actionFinished(); } - } + }*/ Document::sInstance->actionFinished(); update(); } diff --git a/src/app/GUI/BoxesList/boxsinglewidget.h b/src/app/GUI/BoxesList/boxsinglewidget.h index 0363c4047..0989a5b31 100644 --- a/src/app/GUI/BoxesList/boxsinglewidget.h +++ b/src/app/GUI/BoxesList/boxsinglewidget.h @@ -134,6 +134,8 @@ class BoxSingleWidget : public SingleWidget { void setComboProperty(ComboBoxProperty * const combo); + void handlePropertySelectedChanged(const Property *prop); + BoxScroller* const mParent; bool mDragPressPos = false;