when overriding the size policy, save the old one, should unbork a little contaiment switching
svn path=/trunk/KDE/kdelibs/; revision=1117160
This commit is contained in:
parent
43240c4c19
commit
7517afa198
@ -1263,10 +1263,16 @@ void Applet::flushPendingConstraintsEvents()
|
|||||||
if (c & Plasma::SizeConstraint || c & Plasma::FormFactorConstraint) {
|
if (c & Plasma::SizeConstraint || c & Plasma::FormFactorConstraint) {
|
||||||
if (aspectRatioMode() == Plasma::Square || aspectRatioMode() == Plasma::ConstrainedSquare) {
|
if (aspectRatioMode() == Plasma::Square || aspectRatioMode() == Plasma::ConstrainedSquare) {
|
||||||
// enforce square size in panels
|
// enforce square size in panels
|
||||||
|
//save the old size policy. since ignored doesn't (yet) have a valid use case in containments, use it as special unset value
|
||||||
|
if (d->preferredSizePolicy == QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored)) {
|
||||||
|
d->preferredSizePolicy = sizePolicy();
|
||||||
|
}
|
||||||
if (formFactor() == Horizontal) {
|
if (formFactor() == Horizontal) {
|
||||||
setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding));
|
setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding));
|
||||||
} else if (formFactor() == Vertical) {
|
} else if (formFactor() == Vertical) {
|
||||||
setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
|
setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
|
||||||
|
} else if (d->preferredSizePolicy != QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored)) {
|
||||||
|
setSizePolicy(d->preferredSizePolicy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
@ -2567,6 +2573,7 @@ AppletPrivate::AppletPrivate(KService::Ptr service, int uniqueID, Applet *applet
|
|||||||
activationAction(0),
|
activationAction(0),
|
||||||
shortcutEditor(0),
|
shortcutEditor(0),
|
||||||
itemStatus(UnknownStatus),
|
itemStatus(UnknownStatus),
|
||||||
|
preferredSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored),
|
||||||
modificationsTimer(0),
|
modificationsTimer(0),
|
||||||
hasConfigurationInterface(false),
|
hasConfigurationInterface(false),
|
||||||
failed(false),
|
failed(false),
|
||||||
|
@ -164,6 +164,9 @@ public:
|
|||||||
QString remoteLocation;
|
QString remoteLocation;
|
||||||
Ui::publishWidget publishUI;
|
Ui::publishWidget publishUI;
|
||||||
|
|
||||||
|
// the applet can change size policy by itself, so save the old one for eventual restore
|
||||||
|
QSizePolicy preferredSizePolicy;
|
||||||
|
|
||||||
// timerEvent bookkeeping
|
// timerEvent bookkeeping
|
||||||
QBasicTimer constraintsTimer;
|
QBasicTimer constraintsTimer;
|
||||||
QBasicTimer busyWidgetTimer;
|
QBasicTimer busyWidgetTimer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user