Changeset View
Changeset View
Standalone View
Standalone View
sublime/container.cpp
Show First 20 Lines • Show All 499 Lines • ▼ Show 20 Line(s) | |||||
500 | 500 | | |||
501 | QWidget* Container::currentWidget() const | 501 | QWidget* Container::currentWidget() const | ||
502 | { | 502 | { | ||
503 | return d->stack->currentWidget(); | 503 | return d->stack->currentWidget(); | ||
504 | } | 504 | } | ||
505 | 505 | | |||
506 | void Container::setCurrentWidget(QWidget* w) | 506 | void Container::setCurrentWidget(QWidget* w) | ||
507 | { | 507 | { | ||
508 | | ||||
509 | if (d->stack->currentWidget() == w) { | ||||
510 | return; | ||||
511 | } | ||||
508 | d->stack->setCurrentWidget(w); | 512 | d->stack->setCurrentWidget(w); | ||
509 | //prevent from emitting activateView() signal on tabbar active tab change | | |||
510 | //this function is called from MainWindow::activateView() | | |||
511 | //which does the activation without any additional signals | | |||
512 | { | | |||
513 | QSignalBlocker blocker(d->tabBar); | | |||
514 | d->tabBar->setCurrentIndex(d->stack->indexOf(w)); | 513 | d->tabBar->setCurrentIndex(d->stack->indexOf(w)); | ||
515 | } | | |||
516 | if (View* view = viewForWidget(w)) | 514 | if (View* view = viewForWidget(w)) | ||
517 | { | 515 | { | ||
518 | statusChanged(view); | 516 | statusChanged(view); | ||
519 | if (!d->tabBar->isVisible()) | 517 | if (!d->tabBar->isVisible()) | ||
520 | { | 518 | { | ||
521 | // repaint icon and document title only in tabbar-less mode | 519 | // repaint icon and document title only in tabbar-less mode | ||
522 | // tabbar will do repainting for us | 520 | // tabbar will do repainting for us | ||
523 | statusIconChanged( view->document() ); | 521 | statusIconChanged( view->document() ); | ||
▲ Show 20 Lines • Show All 232 Lines • Show Last 20 Lines |