From 3a6c2626650e817533149274e843de49a19852a5 Mon Sep 17 00:00:00 2001 From: Chani Armitage Date: Sat, 22 Mar 2008 18:56:59 +0000 Subject: [PATCH] fix the panel size loading svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=788869 --- containment.cpp | 12 +++++++++++- corona.cpp | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/containment.cpp b/containment.cpp index 7ab37e021..993aeddf5 100644 --- a/containment.cpp +++ b/containment.cpp @@ -198,7 +198,17 @@ void Containment::loadConstraints(KConfigGroup* group) kDebug() << " geom:" << group->readEntry("geometry", geometry()); kDebug() << " formfactor:" << group->readEntry("formfactor", (int)d->formFactor); kDebug() << " screen:" << group->readEntry("screen", d->screen);*/ - setGeometry(group->readEntry("geometry", geometry())); + + QRectF geo = group->readEntry("geometry", geometry()); + //override max/min + if (geo.size() != geo.size().boundedTo(maximumSize())) { + setMaximumSize(maximumSize().expandedTo(geo.size())); + } + if (geo.size() != geo.size().expandedTo(minimumSize())) { + setMinimumSize(minimumSize().boundedTo(geo.size())); + } + setGeometry(geo); + setLocation((Plasma::Location)group->readEntry("location", (int)d->location)); setFormFactor((Plasma::FormFactor)group->readEntry("formfactor", (int)d->formFactor)); setScreen(group->readEntry("screen", d->screen)); diff --git a/corona.cpp b/corona.cpp index b87c0d440..971e6e695 100644 --- a/corona.cpp +++ b/corona.cpp @@ -333,6 +333,7 @@ void Corona::loadDefaultSetup() Containment* panel = addContainment("panel"); panel->setScreen(topLeftScreen); panel->setLocation(Plasma::BottomEdge); + panel->flushUpdatedConstraints(); // some default applets to get a usable UI panel->addApplet("launcher"); @@ -344,7 +345,6 @@ void Corona::loadDefaultSetup() // trigger an instant layout so we immediately have a proper geometry rather than waiting around // for the event loop - panel->flushUpdatedConstraints(); if (panel->layout()) { panel->layout()->invalidate(); }