diff options
| author | Peter Penz <[email protected]> | 2007-05-03 05:52:11 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-05-03 05:52:11 +0000 |
| commit | 0bdc4821e4d3f426711185516347e1ae0ad88943 (patch) | |
| tree | 2b25febdcebf368d1ee14230d8054d24772ca555 /src/pixmapviewer.h | |
| parent | 7f2033899d72527c5fcb533644f4068eeb2f332a (diff) | |
allow to specify a transition type
svn path=/trunk/KDE/kdebase/apps/; revision=660579
Diffstat (limited to 'src/pixmapviewer.h')
| -rw-r--r-- | src/pixmapviewer.h | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/pixmapviewer.h b/src/pixmapviewer.h index 54ed5232c..df4bd13b3 100644 --- a/src/pixmapviewer.h +++ b/src/pixmapviewer.h @@ -1,6 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006 by Peter Penz * - * [email protected] * + * Copyright (C) 2006 by Peter Penz <[email protected]> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -30,14 +29,38 @@ class QPaintEvent; /** * @brief Widget which shows a pixmap centered inside the boundaries. * - * @see IconsViewSettingsPage - * @author Peter Penz <[email protected]> + * When the pixmap is changed, a smooth transition is done from the old pixmap + * to the new pixmap. */ class PixmapViewer : public QWidget { Q_OBJECT + public: - explicit PixmapViewer(QWidget* parent); + enum Transition + { + /** No transition is done when the pixmap is changed. */ + NoTransition, + + /** + * The old pixmap is replaced by the new pixmap and the size is + * adjusted smoothly to the size of the new pixmap. + */ + DefaultTransition, + + /** + * If the old pixmap and the new pixmap have the same content, but + * a different size it is recommended to use Transition::SizeTransition + * instead of Transition::DefaultTransition. In this case it is assured + * that the larger pixmap is used for downscaling, which leads + * to an improved scaling output. + */ + SizeTransition + }; + + explicit PixmapViewer(QWidget* parent, + Transition transition = DefaultTransition); + virtual ~PixmapViewer(); void setPixmap(const QPixmap& pixmap); const QPixmap& pixmap() const @@ -52,6 +75,7 @@ private: QPixmap m_pixmap; QPixmap m_oldPixmap; QTimeLine m_animation; + Transition m_transition; int m_animationStep; }; |
