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
+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);