[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/generic/applets/battery
From:       Aurélien Gâteau <agateau () kde ! org>
Date:       2010-12-24 13:46:10
Message-ID: 20101224134610.98D8CAC8B0 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1209082 by gateau:

Make sure the widget gets wide enough to fit wide texts.

BUG: 258044

 M  +10 -1     battery.cpp  


--- trunk/KDE/kdebase/workspace/plasma/generic/applets/battery/battery.cpp #1209081:1209082
@@ -488,9 +488,18 @@
         int row = 0;
 
         m_controls = new QGraphicsWidget(item);
-        m_controls->setMinimumWidth(360);
         m_controlsLayout = new QGraphicsGridLayout(m_controls);
         m_controlsLayout->setColumnStretchFactor(1, 3);
+        // Do not call QGraphicsWidget::setMinimumWidth() here: for some reason
+        // it prevents the widget from getting wide enough if needed (for
+        // example because of wide translations, see bug #258044)
+        //
+        // Setting the minimum width of a column does not cause such problems,
+        // so use that solution as a workaround.
+        //
+        // This is reproducible with Qt 4.7
+        //m_controls->setMinimumWidth(360);
+        m_controlsLayout->setColumnMinimumWidth(1, 200);
 
         Plasma::Label *spacer0 = new Plasma::Label(m_controls);
         spacer0->setMinimumHeight(8);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic