mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Improved style of sponsored messages with media with max width.
This commit is contained in:
parent
2b5f68003d
commit
ddaf11ed6a
1 changed files with 7 additions and 3 deletions
|
@ -560,7 +560,9 @@ QSize WebPage::countOptimalSize() {
|
|||
}
|
||||
|
||||
// init dimensions
|
||||
const auto skipBlockWidth = _parent->skipBlockWidth();
|
||||
const auto skipBlockWidth = (sponsored && sponsored->hasMedia)
|
||||
? 0
|
||||
: _parent->skipBlockWidth();
|
||||
auto maxWidth = skipBlockWidth;
|
||||
auto minHeight = 0;
|
||||
|
||||
|
@ -628,8 +630,10 @@ QSize WebPage::countOptimalSize() {
|
|||
_durationWidth = st::msgDateFont->width(_duration);
|
||||
}
|
||||
if (!_openButton.isEmpty()) {
|
||||
maxWidth += rect::m::sum::h(st::historyPageButtonPadding)
|
||||
+ _openButton.maxWidth();
|
||||
accumulate_max(
|
||||
maxWidth,
|
||||
rect::m::sum::h(st::historyPageButtonPadding)
|
||||
+ _openButton.maxWidth());
|
||||
}
|
||||
maxWidth += rect::m::sum::h(padding);
|
||||
minHeight += rect::m::sum::v(padding);
|
||||
|
|
Loading…
Add table
Reference in a new issue