mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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 stickerSet = stickerSetData();
|
||||||
const auto factcheck = factcheckData();
|
const auto factcheck = factcheckData();
|
||||||
const auto sponsored = sponsoredData();
|
const auto sponsored = sponsoredData();
|
||||||
const auto specialRightPix = ((sponsored && !sponsored->hasMedia)
|
const auto specialRightPix = (stickerSet
|
||||||
|| stickerSet);
|
|| (sponsored && !sponsored->hasMedia && _data->photo));
|
||||||
const auto lineHeight = UnitedLineHeight();
|
const auto lineHeight = UnitedLineHeight();
|
||||||
const auto factcheckMetrics = factcheck
|
const auto factcheckMetrics = factcheck
|
||||||
? computeFactcheckMetrics(_description.countHeight(innerWidth))
|
? computeFactcheckMetrics(_description.countHeight(innerWidth))
|
||||||
|
@ -678,7 +678,7 @@ QSize WebPage::countCurrentSize(int newWidth) {
|
||||||
}
|
}
|
||||||
const auto linesMax = factcheck
|
const auto linesMax = factcheck
|
||||||
? (factcheckMetrics.lines + 1)
|
? (factcheckMetrics.lines + 1)
|
||||||
: (specialRightPix || isLogEntryOriginal())
|
: (sponsored || isLogEntryOriginal())
|
||||||
? kMaxOriginalEntryLines
|
? kMaxOriginalEntryLines
|
||||||
: 5;
|
: 5;
|
||||||
const auto siteNameHeight = _siteNameLines ? lineHeight : 0;
|
const auto siteNameHeight = _siteNameLines ? lineHeight : 0;
|
||||||
|
@ -711,7 +711,9 @@ QSize WebPage::countCurrentSize(int newWidth) {
|
||||||
newHeight += _titleLines * lineHeight;
|
newHeight += _titleLines * lineHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto descriptionHeight = _description.countHeight(wleft);
|
const auto descriptionHeight = _description.countHeight(sponsored
|
||||||
|
? innerWidth
|
||||||
|
: wleft);
|
||||||
const auto restLines = (linesMax - _siteNameLines - _titleLines);
|
const auto restLines = (linesMax - _siteNameLines - _titleLines);
|
||||||
if (descriptionHeight < restLines * descriptionLineHeight) {
|
if (descriptionHeight < restLines * descriptionLineHeight) {
|
||||||
// We have height for all the lines.
|
// We have height for all the lines.
|
||||||
|
|
Loading…
Add table
Reference in a new issue