Fixed editing caption of album from context menu.

Fixed #17077.
This commit is contained in:
23rd 2021-10-08 04:55:55 +03:00 committed by John Preston
parent 64aa5480ad
commit ef10bb2bd6
2 changed files with 10 additions and 4 deletions

View File

@ -408,10 +408,14 @@ TextState GroupedMedia::textState(QPoint point, StateRequest request) const {
- (isBubbleBottom() ? st::msgPadding.bottom() : 0)
- _caption.countHeight(captionw);
if (QRect(st::msgPadding.left(), captiony, captionw, height() - captiony).contains(point)) {
return TextState(_parent->data(), _caption.getState(
point - QPoint(st::msgPadding.left(), captiony),
captionw,
request.forText()));
return TextState(
_captionItem
? _captionItem
: _parent->data().get(),
_caption.getState(
point - QPoint(st::msgPadding.left(), captiony),
captionw,
request.forText()));
}
} else if (_parent->media() == this) {
auto fullRight = width();
@ -667,6 +671,7 @@ void GroupedMedia::updateNeedBubbleState() {
if (captionItem) {
_caption = createCaption(captionItem);
}
_captionItem = captionItem;
_needBubble = computeNeedBubble();
}

View File

@ -141,6 +141,7 @@ private:
[[nodiscard]] QMargins groupedPadding() const;
Ui::Text::String _caption;
HistoryItem *_captionItem = nullptr;
std::vector<Part> _parts;
Mode _mode = Mode::Grid;
bool _needBubble = false;