Added icon to webview buttons from bot keyboards.

This commit is contained in:
23rd 2025-01-22 10:21:22 +03:00
parent a13ca95894
commit f1ffe2a641
5 changed files with 19 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/chat/chat_style.h"
#include "ui/chat/chat_theme.h"
#include "ui/painter.h"
#include "ui/rect.h"
#include "ui/power_saving.h"
#include "history/history.h"
#include "history/history_item.h"
@ -1080,7 +1081,22 @@ void ReplyKeyboard::Style::paintButton(
tx += (tw - st::botKbStyle.font->elidew) / 2;
tw = st::botKbStyle.font->elidew;
}
button.text.drawElided(p, tx, rect.y() + _st->textTop + ((rect.height() - _st->height) / 2), tw, 1, style::al_top);
button.text.drawElided(
p,
tx,
rect.y() + _st->textTop + ((rect.height() - _st->height) / 2),
tw,
1,
style::al_top);
if (button.type == HistoryMessageMarkupButton::Type::SimpleWebView) {
const auto &icon = st::markupWebview;
st::markupWebview.paint(
p,
rect::right(rect) - icon.width() - _st->padding / 2,
rect.y() + _st->padding / 2,
rect.width(),
p.pen().color());
}
}
void HistoryMessageReplyMarkup::createForwarded(

View file

@ -1219,3 +1219,5 @@ chatUniqueTextPadding: margins(12px, 2px, 12px, 8px);
chatUniqueTableSkip: 9px;
chatUniqueRowSkip: 4px;
chatUniqueButtonPadding: margins(12px, 4px, 12px, 16px);
markupWebview: icon {{ "chat/markup_webview", windowFg }};