mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 23:27:09 +02:00
Improve mute and info display in video messages.
Display mute on top of the video and move info to the right side for incoming messages (because of channel authors and views count).
This commit is contained in:
parent
1b7777e3a0
commit
96dbb38aaa
1 changed files with 18 additions and 1 deletions
|
@ -1918,7 +1918,7 @@ void HistoryGif::draw(Painter &p, const QRect &r, TextSelection selection, TimeM
|
|||
}
|
||||
}
|
||||
if (displayMute) {
|
||||
auto muteRect = rtlrect(rthumb.x() + (rthumb.width() - st::historyVideoMessageMuteSize) / 2, rthumb.y() + rthumb.height() - st::msgDateImgDelta - st::historyVideoMessageMuteSize, st::historyVideoMessageMuteSize, st::historyVideoMessageMuteSize, _width);
|
||||
auto muteRect = rtlrect(rthumb.x() + (rthumb.width() - st::historyVideoMessageMuteSize) / 2, rthumb.y() + st::msgDateImgDelta, st::historyVideoMessageMuteSize, st::historyVideoMessageMuteSize, _width);
|
||||
p.setPen(Qt::NoPen);
|
||||
p.setBrush(selected ? st::msgDateImgBgSelected : st::msgDateImgBg);
|
||||
PainterHighQualityEnabler hq(p);
|
||||
|
@ -1955,6 +1955,23 @@ void HistoryGif::draw(Painter &p, const QRect &r, TextSelection selection, TimeM
|
|||
} else if (_parent->getMedia() == this && (isRound || _data->uploading() || App::hoveredItem() == _parent)) {
|
||||
auto fullRight = skipx + width;
|
||||
auto fullBottom = skipy + height;
|
||||
if (isRound && !outbg) {
|
||||
auto infoWidth = _parent->infoWidth();
|
||||
|
||||
// This is just some arbitrary point,
|
||||
// the main idea is to make info left aligned here.
|
||||
fullRight += infoWidth - st::normalFont->height;
|
||||
|
||||
auto maxRight = _parent->history()->width - st::msgMargin.left();
|
||||
if (_parent->history()->canHaveFromPhotos()) {
|
||||
maxRight -= st::msgMargin.right();
|
||||
} else {
|
||||
maxRight -= st::msgMargin.left();
|
||||
}
|
||||
if (fullRight > maxRight) {
|
||||
fullRight = maxRight;
|
||||
}
|
||||
}
|
||||
_parent->drawInfo(p, fullRight, fullBottom, 2 * skipx + width, selected, isRound ? InfoDisplayOverBackground : InfoDisplayOverImage);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue