mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix unwrapped media display in Replies chat.
This commit is contained in:
parent
c534f3f22e
commit
bd5f145a8c
1 changed files with 11 additions and 2 deletions
|
@ -213,10 +213,17 @@ void UnwrappedMedia::drawSurrounding(
|
||||||
p.setTextPalette(st->serviceTextPalette());
|
p.setTextPalette(st->serviceTextPalette());
|
||||||
forwarded->text.drawElided(p, rectx, recty + st::msgReplyPadding.top(), rectw, kMaxForwardedBarLines, style::al_left, 0, -1, 0, surrounding.forwardedBreakEverywhere);
|
forwarded->text.drawElided(p, rectx, recty + st::msgReplyPadding.top(), rectw, kMaxForwardedBarLines, style::al_left, 0, -1, 0, surrounding.forwardedBreakEverywhere);
|
||||||
p.restoreTextPalette();
|
p.restoreTextPalette();
|
||||||
|
|
||||||
|
const auto skip = std::min(
|
||||||
|
forwarded->text.countHeight(rectw),
|
||||||
|
kMaxForwardedBarLines * st::msgServiceNameFont->height);
|
||||||
|
recty += skip;
|
||||||
} else if (via) {
|
} else if (via) {
|
||||||
p.setFont(st::msgDateFont);
|
p.setFont(st::msgDateFont);
|
||||||
p.drawTextLeft(rectx, recty + st::msgReplyPadding.top(), 2 * rectx + rectw, via->text);
|
p.drawTextLeft(rectx, recty + st::msgReplyPadding.top(), 2 * rectx + rectw, via->text);
|
||||||
int skip = st::msgServiceNameFont->height + (reply ? st::msgReplyPadding.top() : 0);
|
|
||||||
|
const auto skip = st::msgServiceNameFont->height
|
||||||
|
+ (reply ? st::msgReplyPadding.top() : 0);
|
||||||
recty += skip;
|
recty += skip;
|
||||||
}
|
}
|
||||||
if (reply) {
|
if (reply) {
|
||||||
|
@ -465,7 +472,9 @@ int UnwrappedMedia::additionalWidth(
|
||||||
|
|
||||||
auto UnwrappedMedia::getDisplayedForwardedInfo() const
|
auto UnwrappedMedia::getDisplayedForwardedInfo() const
|
||||||
-> const HistoryMessageForwarded * {
|
-> const HistoryMessageForwarded * {
|
||||||
return _parent->data()->Get<HistoryMessageForwarded>();
|
return _parent->displayForwardedFrom()
|
||||||
|
? _parent->data()->Get<HistoryMessageForwarded>()
|
||||||
|
: nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace HistoryView
|
} // namespace HistoryView
|
||||||
|
|
Loading…
Add table
Reference in a new issue