From kde-commits Fri Apr 11 15:33:23 2008 From: =?utf-8?q?Ga=C3=ABl=20Beaudoin?= Date: Fri, 11 Apr 2008 15:33:23 +0000 To: kde-commits Subject: extragear/plasma/applets/frame Message-Id: <1207928003.985182.5847.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=120792801105555 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();