From 6ce839cc08cbe1acc21db2344a6a3a254b38cd74 Mon Sep 17 00:00:00 2001 From: Rob Scheepmaker Date: Mon, 9 Feb 2009 19:21:59 +0000 Subject: [PATCH] 1 regression down! Reenabling and changing one of the layout workarounds fixes the incorrect sizehints problem for detached extenderitems, while still allowing for items on the desktop to be resized, which is even beter then it was in 4.2. I might backport depending on how good this works with Qt4.4 and depending on how complex the patch would become (it would need a few of the changes from my previous monsterpatch). svn path=/trunk/KDE/kdelibs/; revision=923944 --- extender.cpp | 5 ----- extenderitem.cpp | 2 -- private/extenderapplet.cpp | 9 ++++----- private/extenderapplet_p.h | 2 +- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/extender.cpp b/extender.cpp index 655046e19..25166ac10 100644 --- a/extender.cpp +++ b/extender.cpp @@ -509,17 +509,12 @@ void ExtenderPrivate::loadExtenderItems() void ExtenderPrivate::updateBorders() { foreach (ExtenderItem *item, q->attachedItems()) { - kDebug() << "checking" << (QObject*)item << item->d->background->enabledBorders() - << q->enabledBordersForItem(item); if (item && (item->d->background->enabledBorders() != q->enabledBordersForItem(item))) { //call themeChanged to change the backgrounds enabled borders, and move all contained //widgets according to it's changed margins. item->d->themeChanged(); } } - - applet->updateGeometry(); - applet->adjustSize(); } void ExtenderPrivate::updateEmptyExtenderLabel() diff --git a/extenderitem.cpp b/extenderitem.cpp index 572b124a7..51de4e243 100644 --- a/extenderitem.cpp +++ b/extenderitem.cpp @@ -845,11 +845,9 @@ void ExtenderItemPrivate::updateSizeHints() if (extender->d->appearance == Extender::TopDownStacked || extender->d->appearance == Extender::BottomUpStacked) { //used in popups, so fixed make sense. - kDebug() << "updating size hints for stacked look, vertical policy is fixed"; q->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); } else if (extender->d->appearance == Extender::NoBorders) { //on the desktop or panel so take all the space we want. - kDebug() << "updating size hints for no borders look, both policies are expanding"; q->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); } diff --git a/private/extenderapplet.cpp b/private/extenderapplet.cpp index 0a0460b5c..8f552a372 100644 --- a/private/extenderapplet.cpp +++ b/private/extenderapplet.cpp @@ -30,6 +30,7 @@ namespace Plasma ExtenderApplet::ExtenderApplet(QObject *parent, const QVariantList &args) : PopupApplet(parent, args) { + setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); } ExtenderApplet::~ExtenderApplet() @@ -51,8 +52,8 @@ void ExtenderApplet::init() connect(extender(), SIGNAL(itemDetached(Plasma::ExtenderItem*)), this, SLOT(itemDetached(Plasma::ExtenderItem*))); - //connect(extender(), SIGNAL(geometryChanged()), - //this, SLOT(extenderGeometryChanged())); + connect(extender(), SIGNAL(geometryChanged()), + this, SLOT(extenderGeometryChanged())); } void ExtenderApplet::itemDetached(Plasma::ExtenderItem *) @@ -62,7 +63,6 @@ void ExtenderApplet::itemDetached(Plasma::ExtenderItem *) } } -/** void ExtenderApplet::extenderGeometryChanged() { if (formFactor() != Plasma::Horizontal && @@ -76,10 +76,9 @@ void ExtenderApplet::extenderGeometryChanged() setMaximumSize(extender()->maximumSize() + margins); setPreferredSize(extender()->preferredSize() + margins); - adjustSize(); + updateGeometry(); } } -*/ } // namespace Plasma diff --git a/private/extenderapplet_p.h b/private/extenderapplet_p.h index 146c2055d..fb3274b06 100644 --- a/private/extenderapplet_p.h +++ b/private/extenderapplet_p.h @@ -41,7 +41,7 @@ class ExtenderApplet : public Plasma::PopupApplet public Q_SLOTS: void itemDetached(Plasma::ExtenderItem *); - //void extenderGeometryChanged(); + void extenderGeometryChanged(); }; } // namespace Plasma