parent
64aa5480ad
commit
ef10bb2bd6
|
@ -408,10 +408,14 @@ TextState GroupedMedia::textState(QPoint point, StateRequest request) const {
|
||||||
- (isBubbleBottom() ? st::msgPadding.bottom() : 0)
|
- (isBubbleBottom() ? st::msgPadding.bottom() : 0)
|
||||||
- _caption.countHeight(captionw);
|
- _caption.countHeight(captionw);
|
||||||
if (QRect(st::msgPadding.left(), captiony, captionw, height() - captiony).contains(point)) {
|
if (QRect(st::msgPadding.left(), captiony, captionw, height() - captiony).contains(point)) {
|
||||||
return TextState(_parent->data(), _caption.getState(
|
return TextState(
|
||||||
point - QPoint(st::msgPadding.left(), captiony),
|
_captionItem
|
||||||
captionw,
|
? _captionItem
|
||||||
request.forText()));
|
: _parent->data().get(),
|
||||||
|
_caption.getState(
|
||||||
|
point - QPoint(st::msgPadding.left(), captiony),
|
||||||
|
captionw,
|
||||||
|
request.forText()));
|
||||||
}
|
}
|
||||||
} else if (_parent->media() == this) {
|
} else if (_parent->media() == this) {
|
||||||
auto fullRight = width();
|
auto fullRight = width();
|
||||||
|
@ -667,6 +671,7 @@ void GroupedMedia::updateNeedBubbleState() {
|
||||||
if (captionItem) {
|
if (captionItem) {
|
||||||
_caption = createCaption(captionItem);
|
_caption = createCaption(captionItem);
|
||||||
}
|
}
|
||||||
|
_captionItem = captionItem;
|
||||||
_needBubble = computeNeedBubble();
|
_needBubble = computeNeedBubble();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,6 +141,7 @@ private:
|
||||||
[[nodiscard]] QMargins groupedPadding() const;
|
[[nodiscard]] QMargins groupedPadding() const;
|
||||||
|
|
||||||
Ui::Text::String _caption;
|
Ui::Text::String _caption;
|
||||||
|
HistoryItem *_captionItem = nullptr;
|
||||||
std::vector<Part> _parts;
|
std::vector<Part> _parts;
|
||||||
Mode _mode = Mode::Grid;
|
Mode _mode = Mode::Grid;
|
||||||
bool _needBubble = false;
|
bool _needBubble = false;
|
||||||
|
|
Loading…
Reference in New Issue