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

List:       kde-panel-devel
Subject:    Re: [Panel-devel] KDE/kdebase/workspace/libs/plasma
From:       Sebastian =?iso-8859-15?q?K=FCgler?= <sebas () kde ! org>
Date:       2007-07-31 8:25:35
Message-ID: 200707311025.36965.sebas () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


On Tuesday 31 July 2007 01:57:40 Aaron J. Seigo wrote:
> > Some explanation: I've enabled the standard background for smaller
> > (Horizontal and Vertical) FormFactors. After changing formfactor, I'm
>
> i've started looking into this.

Here's a fix for the 'not clearing bits of the background after formfactor 
changes and switches off the background'. I'm basically flagging the 
background for repaint and deletion in setDrawStandardBackground(false) and 
do that when it's next repainted.

I'll be looking into another issue where the background is not fully painted 
directly after switching it on. This can be seen when you change the battery 
to smaller FormFactor. If I was not able to fix it until Thursday morning, 
it'll take some time as I'll be offline and then off to the board meeting.

Ok to commit this first patch?
-- 
sebas

 http://www.kde.org | http://vizZzion.org |  GPG Key ID: 9119 0EF9 

["battery-dont-paint-background.diff" (text/x-diff)]

Index: applet.cpp
===================================================================
--- applet.cpp	(revision 694635)
+++ applet.cpp	(working copy)
@@ -70,6 +70,8 @@
           configXml(0),
           kioskImmutable(false),
           immutable(false),
+          repaintBackground(0),
+          repaintRect(),
           hasConfigurationInterface(false),
           failed(false),
           cachedBackground(0)
@@ -243,6 +245,8 @@
 
     void paintHover(QPainter* painter, Applet* q)
     {
+        Q_UNUSED( painter );
+        Q_UNUSED( q );
         //TODO draw hover interface for close, configure, info and move
     }
 
@@ -303,6 +307,9 @@
     bool immutable : 1;
     bool hasConfigurationInterface : 1;
     bool failed : 1;
+    bool repaintBackground;
+    QRectF repaintRect;
+
 private:
     QPixmap* cachedBackground;
 };
@@ -462,9 +469,11 @@
         }
     } else if (d->background) {
         prepareGeometryChange();
-        delete d->background;
-        d->background = 0;
+        // We set a flag, so the background gets cleared next time the interface is repainted,
+        // d-> background gets deleted there.
+        d->repaintBackground = true;
     }
+    update();
 }
 
 bool Applet::failedToLaunch() const
@@ -576,9 +585,15 @@
     Q_UNUSED(widget)
     qreal zoomLevel = painter->transform().m11() / transform().m11();
     if (zoomLevel == scalingFactor(Plasma::DesktopZoom)) { // Show Desktop
-        if (d->background) {
+        if (d->background && !d->repaintBackground) {
             d->paintBackground(painter, this);
         }
+        if (d->repaintBackground) {
+            painter->fillRect(boundingRect(), QBrush(QColor(255, 255, 255, 00)));
+            d->repaintBackground = false;
+            delete d->background;
+            d->background = 0;
+        }
 
         if (d->failed) {
             return;
@@ -591,8 +606,8 @@
         painter->setBrush(QBrush(color(), Qt::SolidPattern));
         painter->drawRoundRect(boundingRect());
         int iconDim = KIconLoader().currentSize(K3Icon::Desktop);
-        int midX = (boundingRect().width() / 2) - (iconDim / 2);
-        int midY = (boundingRect().height() / 2) - (iconDim / 2);
+        int midX = (int)((boundingRect().width() / 2) - (iconDim / 2));
+        int midY = (int)((boundingRect().height() / 2 )- (iconDim / 2));
         KIcon(icon()).paint(painter, midX, midY, iconDim, iconDim);
     }/*  else if (zoomLevel == scalingFactor(Plasma::OverviewZoom)) { //Show Groups only
     } */

["signature.asc" (application/pgp-signature)]

_______________________________________________
Panel-devel mailing list
Panel-devel@kde.org
https://mail.kde.org/mailman/listinfo/panel-devel


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

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