Pause spoilers in reply / edit panels.

This commit is contained in:
John Preston 2022-11-09 12:16:20 +04:00
parent 187f5fa4f3
commit 0b7a2c18a2
4 changed files with 17 additions and 7 deletions

View file

@ -474,6 +474,8 @@ void HistoryMessageReply::paint(
? stm->replyTextPalette
: st->imgReplyTextPalette()),
.spoiler = Ui::Text::DefaultSpoilerCache(),
.now = context.now,
.paused = context.paused,
.elisionLines = 1,
});
p.setTextPalette(stm->textPalette);

View file

@ -7509,6 +7509,8 @@ void HistoryWidget::drawField(Painter &p, const QRect &rect) {
.availableWidth = width() - replyLeft - _fieldBarCancel->width() - st::msgReplyPadding.right(),
.palette = &st::historyComposeAreaPalette,
.spoiler = Ui::Text::DefaultSpoilerCache(),
.now = crl::now(),
.paused = p.inactive(),
.elisionLines = 1,
});
} else {

View file

@ -460,6 +460,8 @@ void FieldHeader::init() {
paintRequest(
) | rpl::start_with_next([=] {
Painter p(this);
p.setInactive(
_controller->isGifPausedAtLeastFor(Window::GifPauseReason::Any));
p.fillRect(rect(), st::historyComposeAreaBg);
const auto position = st::historyReplyIconPosition;
@ -795,6 +797,8 @@ void FieldHeader::paintEditOrReplyToMessage(Painter &p) {
.availableWidth = availableWidth,
.palette = &st::historyComposeAreaPalette,
.spoiler = Ui::Text::DefaultSpoilerCache(),
.now = crl::now(),
.paused = p.inactive(),
.elisionLines = 1,
});
}
@ -926,15 +930,15 @@ ComposeControls::ComposeControls(
_wrap.get(),
st::historyBotCommandStart))
, _autocomplete(std::make_unique<FieldAutocomplete>(
parent,
window))
parent,
window))
, _header(std::make_unique<FieldHeader>(_wrap.get(), _window))
, _voiceRecordBar(std::make_unique<VoiceRecordBar>(
_wrap.get(),
parent,
window,
_send,
st::historySendSize.height()))
_wrap.get(),
parent,
window,
_send,
st::historySendSize.height()))
, _sendMenuType(sendMenuType)
, _unavailableEmojiPasted(unavailableEmojiPasted)
, _saveDraftTimer([=] { saveDraft(); })

View file

@ -354,6 +354,8 @@ void ForwardPanel::paint(
.availableWidth = available,
.palette = &st::historyComposeAreaPalette,
.spoiler = Ui::Text::DefaultSpoilerCache(),
.now = crl::now(),
.paused = p.inactive(),
.elisionLines = 1,
});
}