Fixed size of animated preview in boxes.
This commit is contained in:
parent
773912f586
commit
cba0ebce6e
|
@ -107,11 +107,15 @@ void AbstractSingleMediaPreview::preparePreview(QImage preview) {
|
|||
_preview = PixmapFromImage(std::move(preview));
|
||||
_preview.setDevicePixelRatio(style::DevicePixelRatio());
|
||||
|
||||
updatePhotoEditorButton();
|
||||
|
||||
resize(width(), std::max(_previewHeight, _minThumbH));
|
||||
}
|
||||
|
||||
void AbstractSingleMediaPreview::updatePhotoEditorButton() {
|
||||
_photoEditorButton->resize(_previewWidth, _previewHeight);
|
||||
_photoEditorButton->moveToLeft(_previewLeft, _previewTop);
|
||||
_photoEditorButton->setVisible(isPhoto());
|
||||
|
||||
resize(width(), std::max(_previewHeight, _minThumbH));
|
||||
}
|
||||
|
||||
void AbstractSingleMediaPreview::resizeEvent(QResizeEvent *e) {
|
||||
|
|
|
@ -29,6 +29,7 @@ protected:
|
|||
virtual bool tryPaintAnimation(Painter &p) = 0;
|
||||
virtual bool isAnimatedPreviewReady() const = 0;
|
||||
|
||||
void updatePhotoEditorButton();
|
||||
void preparePreview(QImage preview);
|
||||
|
||||
int previewLeft() const;
|
||||
|
|
|
@ -63,8 +63,9 @@ SingleMediaPreview::SingleMediaPreview(
|
|||
Expects(!preview.isNull());
|
||||
setAnimated(animated);
|
||||
|
||||
prepareAnimatedPreview(animatedPreviewPath, animated);
|
||||
preparePreview(preview);
|
||||
prepareAnimatedPreview(animatedPreviewPath, animated);
|
||||
updatePhotoEditorButton();
|
||||
}
|
||||
|
||||
bool SingleMediaPreview::drawBackground() const {
|
||||
|
|
Loading…
Reference in New Issue