mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Fix empty space to the right of photo media.
This commit is contained in:
parent
d5d9da7d0a
commit
14909ae913
4 changed files with 13 additions and 0 deletions
|
@ -113,6 +113,10 @@ void ExtendedPreview::unloadHeavyPart() {
|
|||
_spoiler.animation = nullptr;
|
||||
}
|
||||
|
||||
bool ExtendedPreview::enforceBubbleWidth() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
QSize ExtendedPreview::countOptimalSize() {
|
||||
const auto &preview = _invoice->extendedPreview;
|
||||
const auto dimensions = preview.dimensions;
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
|
||||
bool hasHeavyPart() const override;
|
||||
void unloadHeavyPart() override;
|
||||
bool enforceBubbleWidth() const override;
|
||||
|
||||
private:
|
||||
int minWidthForButton() const;
|
||||
|
|
|
@ -162,6 +162,10 @@ void Photo::unloadHeavyPart() {
|
|||
togglePollingStory(false);
|
||||
}
|
||||
|
||||
bool Photo::enforceBubbleWidth() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
void Photo::togglePollingStory(bool enabled) const {
|
||||
const auto pollingStory = (enabled ? 1 : 0);
|
||||
if (!_storyId || _pollingStory == pollingStory) {
|
||||
|
@ -193,6 +197,9 @@ QSize Photo::countOptimalSize() {
|
|||
auto maxWidth = qMax(maxActualWidth, scaled.height());
|
||||
auto minHeight = qMax(scaled.height(), st::minPhotoSize);
|
||||
if (_parent->hasBubble()) {
|
||||
const auto captionMaxWidth = _parent->textualMaxWidth();
|
||||
const auto maxWithCaption = qMin(st::msgMaxWidth, captionMaxWidth);
|
||||
maxWidth = qMin(qMax(maxWidth, maxWithCaption), st::msgMaxWidth);
|
||||
minHeight = adjustHeightForLessCrop(
|
||||
dimensions,
|
||||
{ maxWidth, minHeight });
|
||||
|
|
|
@ -88,6 +88,7 @@ public:
|
|||
|
||||
bool hasHeavyPart() const override;
|
||||
void unloadHeavyPart() override;
|
||||
bool enforceBubbleWidth() const override;
|
||||
|
||||
protected:
|
||||
float64 dataProgress() const override;
|
||||
|
|
Loading…
Add table
Reference in a new issue