diff --git a/effects/effect.h b/effects/effect.h index 325406836..89d4dfbf9 100644 --- a/effects/effect.h +++ b/effects/effect.h @@ -154,7 +154,6 @@ public: int gizmo_count(); bool IsEnabled(); - void SetEnabled(bool b); virtual void refresh(); @@ -214,6 +213,7 @@ public: static const EffectMeta* GetInternalMeta(int internal_id, int type); public slots: void FieldChanged(); + void SetEnabled(bool b); signals: void EnabledChanged(bool); private slots: diff --git a/effects/fields/doublefield.cpp b/effects/fields/doublefield.cpp index 18ff66740..42c58488b 100644 --- a/effects/fields/doublefield.cpp +++ b/effects/fields/doublefield.cpp @@ -102,11 +102,12 @@ void DoubleField::UpdateFromWidget(double d) } SetValueAt(Now(), d); - GetParentRow()->SetKeyframeOnAllFields(nullptr); if (!ls->IsDragging() && kdc_ != nullptr) { kdc_->SetNewKeyframes(); + olive::UndoStack.push(kdc_); + kdc_ = nullptr; } } diff --git a/ui/collapsiblewidget.cpp b/ui/collapsiblewidget.cpp index a75ec85a5..fb3e94bc6 100644 --- a/ui/collapsiblewidget.cpp +++ b/ui/collapsiblewidget.cpp @@ -52,7 +52,7 @@ CollapsibleWidget::CollapsibleWidget(QWidget* parent) : QWidget(parent) { header = new QLabel(title_bar); collapse_button = new QPushButton(title_bar); collapse_button->setIconSize(collapse_button->iconSize()*0.5); - collapse_button->setStyleSheet("QPushButton { border: none; }"); + collapse_button->setFlat(true); SetText(tr("")); title_bar_layout->addWidget(collapse_button); title_bar_layout->addWidget(enabled_check); @@ -103,7 +103,7 @@ void CollapsibleWidget::SetContents(QWidget* c) { contents = c; if (!existing) { layout->addWidget(contents); - connect(enabled_check, SIGNAL(toggled(bool)), this, SLOT(on_enabled_change(bool))); + connect(enabled_check, SIGNAL(toggled(bool)), contents, SLOT(setEnabled(bool))); connect(collapse_button, SIGNAL(clicked()), this, SLOT(on_visible_change())); } } @@ -112,10 +112,6 @@ void CollapsibleWidget::SetText(const QString &s) { header->setText(s); } -void CollapsibleWidget::on_enabled_change(bool b) { - contents->setEnabled(b); -} - void CollapsibleWidget::on_visible_change() { contents->setVisible(!contents->isVisible()); set_button_icon(contents->isVisible()); diff --git a/ui/collapsiblewidget.h b/ui/collapsiblewidget.h index ad512bb3a..d13ebd300 100644 --- a/ui/collapsiblewidget.h +++ b/ui/collapsiblewidget.h @@ -72,7 +72,6 @@ signals: void visibleChanged(); private slots: - void on_enabled_change(bool b); void on_visible_change(); public slots: diff --git a/ui/effectui.cpp b/ui/effectui.cpp index f8c60aa37..62652e7ab 100644 --- a/ui/effectui.cpp +++ b/ui/effectui.cpp @@ -78,7 +78,9 @@ EffectUI::EffectUI(Effect* e) : layout_->addWidget(nav, i, maximum_column); } - connect(enabled_check, SIGNAL(clicked(bool)), e, SLOT(FieldChanged())); + enabled_check->setChecked(e->IsEnabled()); + connect(enabled_check, SIGNAL(toggled(bool)), e, SLOT(FieldChanged())); + connect(enabled_check, SIGNAL(toggled(bool)), e, SLOT(SetEnabled(bool))); } Effect *EffectUI::GetEffect()