added icons to effect controls

This commit is contained in:
itsmattkc
2018-12-26 19:12:34 +11:00
parent a487492842
commit f32f012298
9 changed files with 29 additions and 12 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

+5
View File
@@ -51,5 +51,10 @@
<file>error.png</file> <file>error.png</file>
<file>dirup.png</file> <file>dirup.png</file>
<file>dirup-disabled.png</file> <file>dirup-disabled.png</file>
<file>diamond.png</file>
<file>tri-down.png</file>
<file>tri-left.png</file>
<file>tri-right.png</file>
<file>tri-up.png</file>
</qresource> </qresource>
</RCC> </RCC>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+13 -7
View File
@@ -27,29 +27,35 @@ EffectRow::EffectRow(Effect *parent, bool save, QGridLayout *uilayout, const QSt
ui->addWidget(label, row, 0); ui->addWidget(label, row, 0);
if (parent_effect->meta->type != EFFECT_TYPE_TRANSITION) { if (parent_effect->meta->type != EFFECT_TYPE_TRANSITION) {
QSize button_size(20, 20);
QSize icon_size(12, 12); QSize icon_size(12, 12);
QSize button_size(20, 20);
key_controls = new QHBoxLayout(); key_controls = new QHBoxLayout();
key_controls->setSpacing(0); key_controls->setSpacing(0);
key_controls->setMargin(0); key_controls->setMargin(0);
key_controls->addStretch(); key_controls->addStretch();
left_key_nav = new QPushButton("<"); left_key_nav = new QPushButton();
left_key_nav->setVisible(false); left_key_nav->setIcon(QIcon(":/icons/tri-left.png"));
left_key_nav->setMaximumSize(button_size); left_key_nav->setMaximumSize(button_size);
left_key_nav->setIconSize(icon_size);
left_key_nav->setVisible(false);
key_controls->addWidget(left_key_nav); key_controls->addWidget(left_key_nav);
connect(left_key_nav, SIGNAL(clicked(bool)), this, SLOT(goto_previous_key())); connect(left_key_nav, SIGNAL(clicked(bool)), this, SLOT(goto_previous_key()));
key_addremove = new QPushButton("."); key_addremove = new QPushButton();
key_addremove->setVisible(false); key_addremove->setIcon(QIcon(":/icons/diamond.png"));
key_addremove->setMaximumSize(button_size); key_addremove->setMaximumSize(button_size);
key_addremove->setIconSize(QSize(8, 8));
key_addremove->setVisible(false);
key_controls->addWidget(key_addremove); key_controls->addWidget(key_addremove);
connect(key_addremove, SIGNAL(clicked(bool)), this, SLOT(toggle_key())); connect(key_addremove, SIGNAL(clicked(bool)), this, SLOT(toggle_key()));
right_key_nav = new QPushButton(">"); right_key_nav = new QPushButton();
right_key_nav->setVisible(false); right_key_nav->setIcon(QIcon(":/icons/tri-right.png"));
right_key_nav->setMaximumSize(button_size); right_key_nav->setMaximumSize(button_size);
right_key_nav->setIconSize(icon_size);
right_key_nav->setVisible(false);
key_controls->addWidget(right_key_nav); key_controls->addWidget(right_key_nav);
connect(right_key_nav, SIGNAL(clicked(bool)), this, SLOT(goto_next_key())); connect(right_key_nav, SIGNAL(clicked(bool)), this, SLOT(goto_next_key()));
+10 -5
View File
@@ -30,9 +30,9 @@ CollapsibleWidget::CollapsibleWidget(QWidget* parent) : QWidget(parent) {
enabled_check = new CheckboxEx(); enabled_check = new CheckboxEx();
enabled_check->setChecked(true); enabled_check->setChecked(true);
header = new QLabel(); header = new QLabel();
collapse_button = new QPushButton("[-]"); collapse_button = new QPushButton();
collapse_button->setStyleSheet("QPushButton { border: none; } QPushButton:hover { text-decoration: underline; }"); collapse_button->setIconSize(QSize(8, 8));
collapse_button->setMaximumWidth(25); collapse_button->setStyleSheet("QPushButton { border: none; }");
setText("<untitled>"); setText("<untitled>");
title_bar_layout->addWidget(collapse_button); title_bar_layout->addWidget(collapse_button);
title_bar_layout->addWidget(enabled_check); title_bar_layout->addWidget(enabled_check);
@@ -42,6 +42,7 @@ CollapsibleWidget::CollapsibleWidget(QWidget* parent) : QWidget(parent) {
connect(title_bar, SIGNAL(select(bool, bool)), this, SLOT(header_click(bool, bool))); connect(title_bar, SIGNAL(select(bool, bool)), this, SLOT(header_click(bool, bool)));
set_button_icon(true);
contents = NULL; contents = NULL;
} }
@@ -65,7 +66,11 @@ bool CollapsibleWidget::is_focused() {
} }
bool CollapsibleWidget::is_expanded() { bool CollapsibleWidget::is_expanded() {
return contents->isVisible(); return contents->isVisible();
}
void CollapsibleWidget::set_button_icon(bool open) {
collapse_button->setIcon(open ? QIcon(":/icons/tri-down.png") : QIcon(":/icons/tri-right.png"));
} }
void CollapsibleWidget::setContents(QWidget* c) { void CollapsibleWidget::setContents(QWidget* c) {
@@ -88,7 +93,7 @@ void CollapsibleWidget::on_enabled_change(bool b) {
void CollapsibleWidget::on_visible_change() { void CollapsibleWidget::on_visible_change() {
contents->setVisible(!contents->isVisible()); contents->setVisible(!contents->isVisible());
collapse_button->setText(contents->isVisible() ? "[-]" : "[+]"); set_button_icon(contents->isVisible());
emit visibleChanged(); emit visibleChanged();
} }
+1
View File
@@ -42,6 +42,7 @@ private:
QPushButton* collapse_button; QPushButton* collapse_button;
QFrame* line; QFrame* line;
QHBoxLayout* title_bar_layout; QHBoxLayout* title_bar_layout;
void set_button_icon(bool open);
signals: signals:
void deselect_others(QWidget*); void deselect_others(QWidget*);