added possibility to change the aspect ratio of thumbnails and replaced image warping by largest centered cropping

This commit is contained in:
csoler 2020-09-04 23:36:41 +02:00
parent bebc9f2863
commit af16659783
5 changed files with 93 additions and 26 deletions

View file

@ -28,6 +28,8 @@
#include "gui/gxs/GxsMessageFramePostWidget.h"
#include "gui/feeds/FeedHolder.h"
#include "GxsChannelPostThumbnail.h"
namespace Ui {
class GxsChannelPostsWidgetWithModel;
}
@ -69,6 +71,7 @@ class ChannelPostDelegate: public QAbstractItemDelegate
int cellSize(int col, const QFont& font, uint32_t parent_width) const;
void zoom(bool zoom_or_unzoom) ;
void setWidgetGrid(bool use_grid) ;
void setAspectRatio(ChannelPostThumbnailView::AspectRatio r) ;
private:
static constexpr float IMAGE_MARGIN_FACTOR = 1.0;
@ -78,6 +81,7 @@ class ChannelPostDelegate: public QAbstractItemDelegate
float mZoom; // zoom factor for the whole thumbnail
bool mUseGrid; // wether we use the grid widget or the list widget
ChannelPostThumbnailView::AspectRatio mAspectRatio;
};
class GxsChannelPostsWidgetWithModel: public GxsMessageFrameWidget