connected effect UI to enabled setting

This commit is contained in:
itsmattkc
2019-03-13 22:46:53 +11:00
parent 933cbb0304
commit e3e322ca53
5 changed files with 8 additions and 10 deletions
+1 -1
View File
@@ -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:
+2 -1
View File
@@ -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;
}
}
+2 -6
View File
@@ -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("<untitled>"));
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());
-1
View File
@@ -72,7 +72,6 @@ signals:
void visibleChanged();
private slots:
void on_enabled_change(bool b);
void on_visible_change();
public slots:
+3 -1
View File
@@ -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()