diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 8c9251ad4e..5341909aca 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -2114,17 +2114,17 @@ verifiedCheckInv: sprite(299px, 221px, 14px, 14px); verifiedCheckPos: point(4px, 2px); botKbDuration: 200; -botKbBg: #f7f7f7; -botKbOverBg: #e8ecef; -botKbDownBg: #dfe3e6; -botKbColor: #8a8a8f; -botKbFont: font(16px); +botKbBg: #edf1f5; +botKbOverBg: #d8e2ec; +botKbDownBg: #d8e2ec; +botKbColor: #4b565f; +botKbFont: font(15px semibold); botKbButton: botKeyboardButton { margin: 10px; padding: 10px; - height: 36px; - textTop: 8px; - downTextTop: 9px; + height: 38px; + textTop: 9px; + downTextTop: 10px; } botKbTinyButton: botKeyboardButton { margin: 4px; diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index a565cb0872..aa298b0e55 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -244,6 +244,12 @@ namespace Notify { if (MainWidget *m = App::main()) m->notify_inlineBotRequesting(requesting); } + void replyMarkupUpdated(const HistoryItem *item) { + if (MainWidget *m = App::main()) { + m->notify_replyMarkupUpdated(item); + } + } + void migrateUpdated(PeerData *peer) { if (MainWidget *m = App::main()) m->notify_migrateUpdated(peer); } diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index ad7a985f3d..943d263b9e 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -94,6 +94,7 @@ namespace Notify { void botCommandsChanged(UserData *user); void inlineBotRequesting(bool requesting); + void replyMarkupUpdated(const HistoryItem *item); void migrateUpdated(PeerData *peer); diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 0733302f41..a84eba91b7 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -3574,7 +3574,7 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi bool logCrashString = (rand_value() % 4 == 1); if (logCrashString) { - SignalHandlers::setCrashAnnotationRef("CrashString", &part); + SignalHandlers::setCrashAnnotationRef("CrashString", &str); } BlockParser parser(&engine, this, minResizeWidth, _from, part); if (logCrashString) { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index a14ebdf579..cd8cd615ec 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -3533,7 +3533,6 @@ HistoryPhoto::HistoryPhoto(PhotoData *photo, const QString &caption, const Histo , _data(photo) , _caption(st::minPhotoSize - st::msgPadding.left() - st::msgPadding.right()) { setLinks(MakeShared(_data), MakeShared(_data), MakeShared(_data)); - if (!caption.isEmpty()) { _caption.setText(st::msgFont, caption + parent->skipBlock(), itemTextNoMonoOptions(parent)); } @@ -7058,6 +7057,8 @@ void HistoryMessage::setReplyMarkup(const MTPReplyMarkup *markup) { if (Has()) { RemoveComponents(HistoryMessageReplyMarkup::Bit()); setPendingInitDimensions(); + + Notify::replyMarkupUpdated(this); } } else { if (!Has()) { @@ -7065,6 +7066,8 @@ void HistoryMessage::setReplyMarkup(const MTPReplyMarkup *markup) { } Get()->create(*markup); setPendingInitDimensions(); + + Notify::replyMarkupUpdated(this); } } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 209bb47172..f283710b79 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1510,7 +1510,7 @@ public: } virtual void applyEdition(const MTPDmessage &message) { } - virtual void updateMedia(const MTPMessageMedia *media, bool edited = false) { + virtual void updateMedia(const MTPMessageMedia *media) { } virtual int32 addToOverview(AddToOverviewMethod method) { return 0; @@ -2835,8 +2835,8 @@ public: QString notificationText() const override; void applyEdition(const MTPDmessage &message) override; - void updateMedia(const MTPMessageMedia *media, bool edited = false) override { - if (!edited && media && _media && _media->type() != MediaTypeWebPage) { + void updateMedia(const MTPMessageMedia *media) override { + if (media && _media && _media->type() != MediaTypeWebPage) { _media->updateFrom(*media, this); } else { setMedia(media); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index b1509d867e..62b905ba84 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -2136,8 +2136,8 @@ void ReportSpamPanel::setReported(bool reported, PeerData *onPeer) { } BotKeyboard::BotKeyboard() { - setGeometry(0, 0, _st->margin, _st->margin); - _height = _st->margin; + setGeometry(0, 0, _st->margin, st::botKbScroll.deltat); + _height = st::botKbScroll.deltat; setMouseTracking(true); } @@ -2149,8 +2149,8 @@ void BotKeyboard::paintEvent(QPaintEvent *e) { if (_impl) { int x = rtl() ? st::botKbScroll.width : _st->margin; - p.translate(x, _st->margin); - _impl->paint(p, clip.translated(-x, -_st->margin)); + p.translate(x, st::botKbScroll.deltat); + _impl->paint(p, clip.translated(-x, -st::botKbScroll.deltat)); } } @@ -2195,14 +2195,14 @@ void BotKeyboard::resizeEvent(QResizeEvent *e) { updateStyle(); - _height = _impl->naturalHeight() + 2 * _st->margin; + _height = _impl->naturalHeight() + st::botKbScroll.deltat + st::botKbScroll.deltab; if (_maximizeSize) _height = qMax(_height, _maxOuterHeight); if (height() != _height) { resize(width(), _height); return; } - _impl->resize(width() - _st->margin - st::botKbScroll.width, _height - 2 * _st->margin); + _impl->resize(width() - _st->margin - st::botKbScroll.width, _height - (st::botKbScroll.deltat + st::botKbScroll.deltab)); } void BotKeyboard::mousePressEvent(QMouseEvent *e) { @@ -2246,9 +2246,11 @@ void BotKeyboard::clickHandlerPressedChanged(const ClickHandlerPtr &p, bool pres _impl->clickHandlerPressedChanged(p, pressed); } -bool BotKeyboard::updateMarkup(HistoryItem *to) { +bool BotKeyboard::updateMarkup(HistoryItem *to, bool force) { if (to && to->definesReplyKeyboard()) { - if (_wasForMsgId == FullMsgId(to->channelId(), to->id)) return false; + if (_wasForMsgId == FullMsgId(to->channelId(), to->id) && !force) { + return false; + } _wasForMsgId = FullMsgId(to->channelId(), to->id); clearSelection(); @@ -2261,7 +2263,7 @@ bool BotKeyboard::updateMarkup(HistoryItem *to) { _impl.reset(markup->rows.isEmpty() ? nullptr : new ReplyKeyboard(to, MakeUnique