mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Fixed size of animated preview in boxes.
This commit is contained in:
parent
773912f586
commit
cba0ebce6e
3 changed files with 9 additions and 3 deletions
|
@ -107,11 +107,15 @@ void AbstractSingleMediaPreview::preparePreview(QImage preview) {
|
||||||
_preview = PixmapFromImage(std::move(preview));
|
_preview = PixmapFromImage(std::move(preview));
|
||||||
_preview.setDevicePixelRatio(style::DevicePixelRatio());
|
_preview.setDevicePixelRatio(style::DevicePixelRatio());
|
||||||
|
|
||||||
|
updatePhotoEditorButton();
|
||||||
|
|
||||||
|
resize(width(), std::max(_previewHeight, _minThumbH));
|
||||||
|
}
|
||||||
|
|
||||||
|
void AbstractSingleMediaPreview::updatePhotoEditorButton() {
|
||||||
_photoEditorButton->resize(_previewWidth, _previewHeight);
|
_photoEditorButton->resize(_previewWidth, _previewHeight);
|
||||||
_photoEditorButton->moveToLeft(_previewLeft, _previewTop);
|
_photoEditorButton->moveToLeft(_previewLeft, _previewTop);
|
||||||
_photoEditorButton->setVisible(isPhoto());
|
_photoEditorButton->setVisible(isPhoto());
|
||||||
|
|
||||||
resize(width(), std::max(_previewHeight, _minThumbH));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractSingleMediaPreview::resizeEvent(QResizeEvent *e) {
|
void AbstractSingleMediaPreview::resizeEvent(QResizeEvent *e) {
|
||||||
|
|
|
@ -29,6 +29,7 @@ protected:
|
||||||
virtual bool tryPaintAnimation(Painter &p) = 0;
|
virtual bool tryPaintAnimation(Painter &p) = 0;
|
||||||
virtual bool isAnimatedPreviewReady() const = 0;
|
virtual bool isAnimatedPreviewReady() const = 0;
|
||||||
|
|
||||||
|
void updatePhotoEditorButton();
|
||||||
void preparePreview(QImage preview);
|
void preparePreview(QImage preview);
|
||||||
|
|
||||||
int previewLeft() const;
|
int previewLeft() const;
|
||||||
|
|
|
@ -63,8 +63,9 @@ SingleMediaPreview::SingleMediaPreview(
|
||||||
Expects(!preview.isNull());
|
Expects(!preview.isNull());
|
||||||
setAnimated(animated);
|
setAnimated(animated);
|
||||||
|
|
||||||
prepareAnimatedPreview(animatedPreviewPath, animated);
|
|
||||||
preparePreview(preview);
|
preparePreview(preview);
|
||||||
|
prepareAnimatedPreview(animatedPreviewPath, animated);
|
||||||
|
updatePhotoEditorButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SingleMediaPreview::drawBackground() const {
|
bool SingleMediaPreview::drawBackground() const {
|
||||||
|
|
Loading…
Add table
Reference in a new issue