2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Show correct downloads elements context menu.

This commit is contained in:
John Preston
2022-02-27 14:14:39 +03:00
parent daadf7e2a1
commit e89c95551f
32 changed files with 362 additions and 147 deletions

View File

@@ -924,7 +924,7 @@ Document::Document(
const style::OverviewFileLayout &st)
: RadialProgressItem(delegate, parent)
, _data(fields.document)
, _msgl(goToMessageClickHandler(parent))
, _msgl(parent->isHistoryEntry() ? goToMessageClickHandler(parent) : nullptr)
, _namel(std::make_shared<DocumentOpenClickHandler>(
_data,
crl::guard(this, [=](FullMsgId id) {
@@ -1189,7 +1189,9 @@ void Document::paint(Painter &p, const QRect &clip, TextSelection selection, con
p.drawTextLeft(nameleft, statustop, _width, _status.text());
}
if (datetop >= 0 && clip.intersects(style::rtlrect(nameleft, datetop, _datew, st::normalFont->height, _width))) {
p.setFont(ClickHandler::showAsActive(_msgl) ? st::normalFont->underline() : st::normalFont);
p.setFont((_msgl && ClickHandler::showAsActive(_msgl))
? st::normalFont->underline()
: st::normalFont);
p.setPen(st::mediaInFg);
p.drawTextLeft(nameleft, datetop, _width, _date, _datew);
}