diff --git a/clients/aurorae/src/lib/auroraescene.cpp b/clients/aurorae/src/lib/auroraescene.cpp index e24a78d4ad..832c27c302 100644 --- a/clients/aurorae/src/lib/auroraescene.cpp +++ b/clients/aurorae/src/lib/auroraescene.cpp @@ -820,6 +820,12 @@ void AuroraeScene::addTab(const QString &caption) static_cast(m_title->layout())->addItem(tab); tab->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); m_title->layout()->invalidate(); + // have to call active changed on each tab to update shadow effect + foreach (QGraphicsItem *item, items()) { + if (AuroraeTab *tab = dynamic_cast(item)) { + tab->activeChanged(); + } + } } void AuroraeScene::addTabs(const QStringList &captions) @@ -841,10 +847,16 @@ void AuroraeScene::removeLastTab() removeItem(tab); --m_tabCount; m_title->layout()->invalidate(); - return; + break; } } } + // have to call active changed on each tab to update shadow effect + foreach (QGraphicsItem *item, items()) { + if (AuroraeTab *tab = dynamic_cast(item)) { + tab->activeChanged(); + } + } } int AuroraeScene::tabCount() const diff --git a/clients/aurorae/src/lib/auroraetab.cpp b/clients/aurorae/src/lib/auroraetab.cpp index cab8bed498..eeb4a717cb 100644 --- a/clients/aurorae/src/lib/auroraetab.cpp +++ b/clients/aurorae/src/lib/auroraetab.cpp @@ -57,11 +57,22 @@ AuroraeTab::~AuroraeTab() void AuroraeTab::activeChanged() { + if (scene() == NULL) { + return; + } const ThemeConfig &config = m_theme->themeConfig(); if (!config.useTextShadow()) { return; } - const bool active = static_cast(scene())->isActive(); + AuroraeScene *s = static_cast(scene()); + if (s->tabCount() > 1) { + // graphics effect seems to be not side effect free and drops scheduled updates + // rendering tabs unreadable, therefore disabled. + m_effect->setEnabled(false); + } else { + m_effect->setEnabled(true); + } + const bool active = s->isActive(); m_effect->setXOffset(config.textShadowOffsetX()); m_effect->setYOffset(config.textShadowOffsetY()); m_effect->setColor(active ? config.activeTextShadowColor() : config.inactiveTextShadowColor());