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 ? stm->replyTextPalette
: st->imgReplyTextPalette()), : st->imgReplyTextPalette()),
.spoiler = Ui::Text::DefaultSpoilerCache(), .spoiler = Ui::Text::DefaultSpoilerCache(),
.now = context.now,
.paused = context.paused,
.elisionLines = 1, .elisionLines = 1,
}); });
p.setTextPalette(stm->textPalette); 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(), .availableWidth = width() - replyLeft - _fieldBarCancel->width() - st::msgReplyPadding.right(),
.palette = &st::historyComposeAreaPalette, .palette = &st::historyComposeAreaPalette,
.spoiler = Ui::Text::DefaultSpoilerCache(), .spoiler = Ui::Text::DefaultSpoilerCache(),
.now = crl::now(),
.paused = p.inactive(),
.elisionLines = 1, .elisionLines = 1,
}); });
} else { } else {

View file

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

View file

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