This commit is contained in:
itsmattkc
2019-03-22 02:19:29 +11:00
parent 067eec0b90
commit ff6848d1b6
5 changed files with 28 additions and 5 deletions
+12 -1
View File
@@ -123,7 +123,8 @@ Effect::Effect(Clip* c, const EffectMeta *em) :
isOpen(false),
bound(false),
iterations(1),
enabled_(true)
enabled_(true),
expanded_(true)
{
if (em != nullptr) {
// set up UI from effect file
@@ -508,6 +509,16 @@ bool Effect::IsEnabled() {
return enabled_;
}
bool Effect::IsExpanded()
{
return expanded_;
}
void Effect::SetExpanded(bool e)
{
expanded_ = e;
}
void Effect::SetEnabled(bool b) {
enabled_ = b;
emit EnabledChanged(b);
+3
View File
@@ -154,6 +154,7 @@ public:
int gizmo_count();
bool IsEnabled();
bool IsExpanded();
virtual void refresh();
@@ -214,6 +215,7 @@ public:
public slots:
void FieldChanged();
void SetEnabled(bool b);
void SetExpanded(bool e);
signals:
void EnabledChanged(bool);
private slots:
@@ -243,6 +245,7 @@ private:
int iterations;
bool enabled_;
bool expanded_;
int flags_;
+8 -3
View File
@@ -87,6 +87,13 @@ bool CollapsibleWidget::IsExpanded() {
return contents->isVisible();
}
void CollapsibleWidget::SetExpanded(bool s)
{
contents->setVisible(s);
set_button_icon(s);
emit visibleChanged(s);
}
bool CollapsibleWidget::IsSelected()
{
return selected;
@@ -116,9 +123,7 @@ void CollapsibleWidget::SetTitle(const QString &s) {
}
void CollapsibleWidget::on_visible_change() {
contents->setVisible(!contents->isVisible());
set_button_icon(contents->isVisible());
emit visibleChanged();
SetExpanded(!IsExpanded());
}
CollapsibleWidgetHeader::CollapsibleWidgetHeader(QWidget* parent) : QWidget(parent), selected(false) {
+2 -1
View File
@@ -52,6 +52,7 @@ public:
void SetTitle(const QString &);
bool IsFocused();
bool IsExpanded();
void SetExpanded(bool s);
bool IsSelected();
protected:
QCheckBox* enabled_check;
@@ -68,7 +69,7 @@ private:
signals:
void deselect_others(QWidget*);
void visibleChanged();
void visibleChanged(bool);
private slots:
void on_visible_change();
+3
View File
@@ -68,6 +68,9 @@ EffectUI::EffectUI(Effect* e) :
QWidget* ui = new QWidget(this);
SetContents(ui);
SetExpanded(e->IsExpanded());
connect(this, SIGNAL(visibleChanged(bool)), e, SLOT(SetExpanded(bool)));
layout_ = new QGridLayout(ui);
layout_->setSpacing(4);