save the background hints in two vars when they are set, use the second
to restore the ones that were decided before the formfactor change. i.e. no more need to set again and again the hints in formFactorConstraints svn path=/trunk/KDE/kdelibs/; revision=1003180
This commit is contained in:
parent
4063ccde6a
commit
85cb69d28f
12
applet.cpp
12
applet.cpp
@ -835,6 +835,7 @@ void Applet::setBackgroundHints(const BackgroundHints hints)
|
|||||||
}
|
}
|
||||||
|
|
||||||
d->backgroundHints = hints;
|
d->backgroundHints = hints;
|
||||||
|
d->preferredBackgroundHints = hints;
|
||||||
|
|
||||||
//Draw the standard background?
|
//Draw the standard background?
|
||||||
if ((hints & StandardBackground) || (hints & TranslucentBackground)) {
|
if ((hints & StandardBackground) || (hints & TranslucentBackground)) {
|
||||||
@ -1130,11 +1131,11 @@ void Applet::flushPendingConstraintsEvents()
|
|||||||
if (c & Plasma::FormFactorConstraint) {
|
if (c & Plasma::FormFactorConstraint) {
|
||||||
FormFactor f = formFactor();
|
FormFactor f = formFactor();
|
||||||
if (!d->isContainment && f != Vertical && f != Horizontal) {
|
if (!d->isContainment && f != Vertical && f != Horizontal) {
|
||||||
setBackgroundHints(d->backgroundHints | StandardBackground);
|
setBackgroundHints(d->preferredBackgroundHints);
|
||||||
} else if(d->backgroundHints & StandardBackground) {
|
} else {
|
||||||
setBackgroundHints(d->backgroundHints ^ StandardBackground);
|
BackgroundHints hints = d->preferredBackgroundHints;
|
||||||
} else if(d->backgroundHints & TranslucentBackground) {
|
setBackgroundHints(NoBackground);
|
||||||
setBackgroundHints(d->backgroundHints ^ TranslucentBackground);
|
d->preferredBackgroundHints = hints;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d->failed) {
|
if (d->failed) {
|
||||||
@ -2191,6 +2192,7 @@ AppletPrivate::AppletPrivate(KService::Ptr service, int uniqueID, Applet *applet
|
|||||||
: appletId(uniqueID),
|
: appletId(uniqueID),
|
||||||
q(applet),
|
q(applet),
|
||||||
backgroundHints(Applet::NoBackground),
|
backgroundHints(Applet::NoBackground),
|
||||||
|
preferredBackgroundHints(Applet::StandardBackground),
|
||||||
aspectRatioMode(Plasma::KeepAspectRatio),
|
aspectRatioMode(Plasma::KeepAspectRatio),
|
||||||
immutability(Mutable),
|
immutability(Mutable),
|
||||||
appletDescription(service),
|
appletDescription(service),
|
||||||
|
@ -113,6 +113,7 @@ public:
|
|||||||
|
|
||||||
// applet attributes
|
// applet attributes
|
||||||
Applet::BackgroundHints backgroundHints;
|
Applet::BackgroundHints backgroundHints;
|
||||||
|
Applet::BackgroundHints preferredBackgroundHints;
|
||||||
Plasma::AspectRatioMode aspectRatioMode;
|
Plasma::AspectRatioMode aspectRatioMode;
|
||||||
ImmutabilityType immutability;
|
ImmutabilityType immutability;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user