Commit 6a2094614ce9cad0130b3c4165b1e31fe7b66c1a

Authored by Josh Klontz
1 parent e226f069

make sure ImageViewer redraws after a resize event

openbr/gui/imageviewer.cpp
... ... @@ -78,6 +78,11 @@ void br::ImageViewer::updatePixmap(QImage image, bool async)
78 78 }
79 79 }
80 80  
  81 +QSize br::ImageViewer::sizeHint() const
  82 +{
  83 + return QSize(width(), (src.height() * width() + /* round up */ src.width() - 1) / src.width());
  84 +}
  85 +
81 86 /*** PROTECTED SLOTS ***/
82 87 void br::ImageViewer::keyPressEvent(QKeyEvent *event)
83 88 {
... ...
openbr/gui/imageviewer.h
... ... @@ -57,6 +57,7 @@ protected slots:
57 57  
58 58 private slots:
59 59 void updatePixmap(QImage image, bool async = false);
  60 + QSize sizeHint() const;
60 61 };
61 62  
62 63 } // namespace br
... ...