mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 13:47:05 +02:00
Add an icon to a webview bot button.
This commit is contained in:
parent
4216d72c67
commit
2253cd86e5
7 changed files with 10 additions and 0 deletions
BIN
Telegram/Resources/icons/inline_button_web.png
Normal file
BIN
Telegram/Resources/icons/inline_button_web.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 239 B |
BIN
Telegram/Resources/icons/inline_button_web@2x.png
Normal file
BIN
Telegram/Resources/icons/inline_button_web@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 298 B |
BIN
Telegram/Resources/icons/inline_button_web@3x.png
Normal file
BIN
Telegram/Resources/icons/inline_button_web@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 393 B |
|
@ -143,6 +143,8 @@ void KeyboardStyle::paintButtonIcon(
|
|||
case Type::Buy: return &st->msgBotKbPaymentIcon();
|
||||
case Type::SwitchInlineSame:
|
||||
case Type::SwitchInline: return &st->msgBotKbSwitchPmIcon();
|
||||
case Type::WebView:
|
||||
case Type::SimpleWebView: return &st->msgBotKbWebviewIcon();
|
||||
}
|
||||
return nullptr;
|
||||
}();
|
||||
|
@ -174,6 +176,8 @@ int KeyboardStyle::minButtonWidth(
|
|||
case Type::Callback:
|
||||
case Type::CallbackWithPassword:
|
||||
case Type::Game: iconWidth = st::historySendingInvertedIcon.width(); break;
|
||||
case Type::WebView:
|
||||
case Type::SimpleWebView: iconWidth = st::msgBotKbWebviewIcon.width(); break;
|
||||
}
|
||||
if (iconWidth > 0) {
|
||||
result = std::max(result, 2 * iconWidth + 4 * int(st::msgBotKbIconPadding));
|
||||
|
|
|
@ -483,6 +483,7 @@ msgBotKbIconPadding: 2px;
|
|||
msgBotKbUrlIcon: icon {{ "inline_button_url", msgBotKbIconFg }};
|
||||
msgBotKbSwitchPmIcon: icon {{ "inline_button_switch", msgBotKbIconFg }};
|
||||
msgBotKbPaymentIcon: icon {{ "inline_button_card", msgBotKbIconFg }};
|
||||
msgBotKbWebviewIcon: icon {{ "inline_button_web", msgBotKbIconFg }};
|
||||
msgBotKbButton: BotKeyboardButton {
|
||||
margin: 5px;
|
||||
padding: 10px;
|
||||
|
|
|
@ -124,6 +124,7 @@ ChatStyle::ChatStyle() {
|
|||
make(_msgBotKbUrlIcon, st::msgBotKbUrlIcon);
|
||||
make(_msgBotKbPaymentIcon, st::msgBotKbPaymentIcon);
|
||||
make(_msgBotKbSwitchPmIcon, st::msgBotKbSwitchPmIcon);
|
||||
make(_msgBotKbWebviewIcon, st::msgBotKbWebviewIcon);
|
||||
make(_historyFastCommentsIcon, st::historyFastCommentsIcon);
|
||||
make(_historyFastShareIcon, st::historyFastShareIcon);
|
||||
make(_historyGoToOriginalIcon, st::historyGoToOriginalIcon);
|
||||
|
|
|
@ -232,6 +232,9 @@ public:
|
|||
[[nodiscard]] const style::icon &msgBotKbSwitchPmIcon() const {
|
||||
return _msgBotKbSwitchPmIcon;
|
||||
}
|
||||
[[nodiscard]] const style::icon &msgBotKbWebviewIcon() const {
|
||||
return _msgBotKbWebviewIcon;
|
||||
}
|
||||
[[nodiscard]] const style::icon &historyFastCommentsIcon() const {
|
||||
return _historyFastCommentsIcon;
|
||||
}
|
||||
|
@ -326,6 +329,7 @@ private:
|
|||
style::icon _msgBotKbUrlIcon = { Qt::Uninitialized };
|
||||
style::icon _msgBotKbPaymentIcon = { Qt::Uninitialized };
|
||||
style::icon _msgBotKbSwitchPmIcon = { Qt::Uninitialized };
|
||||
style::icon _msgBotKbWebviewIcon = { Qt::Uninitialized };
|
||||
style::icon _historyFastCommentsIcon = { Qt::Uninitialized };
|
||||
style::icon _historyFastShareIcon = { Qt::Uninitialized };
|
||||
style::icon _historyGoToOriginalIcon = { Qt::Uninitialized };
|
||||
|
|
Loading…
Add table
Reference in a new issue