void Configurator::removeTween(const QString &name) { if (k->tweenManager->listSize() == 0) activeButtonsPanel(false); emit clickedRemoveTween(name); }
void Configurator::setButtonsPanel() { k->controlPanel = new ButtonsPanel(this); connect(k->controlPanel, SIGNAL(clickedEditTween()), this, SLOT(editTween())); connect(k->controlPanel, SIGNAL(clickedRemoveTween()), this, SLOT(removeTween())); k->settingsLayout->addWidget(k->controlPanel); activeButtonsPanel(false); }
ButtonsPanel::ButtonsPanel(QWidget *parent) : QWidget(parent) { TImageButton *editButton = new TImageButton(QPixmap(kAppProp->themeDir() + "/" + "icons/tweening.png"), 22); editButton->setToolTip(tr("Edit Tween")); connect(editButton, SIGNAL(clicked()), this, SIGNAL(clickedEditTween())); TImageButton *removeButton = new TImageButton(QPixmap(kAppProp->themeDir() + "/" + "icons/minus_sign.png"), 22); removeButton->setToolTip(tr("Remove Tween")); connect(removeButton, SIGNAL(clicked()), this, SIGNAL(clickedRemoveTween())); QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom, this); layout->setAlignment(Qt::AlignHCenter | Qt::AlignBottom); QHBoxLayout *controlLayout = new QHBoxLayout; controlLayout->setAlignment(Qt::AlignHCenter | Qt::AlignTop); controlLayout->setMargin(1); controlLayout->setSpacing(5); controlLayout->addWidget(editButton); controlLayout->addWidget(removeButton); layout->addLayout(controlLayout); }