mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Fixed display of sponsored messages with long descriptions and media.
This commit is contained in:
parent
f89167ef94
commit
7a535a4554
1 changed files with 6 additions and 4 deletions
|
@ -663,8 +663,8 @@ QSize WebPage::countCurrentSize(int newWidth) {
|
|||
const auto stickerSet = stickerSetData();
|
||||
const auto factcheck = factcheckData();
|
||||
const auto sponsored = sponsoredData();
|
||||
const auto specialRightPix = ((sponsored && !sponsored->hasMedia)
|
||||
|| stickerSet);
|
||||
const auto specialRightPix = (stickerSet
|
||||
|| (sponsored && !sponsored->hasMedia && _data->photo));
|
||||
const auto lineHeight = UnitedLineHeight();
|
||||
const auto factcheckMetrics = factcheck
|
||||
? computeFactcheckMetrics(_description.countHeight(innerWidth))
|
||||
|
@ -678,7 +678,7 @@ QSize WebPage::countCurrentSize(int newWidth) {
|
|||
}
|
||||
const auto linesMax = factcheck
|
||||
? (factcheckMetrics.lines + 1)
|
||||
: (specialRightPix || isLogEntryOriginal())
|
||||
: (sponsored || isLogEntryOriginal())
|
||||
? kMaxOriginalEntryLines
|
||||
: 5;
|
||||
const auto siteNameHeight = _siteNameLines ? lineHeight : 0;
|
||||
|
@ -711,7 +711,9 @@ QSize WebPage::countCurrentSize(int newWidth) {
|
|||
newHeight += _titleLines * lineHeight;
|
||||
}
|
||||
|
||||
const auto descriptionHeight = _description.countHeight(wleft);
|
||||
const auto descriptionHeight = _description.countHeight(sponsored
|
||||
? innerWidth
|
||||
: wleft);
|
||||
const auto restLines = (linesMax - _siteNameLines - _titleLines);
|
||||
if (descriptionHeight < restLines * descriptionLineHeight) {
|
||||
// We have height for all the lines.
|
||||
|
|
Loading…
Add table
Reference in a new issue