use windowTranslucencyEnabled() instead of caching the value frm kwindowsystem

svn path=/trunk/KDE/kdelibs/; revision=1069170
This commit is contained in:
Marco Martin 2010-01-02 20:48:44 +00:00
parent 6d3387453d
commit 429b000af3

View File

@ -97,7 +97,6 @@ public:
QTimer *moveTimer; QTimer *moveTimer;
QTimer *adjustViewTimer; QTimer *adjustViewTimer;
Plasma::AspectRatioMode aspectRatioMode; Plasma::AspectRatioMode aspectRatioMode;
bool compositingActive;
}; };
void DialogPrivate::themeChanged() void DialogPrivate::themeChanged()
@ -107,8 +106,12 @@ void DialogPrivate::themeChanged()
qreal rightWidth; qreal rightWidth;
qreal bottomHeight; qreal bottomHeight;
compositingActive = KWindowSystem::compositingActive();
//kDebug() << leftWidth << topHeight << rightWidth << bottomHeight; //kDebug() << leftWidth << topHeight << rightWidth << bottomHeight;
if (Plasma::Theme::defaultTheme()->windowTranslucencyEnabled()) {
q->setMask(background->mask());
} else {
q->setMask(QRect(QPoint(0, 0), q->size()));
}
FrameSvg::EnabledBorders borders = FrameSvg::AllBorders; FrameSvg::EnabledBorders borders = FrameSvg::AllBorders;
@ -287,8 +290,6 @@ Dialog::Dialog(QWidget *parent, Qt::WindowFlags f)
pal.setColor(backgroundRole(), Qt::transparent); pal.setColor(backgroundRole(), Qt::transparent);
setPalette(pal); setPalette(pal);
d->compositingActive = KWindowSystem::compositingActive();
d->adjustViewTimer = new QTimer(this); d->adjustViewTimer = new QTimer(this);
d->adjustViewTimer->setSingleShot(true); d->adjustViewTimer->setSingleShot(true);
connect(d->adjustViewTimer, SIGNAL(timeout()), this, SLOT(adjustView())); connect(d->adjustViewTimer, SIGNAL(timeout()), this, SLOT(adjustView()));
@ -436,7 +437,7 @@ void Dialog::resizeEvent(QResizeEvent *e)
{ {
d->background->resizeFrame(e->size()); d->background->resizeFrame(e->size());
if (!d->compositingActive) { if (Plasma::Theme::defaultTheme()->windowTranslucencyEnabled()) {
setMask(d->background->mask()); setMask(d->background->mask());
} else { } else {
setMask(QRect(QPoint(0, 0), size())); setMask(QRect(QPoint(0, 0), size()));