Commit dd6220ac authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

call leave /enter when selecting workspace. raise timer interval (1 sec)

parent bcecf7b5
......@@ -108,7 +108,7 @@ void dtkWidgetsWorkspaceStackBarItem::setSource(QWidget *source)
this->overview->setObjectName(this->source->objectName());
QTimer *timer = new QTimer(this);
timer->setInterval(250);
timer->setInterval(1000);
timer->setSingleShot(false);
connect(timer, &QTimer::timeout, [=] (void) {
......@@ -179,6 +179,13 @@ void dtkWidgetsWorkspaceStackBar::setStack(QStackedWidget *stack)
dtkWidgetsWorkspaceStackBarItem *item = new dtkWidgetsWorkspaceStackBarItem(i, this);
item->setSource(d->stack->widget(i));
connect(item, &dtkWidgetsWorkspaceStackBarItem::clicked, [=] (int i) {
dtkWidgetsWorkspace *previous = dynamic_cast<dtkWidgetsWorkspace*>(d->stack->currentWidget());
previous->leave();
d->stack->setCurrentIndex(i);
dtkWidgetsWorkspace *current = dynamic_cast<dtkWidgetsWorkspace*>(d->stack->currentWidget());
current->enter();
});
connect(item, SIGNAL(clicked(int)), d->stack, SLOT(setCurrentIndex(int)));
connect(item, &dtkWidgetsWorkspaceStackBarItem::clicked, [=] (int) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment