From 0d72c074b67bc72206b209e5dfe6866ff75ab8f0 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 19 Sep 2008 22:45:20 +0000 Subject: [PATCH] request the the default size for the svg, and a fixed size for the icon scale down the pixmap if bigger than the icon frame svn path=/trunk/KDE/kdegraphics/okular/; revision=862805 --- ui/annotationwidgets.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/annotationwidgets.cpp b/ui/annotationwidgets.cpp index ee5c2989f..16a9e1d20 100644 --- a/ui/annotationwidgets.cpp +++ b/ui/annotationwidgets.cpp @@ -107,7 +107,10 @@ void PixmapPreviewSelector::iconComboChanged( const QString& icon ) m_icon = icon; } - QPixmap pixmap = GuiUtils::loadStamp( m_icon, QSize( m_previewSize, m_previewSize ) ); + QPixmap pixmap = GuiUtils::loadStamp( m_icon, QSize(), m_previewSize ); + const QRect cr = m_iconLabel->contentsRect(); + if ( pixmap.width() > cr.width() || pixmap.height() > cr.height() ) + pixmap = pixmap.scaled( cr.size(), Qt::KeepAspectRatio ); m_iconLabel->setPixmap( pixmap ); emit iconChanged( m_icon );