From b02f4fef1d063f03b6e8b2b961a9049ad53d6c68 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 30 Apr 2011 11:43:27 +0200 Subject: PictureViewer fixes Add an option making resizing the picture viewer to the size of the picture configurable. It's desirable when using a tiling window manager. --- pictureviewer.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'pictureviewer.cpp') diff --git a/pictureviewer.cpp b/pictureviewer.cpp index 502c544..0014b60 100644 --- a/pictureviewer.cpp +++ b/pictureviewer.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -67,7 +68,9 @@ void PictureViewer::showPic(const QString &path, bool enableDirEntries){ img = img.scaled(maxSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); } - resize(img.size() + QSize(20, 20)); + if(mResize){ + resize(img.size() + QSize(20, 20)); + } setSceneRect(viewport()->rect()); setGradient(img.toImage()); QGraphicsPixmapItem *item = new QGraphicsPixmapItem(img); @@ -127,6 +130,11 @@ void PictureViewer::previous(){ } } +void PictureViewer::readSettings(){ + QSettings s; + mResize = s.value("ui/resizepicviewer").toBool(); +} + void PictureViewer::wheelEvent(QWheelEvent *event){ int steps = event->delta() / 8 / 15; if(steps < 0){ -- cgit v1.2.3-70-g09d2