2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Bot keyboard button with type url / callback / phone / location

now can be displayed with an icon in the upper-right corner.

Inline bot keyboards almost done.
This commit is contained in:
John Preston
2016-03-30 20:42:01 +04:00
parent 3210aecbd2
commit b981472877
16 changed files with 296 additions and 124 deletions

View File

@@ -2170,6 +2170,16 @@ void BotKeyboard::Style::paintButtonBg(Painter &p, const QRect &rect, bool down,
}
}
void BotKeyboard::Style::paintButtonIcon(Painter &p, const QRect &rect, HistoryMessageReplyMarkup::Button::Type type) const {
// they should not appear here
}
int BotKeyboard::Style::minButtonWidth(HistoryMessageReplyMarkup::Button::Type type) const {
int result = 2 * buttonPadding();
// they should not appear here
return result;
}
void BotKeyboard::resizeEvent(QResizeEvent *e) {
if (!_impl) return;
@@ -5157,7 +5167,9 @@ void HistoryWidget::sendBotCallback(PeerData *peer, const QString &cmd, MsgId re
}
void HistoryWidget::botCallbackDone(const MTPmessages_BotCallbackAnswer &answer) {
if (answer.type() == mtpc_messages_botCallbackAnswer) {
Ui::showLayer(new InformBox(qs(answer.c_messages_botCallbackAnswer().vmessage)));
}
}
bool HistoryWidget::botCallbackFail(const RPCError &error) {