============================================================================
| 584 | |
| 585 | //============================================================================ |
| 586 | void CDockWidgetTab::setActiveTab(bool active) |
| 587 | { |
| 588 | d->updateCloseButtonVisibility(active); |
| 589 | |
| 590 | if(CDockManager::testConfigFlag(CDockManager::ShowTabTextOnlyForActiveTab) && !d->Icon.isNull()) |
| 591 | { |
| 592 | if(active) |
| 593 | d->TitleLabel->setVisible(true); |
| 594 | else |
| 595 | d->TitleLabel->setVisible(false); |
| 596 | } |
| 597 | |
| 598 | // Focus related stuff |
| 599 | if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting) && !d->DockWidget->dockManager()->isRestoringState()) |
| 600 | { |
| 601 | bool UpdateFocusStyle = false; |
| 602 | if (active && !hasFocus()) |
| 603 | { |
| 604 | //setFocus(Qt::OtherFocusReason); |
| 605 | d->focusController()->setDockWidgetTabFocused(this); |
| 606 | UpdateFocusStyle = true; |
| 607 | } |
| 608 | |
| 609 | if (d->IsActiveTab == active) |
| 610 | { |
| 611 | if (UpdateFocusStyle) |
| 612 | { |
| 613 | updateStyle(); |
| 614 | } |
| 615 | return; |
| 616 | } |
| 617 | } |
| 618 | else if (d->IsActiveTab == active) |
| 619 | { |
| 620 | return; |
| 621 | } |
| 622 | |
| 623 | d->IsActiveTab = active; |
| 624 | updateStyle(); |
| 625 | update(); |
| 626 | updateGeometry(); |
| 627 | |
| 628 | Q_EMIT activeTabChanged(); |
| 629 | } |
| 630 | |
| 631 | |
| 632 | //============================================================================ |
no test coverage detected