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

List:       kde-commits
Subject:    extragear/plasma/applets/frame
From:       Anne-Marie Mahfouf <annma () kde ! org>
Date:       2008-02-24 13:07:33
Message-ID: 1203858453.277517.26061.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 778724 by annma:

a bit of an ugly hack: has to reset ContentSize so the applet background does not \
stay square. Looks a bit too much but I don't see another easy way.


 M  +4 -3      frame.cpp  
 M  +1 -1      frame.h  


--- trunk/extragear/plasma/applets/frame/frame.cpp #778723:778724
@@ -254,11 +254,11 @@
 {
     Q_UNUSED(option);
 
-    m_pixmapCache = QPixmap(contentsSize);
+    m_pixmapCache = QPixmap::fromImage(m_picture).scaled(contentsSize, \
Qt::KeepAspectRatio, Qt::FastTransformation); +    \
setContentSize(m_pixmapCache.rect().size());  m_pixmapCache.fill(Qt::transparent);
 
-    QPainter *p = new QPainter(&m_pixmapCache);
-
+    
     int roundingFactor = 12 * m_roundCorners;
     int swRoundness = roundingFactor + m_frameOutline / 2 * m_frame * \
m_roundCorners;  
@@ -270,6 +270,7 @@
     frameRect = QRect(QPoint(frameRect.x() + (frameRect.width() - \
                scaledImage.width()) / 2,
                       frameRect.y() + (frameRect.height() - scaledImage.height()) / \
2), scaledImage.size());  
+    QPainter *p = new QPainter(&m_pixmapCache);
     QRect shadowRect;
     if (m_frame) {
         shadowRect = frameRect.adjusted(-m_frameOutline + 1, -m_frameOutline + 1,
--- trunk/extragear/plasma/applets/frame/frame.h #778723:778724
@@ -53,7 +53,7 @@
         void paintInterface(QPainter *painter, const QStyleOptionGraphicsItem \
*option,  const QRect &contentsRect);
         void init();
-        void constraintsUpdated(Plasma::Constraints constraints);
+	void constraintsUpdated(Plasma::Constraints constraints);
 
     public slots:
         void showConfigurationInterface();


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

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