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

List:       kde-commits
Subject:    extragear/plasma/applets/frame
From:       Gaƫl Beaudoin <gaboo () gaboo ! org>
Date:       2008-04-11 15:33:23
Message-ID: 1207928003.985182.5847.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 795847 by gaboo:

always use the max current size of contentSize to avoid the applet to downsize each time the picture orientation changes.
But now, the frame "jumps" when changing picture.


 M  +3 -2      frame.cpp  


--- trunk/extragear/plasma/applets/frame/frame.cpp #795846:795847
@@ -123,10 +123,11 @@
 
 QSizeF Frame::contentSizeHint() const {
     if (!m_picture.isNull()) {
+        qreal maxSize = contentSize().width() > contentSize().height() ? contentSize().width() : contentSize().height();
         if (m_picture.width() > m_picture.height()) {
-            return QSizeF( contentSize().width(), (contentSize().width() / m_picture.width() ) * m_picture.height() );
+            return QSizeF( maxSize, (maxSize / m_picture.width()) * m_picture.height() );
         } else {
-            return QSizeF( (contentSize().height() / m_picture.height()) * m_picture.width(), contentSize().height() );
+            return QSizeF( (maxSize / m_picture.height()) * m_picture.width(), maxSize );
         }
     } else {
         return contentSize();
[prev in list] [next in list] [prev in thread] [next in thread] 

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