┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/pixmapviewer.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-02-02 23:17:14 +0000
committerPeter Penz <[email protected]>2008-02-02 23:17:14 +0000
commitcd65336b8cfa38756bc63e7203b2b7397d8639ec (patch)
treedd21eb1540499051593f5b9a1233796ea7b4c797 /src/pixmapviewer.cpp
parenta6d36df99ee82c4b081f67f6cf19e2f6fe65e253 (diff)
Information Panel: If the width of the panel is increased, also increase the size of the item preview to take advantege of the additional space.
BUG: 156046 svn path=/trunk/KDE/kdebase/apps/; revision=770173
Diffstat (limited to 'src/pixmapviewer.cpp')
-rw-r--r--src/pixmapviewer.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/pixmapviewer.cpp b/src/pixmapviewer.cpp
index a7a593bb0..f535475aa 100644
--- a/src/pixmapviewer.cpp
+++ b/src/pixmapviewer.cpp
@@ -21,6 +21,7 @@
#include <kiconloader.h>
+#include <QLayout>
#include <QPainter>
#include <QPixmap>
#include <QKeyEvent>
@@ -28,7 +29,8 @@
PixmapViewer::PixmapViewer(QWidget* parent, Transition transition) :
QWidget(parent),
m_transition(transition),
- m_animationStep(0)
+ m_animationStep(0),
+ m_sizeHint()
{
setMinimumWidth(KIconLoader::SizeEnormous);
setMinimumHeight(KIconLoader::SizeEnormous);
@@ -72,6 +74,19 @@ void PixmapViewer::setPixmap(const QPixmap& pixmap)
}
}
+void PixmapViewer::setSizeHint(const QSize& size)
+{
+ m_sizeHint = size;
+ if ((parentWidget() != 0) && (parentWidget()->layout() != 0)) {
+ parentWidget()->layout()->activate();
+ }
+}
+
+QSize PixmapViewer::sizeHint() const
+{
+ return m_sizeHint;
+}
+
void PixmapViewer::paintEvent(QPaintEvent* event)
{
QWidget::paintEvent(event);