mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 22:27:20 +02:00
Fix web page video message with reactions.
This commit is contained in:
parent
d7e2046ef3
commit
58d762f130
3 changed files with 21 additions and 4 deletions
|
@ -1027,9 +1027,13 @@ void Message::draw(Painter &p, const PaintContext &context) const {
|
|||
|
||||
auto trect = inner.marginsRemoved(st::msgPadding);
|
||||
|
||||
const auto reactionsTop = (reactionsInBubble && !_viewButton)
|
||||
? st::mediaInBubbleSkip
|
||||
const auto additionalInfoSkip = (mediaDisplayed
|
||||
&& !media->additionalInfoString().isEmpty())
|
||||
? st::msgDateFont->height
|
||||
: 0;
|
||||
const auto reactionsTop = (reactionsInBubble && !_viewButton)
|
||||
? (additionalInfoSkip + st::mediaInBubbleSkip)
|
||||
: additionalInfoSkip;
|
||||
const auto reactionsHeight = reactionsInBubble
|
||||
? (reactionsTop + _reactions->height())
|
||||
: 0;
|
||||
|
@ -2045,9 +2049,13 @@ TextState Message::textState(
|
|||
return result;
|
||||
}
|
||||
auto trect = inner.marginsRemoved(st::msgPadding);
|
||||
const auto reactionsTop = (reactionsInBubble && !_viewButton)
|
||||
? st::mediaInBubbleSkip
|
||||
const auto additionalInfoSkip = (mediaDisplayed
|
||||
&& !media->additionalInfoString().isEmpty())
|
||||
? st::msgDateFont->height
|
||||
: 0;
|
||||
const auto reactionsTop = (reactionsInBubble && !_viewButton)
|
||||
? (additionalInfoSkip + st::mediaInBubbleSkip)
|
||||
: additionalInfoSkip;
|
||||
const auto reactionsHeight = reactionsInBubble
|
||||
? (reactionsTop + _reactions->height())
|
||||
: 0;
|
||||
|
@ -3783,6 +3791,10 @@ int Message::resizeContentGetHeight(int newWidth) {
|
|||
if (reactionsInBubble) {
|
||||
if (!mediaDisplayed || _viewButton) {
|
||||
newHeight += st::mediaInBubbleSkip;
|
||||
} else if (!media->additionalInfoString().isEmpty()) {
|
||||
// In round videos in a web page status text is painted
|
||||
// in the bottom left corner, reactions should be below.
|
||||
newHeight += st::msgDateFont->height;
|
||||
}
|
||||
newHeight += _reactions->height();
|
||||
}
|
||||
|
|
|
@ -829,6 +829,10 @@ bool WebPage::isDisplayed() const {
|
|||
&& !item->Has<HistoryMessageLogEntryOriginal>();
|
||||
}
|
||||
|
||||
QString WebPage::additionalInfoString() const {
|
||||
return _attach ? _attach->additionalInfoString() : QString();
|
||||
}
|
||||
|
||||
TextForMimeData WebPage::selectedText(TextSelection selection) const {
|
||||
auto siteNameResult = _siteName.toTextForMimeData(selection);
|
||||
auto titleResult = _title.toTextForMimeData(
|
||||
|
|
|
@ -40,6 +40,7 @@ public:
|
|||
bool hasTextForCopy() const override {
|
||||
return false; // we do not add _title and _description in FullSelection text copy.
|
||||
}
|
||||
QString additionalInfoString() const override;
|
||||
|
||||
bool toggleSelectionByHandlerClick(const ClickHandlerPtr &p) const override {
|
||||
return _attach && _attach->toggleSelectionByHandlerClick(p);
|
||||
|
|
Loading…
Add table
Reference in a new issue