mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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
|
// init dimensions
|
||||||
const auto skipBlockWidth = _parent->skipBlockWidth();
|
const auto skipBlockWidth = (sponsored && sponsored->hasMedia)
|
||||||
|
? 0
|
||||||
|
: _parent->skipBlockWidth();
|
||||||
auto maxWidth = skipBlockWidth;
|
auto maxWidth = skipBlockWidth;
|
||||||
auto minHeight = 0;
|
auto minHeight = 0;
|
||||||
|
|
||||||
|
@ -628,8 +630,10 @@ QSize WebPage::countOptimalSize() {
|
||||||
_durationWidth = st::msgDateFont->width(_duration);
|
_durationWidth = st::msgDateFont->width(_duration);
|
||||||
}
|
}
|
||||||
if (!_openButton.isEmpty()) {
|
if (!_openButton.isEmpty()) {
|
||||||
maxWidth += rect::m::sum::h(st::historyPageButtonPadding)
|
accumulate_max(
|
||||||
+ _openButton.maxWidth();
|
maxWidth,
|
||||||
|
rect::m::sum::h(st::historyPageButtonPadding)
|
||||||
|
+ _openButton.maxWidth());
|
||||||
}
|
}
|
||||||
maxWidth += rect::m::sum::h(padding);
|
maxWidth += rect::m::sum::h(padding);
|
||||||
minHeight += rect::m::sum::v(padding);
|
minHeight += rect::m::sum::v(padding);
|
||||||
|
|
Loading…
Add table
Reference in a new issue