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

List:       kde-commits
Subject:    kdebase/kicker/applets/clock
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2004-12-11 9:34:19
Message-ID: 20041211093419.1842E1B473 () office ! kde ! org
[Download RAW message or body]

CVS commit by aseigo: 

don't relayout if the size remains the same


  M +21 -7     clock.cpp   1.198


--- kdebase/kicker/applets/clock/clock.cpp  #1.197:1.198
@@ -549,5 +549,5 @@ void AnalogClock::paintEvent( QPaintEven
     QPoint cp(spWidth / 2, spHeight / 2);
 
-    int d = QMIN(spWidth,spHeight)-(10 * aaFactor);
+    int d = KMIN(spWidth,spHeight) - (10 * aaFactor);
 
     if (_prefs->analogLCDStyle()) {
@@ -933,10 +933,13 @@ int ClockApplet::widthForHeight(int h) c
     }
 
-    int clockWidth = \
                _clock->preferedWidthForHeight(h-shareDateHeight-shareDayOfWeekHeight);
                
-
-    int w;
+    static int lastWidth = -1;
+    int clockWidth = _clock->preferedWidthForHeight(KMAX(0, h - shareDateHeight - \
shareDayOfWeekHeight)); +    int w = clockWidth;
     if (!mustShowDate && !showDayOfWeek)
     {
-        w = clockWidth;
+        if (lastWidth == w)
+        {
+            return w;
+        }
         _clock->widget()->setFixedSize(w, h);
     }
@@ -948,5 +951,10 @@ int ClockApplet::widthForHeight(int h) c
         if (dateToSide)
         {
-            w = clockWidth + dateWidth + dayOfWeekWidth;
+            w += dateWidth + dayOfWeekWidth;
+
+            if (lastWidth == w)
+            {
+                return w;
+            }
 
             bool dateFirst = false;
@@ -992,5 +1000,11 @@ int ClockApplet::widthForHeight(int h) c
         else
         {
-            w = QMAX(QMAX(clockWidth, dateWidth), dayOfWeekWidth);
+            w = KMAX(KMAX(w, dateWidth), dayOfWeekWidth);
+
+            if (lastWidth == w)
+            {
+                return w;
+            }
+
             _clock->widget()->setFixedSize(w, h - shareDateHeight - \
                shareDayOfWeekHeight);
             _clock->widget()->setMinimumSize(w, h - shareDateHeight - \
shareDayOfWeekHeight);


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

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