mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 05:07:10 +02:00
Added icon to webview buttons from bot keyboards.
This commit is contained in:
parent
a13ca95894
commit
f1ffe2a641
5 changed files with 19 additions and 1 deletions
BIN
Telegram/Resources/icons/chat/markup_webview.png
Normal file
BIN
Telegram/Resources/icons/chat/markup_webview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 663 B |
BIN
Telegram/Resources/icons/chat/markup_webview@2x.png
Normal file
BIN
Telegram/Resources/icons/chat/markup_webview@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 761 B |
BIN
Telegram/Resources/icons/chat/markup_webview@3x.png
Normal file
BIN
Telegram/Resources/icons/chat/markup_webview@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -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(
|
||||
|
|
|
@ -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 }};
|
||||
|
|
Loading…
Add table
Reference in a new issue