mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix bottom info display in media.
This commit is contained in:
parent
eafc01e02b
commit
e8a929bdbd
5 changed files with 30 additions and 22 deletions
|
@ -2451,7 +2451,11 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
const auto quoteOffset = selected.offset;
|
const auto quoteOffset = selected.offset;
|
||||||
text.replace('&', u"&&"_q);
|
text.replace('&', u"&&"_q);
|
||||||
_menu->addAction(text, [=] {
|
_menu->addAction(text, [=] {
|
||||||
if (canSendReply && !base::IsCtrlPressed()) {
|
const auto still = session->data().message(itemId);
|
||||||
|
const auto forceAnotherChat = base::IsCtrlPressed()
|
||||||
|
&& still
|
||||||
|
&& still->allowsForward();
|
||||||
|
if (canSendReply && !forceAnotherChat) {
|
||||||
_widget->replyToMessage({
|
_widget->replyToMessage({
|
||||||
.messageId = itemId,
|
.messageId = itemId,
|
||||||
.quote = quote,
|
.quote = quote,
|
||||||
|
|
|
@ -331,9 +331,12 @@ RepliesWidget::RepliesWidget(
|
||||||
? Data::CanSendAnything(_topic)
|
? Data::CanSendAnything(_topic)
|
||||||
: Data::CanSendAnything(_history->peer);
|
: Data::CanSendAnything(_history->peer);
|
||||||
const auto &to = request.to;
|
const auto &to = request.to;
|
||||||
if (_joinGroup || !canSendReply || request.forceAnotherChat) {
|
const auto still = _history->owner().message(to.messageId);
|
||||||
|
const auto allowInAnotherChat = still && still->allowsForward();
|
||||||
|
if (allowInAnotherChat
|
||||||
|
&& (_joinGroup || !canSendReply || request.forceAnotherChat)) {
|
||||||
Controls::ShowReplyToChatBox(controller->uiShow(), { to });
|
Controls::ShowReplyToChatBox(controller->uiShow(), { to });
|
||||||
} else {
|
} else if (!_joinGroup && canSendReply) {
|
||||||
replyToMessage(to);
|
replyToMessage(to);
|
||||||
_composeControls->focus();
|
_composeControls->focus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -762,7 +762,8 @@ void Gif::draw(Painter &p, const PaintContext &context) const {
|
||||||
fullRight = maxRight;
|
fullRight = maxRight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isRound || needInfoDisplay()) {
|
if (isRound
|
||||||
|
|| ((!bubble || isBubbleBottom()) && needInfoDisplay())) {
|
||||||
_parent->drawInfo(
|
_parent->drawInfo(
|
||||||
p,
|
p,
|
||||||
context,
|
context,
|
||||||
|
@ -1117,7 +1118,9 @@ TextState Gif::textState(QPoint point, StateRequest request) const {
|
||||||
? _cancell
|
? _cancell
|
||||||
: _savel;
|
: _savel;
|
||||||
}
|
}
|
||||||
if (unwrapped || !bubble) {
|
const auto checkBottomInfo = !inWebPage
|
||||||
|
&& (unwrapped || !bubble || isBubbleBottom());
|
||||||
|
if (checkBottomInfo) {
|
||||||
auto fullRight = usex + paintx + usew;
|
auto fullRight = usex + paintx + usew;
|
||||||
auto fullBottom = painty + painth;
|
auto fullBottom = painty + painth;
|
||||||
auto maxRight = _parent->width() - st::msgMargin.left();
|
auto maxRight = _parent->width() - st::msgMargin.left();
|
||||||
|
@ -1136,19 +1139,17 @@ TextState Gif::textState(QPoint point, StateRequest request) const {
|
||||||
fullRight = maxRight;
|
fullRight = maxRight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!inWebPage) {
|
const auto bottomInfoResult = _parent->bottomInfoTextState(
|
||||||
const auto bottomInfoResult = _parent->bottomInfoTextState(
|
fullRight,
|
||||||
fullRight,
|
fullBottom,
|
||||||
fullBottom,
|
point,
|
||||||
point,
|
(unwrapped
|
||||||
(unwrapped
|
? InfoDisplayType::Background
|
||||||
? InfoDisplayType::Background
|
: InfoDisplayType::Image));
|
||||||
: InfoDisplayType::Image));
|
if (bottomInfoResult.link
|
||||||
if (bottomInfoResult.link
|
|| bottomInfoResult.cursor != CursorState::None
|
||||||
|| bottomInfoResult.cursor != CursorState::None
|
|| bottomInfoResult.customTooltip) {
|
||||||
|| bottomInfoResult.customTooltip) {
|
return bottomInfoResult;
|
||||||
return bottomInfoResult;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (const auto size = bubble ? std::nullopt : _parent->rightActionSize()) {
|
if (const auto size = bubble ? std::nullopt : _parent->rightActionSize()) {
|
||||||
const auto rightActionWidth = size->width();
|
const auto rightActionWidth = size->width();
|
||||||
|
|
|
@ -396,7 +396,7 @@ void GroupedMedia::draw(Painter &p, const PaintContext &context) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// date
|
// date
|
||||||
if (_parent->media() == this && isBubbleBottom()) {
|
if (_parent->media() == this && (!_parent->hasBubble() || isBubbleBottom())) {
|
||||||
auto fullRight = width();
|
auto fullRight = width();
|
||||||
auto fullBottom = height();
|
auto fullBottom = height();
|
||||||
if (needInfoDisplay()) {
|
if (needInfoDisplay()) {
|
||||||
|
@ -455,7 +455,7 @@ PointState GroupedMedia::pointState(QPoint point) const {
|
||||||
TextState GroupedMedia::textState(QPoint point, StateRequest request) const {
|
TextState GroupedMedia::textState(QPoint point, StateRequest request) const {
|
||||||
const auto groupPadding = groupedPadding();
|
const auto groupPadding = groupedPadding();
|
||||||
auto result = getPartState(point - QPoint(0, groupPadding.top()), request);
|
auto result = getPartState(point - QPoint(0, groupPadding.top()), request);
|
||||||
if (_parent->media() == this) {
|
if (_parent->media() == this && (!_parent->hasBubble() || isBubbleBottom())) {
|
||||||
auto fullRight = width();
|
auto fullRight = width();
|
||||||
auto fullBottom = height();
|
auto fullBottom = height();
|
||||||
const auto bottomInfoResult = _parent->bottomInfoTextState(
|
const auto bottomInfoResult = _parent->bottomInfoTextState(
|
||||||
|
|
|
@ -364,7 +364,7 @@ void Photo::draw(Painter &p, const PaintContext &context) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// date
|
// date
|
||||||
if (isBubbleBottom() && !inWebPage) {
|
if (!inWebPage && (!bubble || isBubbleBottom())) {
|
||||||
auto fullRight = paintx + paintw;
|
auto fullRight = paintx + paintw;
|
||||||
auto fullBottom = painty + painth;
|
auto fullBottom = painty + painth;
|
||||||
if (needInfoDisplay()) {
|
if (needInfoDisplay()) {
|
||||||
|
@ -621,7 +621,7 @@ TextState Photo::textState(QPoint point, StateRequest request) const {
|
||||||
result.cursor = CursorState::Enlarge;
|
result.cursor = CursorState::Enlarge;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isBubbleBottom() && _parent->media() == this) {
|
if (_parent->media() == this && (!_parent->hasBubble() || isBubbleBottom())) {
|
||||||
auto fullRight = paintx + paintw;
|
auto fullRight = paintx + paintw;
|
||||||
auto fullBottom = painty + painth;
|
auto fullBottom = painty + painth;
|
||||||
const auto bottomInfoResult = _parent->bottomInfoTextState(
|
const auto bottomInfoResult = _parent->bottomInfoTextState(
|
||||||
|
|
Loading…
Add table
Reference in a new issue