diff options
author | Arno <am@disconnect.de> | 2011-04-30 11:43:27 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2011-04-30 11:43:27 +0200 |
commit | b02f4fef1d063f03b6e8b2b961a9049ad53d6c68 (patch) | |
tree | 72d2adb9ebacfa05084ae484ed9d50a3935f3c2c /pictureviewer.cpp | |
parent | f0ac8500b63511a8307f332c4b86670545fc4ca6 (diff) | |
download | SheMov-b02f4fef1d063f03b6e8b2b961a9049ad53d6c68.tar.gz SheMov-b02f4fef1d063f03b6e8b2b961a9049ad53d6c68.tar.bz2 SheMov-b02f4fef1d063f03b6e8b2b961a9049ad53d6c68.zip |
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.
Diffstat (limited to 'pictureviewer.cpp')
-rw-r--r-- | pictureviewer.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pictureviewer.cpp b/pictureviewer.cpp index 502c544..0014b60 100644 --- a/pictureviewer.cpp +++ b/pictureviewer.cpp @@ -13,6 +13,7 @@ #include <QApplication> #include <QDir> #include <QWheelEvent> +#include <QSettings> #include <algorithm> @@ -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){ |