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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/battery
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2008-12-25 0:17:41
Message-ID: 1230164261.940230.12838.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 901296 by aseigo:

* always update when we change the svg size, fixes blurred-on-first-show bug
* some cleanups


 M  +9 -8      battery.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/battery/battery.cpp #901295:901296
@@ -109,7 +109,7 @@
     m_showBatteryString = cg.readEntry("showBatteryString", false);
     m_showMultipleBatteries = cg.readEntry("showMultipleBatteries", !m_isEmbedded);
 
-    showBattery(false);;
+    showBattery(false);
     m_theme->resize(contentsRect().size());
     if (m_acadapter_plugged) {
         showAcAdapter(true);
@@ -150,6 +150,12 @@
 void Battery::constraintsEvent(Plasma::Constraints constraints)
 {
     //kDebug() << "ConstraintsEvent, Dude." << contentsRect();
+    if (!m_showMultipleBatteries || m_numOfBattery < 2) {
+        setAspectRatioMode(Plasma::Square);
+    } else {
+        setAspectRatioMode(Plasma::KeepAspectRatio);
+    }
+
     if (constraints & (Plasma::FormFactorConstraint | Plasma::SizeConstraint)) {
         if (formFactor() == Plasma::Vertical) {
             if (!m_showMultipleBatteries) {
@@ -171,17 +177,11 @@
             setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
             setMinimumSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall);
         }
-    }
-    if (!m_showMultipleBatteries || m_numOfBattery < 2) {
-        setAspectRatioMode(Plasma::Square);
-    } else {
-        setAspectRatioMode(Plasma::KeepAspectRatio);
-    }
 
-    if (constraints & (Plasma::SizeConstraint | Plasma::FormFactorConstraint) && m_theme) {
         m_theme->resize(contentsRect().size().toSize());
         m_font.setPointSize(qMax(KGlobalSettings::smallestReadableFont().pointSize(),
                                  qRound(contentsRect().height() / 10)));
+        update();
     }
 }
 
@@ -783,6 +783,7 @@
     if (m_theme->hasElement("Battery")) {
         m_theme->paint(p, scaleRectF(m_batteryAlpha, contentsRect), "Battery");
     }
+
     QString fill_element = QString();
     if (plugState) {
         if (batteryPercent > 95) {
[prev in list] [next in list] [prev in thread] [next in thread] 

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