Add info button to AI Tools box.

This commit is contained in:
John Preston
2026-04-06 14:23:19 +07:00
parent 8fecab58a9
commit 6fc6bb48ff
2 changed files with 17 additions and 2 deletions
+8
View File
@@ -1330,3 +1330,11 @@ aiComposeBoxWithSend: Box(aiComposeBox) {
buttonPadding: margins(16px, 12px, 66px, 12px);
}
aiComposeSendButtonSkip: 8px;
aiComposeBoxClose: IconButton(boxTitleClose) {
ripple: defaultRippleAnimation;
}
aiComposeBoxInfoButton: IconButton(boxTitleClose) {
icon: icon {{ "menu/info", boxTitleCloseFg }};
iconOver: icon {{ "menu/info", boxTitleCloseFgOver }};
ripple: defaultRippleAnimation;
}
@@ -26,6 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "main/main_session.h"
#include "settings/sections/settings_premium.h"
#include "spellcheck/platform/platform_language.h"
#include "ui/boxes/about_cocoon_box.h"
#include "ui/boxes/choose_language_box.h"
#include "ui/chat/chat_style.h"
#include "ui/controls/labeled_emoji_tabs.h"
@@ -1397,9 +1398,12 @@ void ComposeAiBox(not_null<Ui::GenericBox*> box, ComposeAiBoxArgs &&args) {
box->setNoContentMargin(true);
box->setWidth(st::boxWideWidth);
const auto session = args.session;
box->addTopButton(st::boxTitleClose, [=] {
box->addTopButton(st::aiComposeBoxClose, [=] {
box->closeBox();
});
box->addTopButton(st::aiComposeBoxInfoButton, [=] {
box->uiShow()->show(Box(Ui::AboutCocoonBox));
});
const auto body = box->verticalLayout();
const auto tabsSkip = QMargins(0, 0, 0, st::aiComposeBoxStyleTabsSkip);
@@ -1493,9 +1497,12 @@ void ComposeAiBox(not_null<Ui::GenericBox*> box, ComposeAiBoxArgs &&args) {
}
*sendButton = nullptr;
box->clearButtons();
box->addTopButton(st::boxTitleClose, [=] {
box->addTopButton(st::aiComposeBoxClose, [=] {
box->closeBox();
});
box->addTopButton(st::aiComposeBoxInfoButton, [=] {
box->uiShow()->show(Box(Ui::AboutCocoonBox));
});
if (*premiumFlooded) {
auto helper = Ui::Text::CustomEmojiHelper();