From 35c0972671c1f90f76d8d86b002b2e1f8bac79dd Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 26 Mar 2015 16:06:52 +0100 Subject: Make KPixmapModifier::applyFrame handle high DPI images --- src/kitemviews/private/kpixmapmodifier.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/kitemviews/private/kpixmapmodifier.h') diff --git a/src/kitemviews/private/kpixmapmodifier.h b/src/kitemviews/private/kpixmapmodifier.h index e8ca11ac1..9089a1001 100644 --- a/src/kitemviews/private/kpixmapmodifier.h +++ b/src/kitemviews/private/kpixmapmodifier.h @@ -28,8 +28,25 @@ class QSize; class DOLPHIN_EXPORT KPixmapModifier { public: + /** + * Scale a pixmap to a given size. + * @arg scaledSize is assumed to be the scaled to the same device pixel ratio as the source pixmap + * @arg scaledSize is in device pixels + */ static void scale(QPixmap& pixmap, const QSize& scaledSize); + + /** + * Resize and paint a frame round an icon + * @arg scaledSize is assumed to be the scaled to the same device pixel ratio as the source icon + */ static void applyFrame(QPixmap& icon, const QSize& scaledSize); + + /** + * return and paint a frame round an icon + * @arg framesize is in device-independent pixels + * @return is in device-indepent pixels + */ + static QSize sizeInsideFrame(const QSize& frameSize); }; -- cgit v1.3.1