correctly enable/disable shadow

This commit is contained in:
Marco Martin 2014-08-20 18:01:47 +02:00
parent c7d16008d7
commit a135c4de7d

View File

@ -155,7 +155,7 @@ void DialogPrivate::syncBorders()
}
}
if (q->isVisible()) {
if (q->isVisible() && backgroundHints != Dialog::NoBackground) {
DialogShadows::self()->addWindow(q, frameSvgItem->enabledBorders());
}
}
@ -167,6 +167,7 @@ void DialogPrivate::updateTheme()
KWindowEffects::enableBlurBehind(q->winId(), false);
KWindowEffects::enableBackgroundContrast(q->winId(), false);
q->setMask(QRegion());
DialogShadows::self()->removeWindow(q);
} else {
if (type == Dialog::Tooltip) {
frameSvgItem->setImagePath("widgets/tooltip");
@ -187,6 +188,9 @@ void DialogPrivate::updateTheme()
} else {
q->setMask(frameSvgItem->frameSvg()->mask());
}
if (q->isVisible()) {
DialogShadows::self()->addWindow(q, frameSvgItem->enabledBorders());
}
}
updateInputShape();
}
@ -845,7 +849,9 @@ void Dialog::focusOutEvent(QFocusEvent *ev)
void Dialog::showEvent(QShowEvent *event)
{
DialogShadows::self()->addWindow(this, d->frameSvgItem->enabledBorders());
if (d->backgroundHints != Dialog::NoBackground) {
DialogShadows::self()->addWindow(this, d->frameSvgItem->enabledBorders());
}
QQuickWindow::showEvent(event);
}