backport the setBackgroundHints() behaviour fix

svn path=/branches/KDE/4.3/kdelibs/; revision=1003188
This commit is contained in:
Marco Martin 2009-07-27 20:23:11 +00:00
parent 5b5037cf7f
commit 758b5740b1
2 changed files with 8 additions and 5 deletions

View File

@ -835,6 +835,7 @@ void Applet::setBackgroundHints(const BackgroundHints hints)
}
d->backgroundHints = hints;
d->preferredBackgroundHints = hints;
//Draw the standard background?
if ((hints & StandardBackground) || (hints & TranslucentBackground)) {
@ -1119,11 +1120,11 @@ void Applet::flushPendingConstraintsEvents()
if (c & Plasma::FormFactorConstraint) {
FormFactor f = formFactor();
if (!d->isContainment && f != Vertical && f != Horizontal) {
setBackgroundHints(d->backgroundHints | StandardBackground);
} else if(d->backgroundHints & StandardBackground) {
setBackgroundHints(d->backgroundHints ^ StandardBackground);
} else if(d->backgroundHints & TranslucentBackground) {
setBackgroundHints(d->backgroundHints ^ TranslucentBackground);
setBackgroundHints(d->preferredBackgroundHints);
} else {
BackgroundHints hints = d->preferredBackgroundHints;
setBackgroundHints(NoBackground);
d->preferredBackgroundHints = hints;
}
if (d->failed) {
@ -2173,6 +2174,7 @@ AppletPrivate::AppletPrivate(KService::Ptr service, int uniqueID, Applet *applet
: appletId(uniqueID),
q(applet),
backgroundHints(Applet::NoBackground),
preferredBackgroundHints(Applet::StandardBackground),
aspectRatioMode(Plasma::KeepAspectRatio),
immutability(Mutable),
appletDescription(service),

View File

@ -113,6 +113,7 @@ public:
// applet attributes
Applet::BackgroundHints backgroundHints;
Applet::BackgroundHints preferredBackgroundHints;
Plasma::AspectRatioMode aspectRatioMode;
ImmutabilityType immutability;