diff --git a/retroshare-gui/src/gui/Posted/PhotoView.ui b/retroshare-gui/src/gui/Posted/PhotoView.ui
index 9c540bc28..82688978c 100644
--- a/retroshare-gui/src/gui/Posted/PhotoView.ui
+++ b/retroshare-gui/src/gui/Posted/PhotoView.ui
@@ -51,38 +51,15 @@
0
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
+
+
+ Qt::AlignCenter
+
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
@@ -207,9 +184,13 @@
gui/common/AvatarWidget.h
1
+
+ AspectRatioPixmapLabel
+ QLabel
+ util/aspectratiopixmaplabel.h
+
-
diff --git a/retroshare-gui/src/util/AspectRatioPixmapLabel.cpp b/retroshare-gui/src/util/AspectRatioPixmapLabel.cpp
index d8da057e6..d62a72a0d 100644
--- a/retroshare-gui/src/util/AspectRatioPixmapLabel.cpp
+++ b/retroshare-gui/src/util/AspectRatioPixmapLabel.cpp
@@ -19,6 +19,7 @@
*******************************************************************************/
#include "AspectRatioPixmapLabel.h"
+#include
AspectRatioPixmapLabel::AspectRatioPixmapLabel(QWidget *parent) :
QLabel(parent)
@@ -53,4 +54,6 @@ void AspectRatioPixmapLabel::resizeEvent(QResizeEvent * e)
{
if(!pix.isNull())
QLabel::setPixmap(scaledPixmap());
+ QLabel::resizeEvent(e);
+ //std::cout << "Information resized: " << e->oldSize().width() << 'x' << e->oldSize().height() << " to " << e->size().width() << 'x' << e->size().height() << std::endl;
}
diff --git a/retroshare-gui/src/util/AspectRatioPixmapLabel.h b/retroshare-gui/src/util/AspectRatioPixmapLabel.h
index f04dc619a..ad7c40e4c 100644
--- a/retroshare-gui/src/util/AspectRatioPixmapLabel.h
+++ b/retroshare-gui/src/util/AspectRatioPixmapLabel.h
@@ -29,15 +29,16 @@ class AspectRatioPixmapLabel : public QLabel
{
Q_OBJECT
public:
- explicit AspectRatioPixmapLabel(QWidget *parent = 0);
- virtual int heightForWidth( int width ) const;
- virtual QSize sizeHint() const;
+ explicit AspectRatioPixmapLabel(QWidget *parent = nullptr);
+ virtual int heightForWidth( int width ) const override;
+ virtual QSize sizeHint() const override;
QPixmap scaledPixmap() const;
public slots:
void setPixmap ( const QPixmap & );
- void resizeEvent(QResizeEvent *);
+protected:
+ void resizeEvent(QResizeEvent *event) override;
private:
QPixmap pix;
};
-#endif // ASPECTRATIOPIXMAPLABEL_H
\ No newline at end of file
+#endif // ASPECTRATIOPIXMAPLABEL_H