KDE/kdebase/workspace/plasma/applets/battery

Loic Marteau loic.marteau at gmail.com
Tue Jul 15 20:07:09 CEST 2008


SVN commit 832880 by lmarteau:

Set both width and height maximum size when changing containment
so we don't break panel when we drag from bottom to left panel
CCMAIL:panel-devel at kde.org
Can someone backport this to the 4.1 branche ?


 M  +2 -3      battery.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/battery/battery.cpp #832879:832880
@@ -110,10 +110,10 @@
 {
     if (constraints & Plasma::FormFactorConstraint | Plasma::SizeConstraint) {
         if (formFactor() == Plasma::Vertical) {
-            setMaximumHeight(qMax(m_textRect.height(), contentsRect().width()));
+            setMaximumSize(QWIDGETSIZE_MAX, qMax(m_textRect.height(), contentsRect().width()));
             //kDebug() << "Vertical FormFactor";
         } else if (formFactor() == Plasma::Horizontal) {
-            setMaximumWidth(qMax(m_textRect.width(), contentsRect().height()));
+            setMaximumSize(qMax(m_textRect.width(), contentsRect().height()), QWIDGETSIZE_MAX);
             //kDebug() << "Horizontal FormFactor" << m_textRect.width() << contentsRect().height();
         }
     }
@@ -125,7 +125,6 @@
     }
 }
 
-
 void Battery::dataUpdated(const QString& source, const Plasma::DataEngine::Data &data)
 {
     if (source.startsWith(I18N_NOOP("Battery"))) {


More information about the Panel-devel mailing list