mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Added verified mark of web view bots to box of confirmation to open.
This commit is contained in:
parent
7e14277ead
commit
9077db2e97
1 changed files with 32 additions and 12 deletions
|
@ -384,11 +384,9 @@ void FillBotUsepic(
|
||||||
const auto userpic = Ui::CreateChild<Ui::UserpicButton>(
|
const auto userpic = Ui::CreateChild<Ui::UserpicButton>(
|
||||||
box->verticalLayout(),
|
box->verticalLayout(),
|
||||||
bot,
|
bot,
|
||||||
st::mainMenuUserpic);
|
st::infoPersonalChannelUserpic);
|
||||||
Ui::AddSkip(box->verticalLayout());
|
Ui::AddSkip(box->verticalLayout());
|
||||||
aboutLabel->setClickHandlerFilter([=](
|
aboutLabel->setClickHandlerFilter([=](auto &&...) {
|
||||||
const ClickHandlerPtr &,
|
|
||||||
Qt::MouseButton) {
|
|
||||||
if (const auto strong = weak.get()) {
|
if (const auto strong = weak.get()) {
|
||||||
strong->showPeerHistory(
|
strong->showPeerHistory(
|
||||||
bot->id,
|
bot->id,
|
||||||
|
@ -397,14 +395,36 @@ void FillBotUsepic(
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
Ui::IconWithTitle(
|
const auto title = Ui::CreateChild<Ui::RpWidget>(box->verticalLayout());
|
||||||
box->verticalLayout(),
|
const auto titleLabel = Ui::CreateChild<Ui::FlatLabel>(
|
||||||
userpic,
|
title,
|
||||||
Ui::CreateChild<Ui::FlatLabel>(
|
rpl::single(bot->name()),
|
||||||
box->verticalLayout(),
|
box->getDelegate()->style().title);
|
||||||
rpl::single(bot->name()),
|
const auto icon = bot->isVerified() ? &st::infoVerifiedCheck : nullptr;
|
||||||
box->getDelegate()->style().title),
|
title->resize(
|
||||||
aboutLabel);
|
titleLabel->width() + (icon ? icon->width() : 0),
|
||||||
|
titleLabel->height());
|
||||||
|
title->widthValue(
|
||||||
|
) | rpl::distinct_until_changed() | rpl::start_with_next([=](int w) {
|
||||||
|
titleLabel->resizeToWidth(w
|
||||||
|
- (icon ? icon->width() + st::lineWidth : 0));
|
||||||
|
}, title->lifetime());
|
||||||
|
if (icon) {
|
||||||
|
title->paintRequest(
|
||||||
|
) | rpl::start_with_next([=] {
|
||||||
|
auto p = Painter(title);
|
||||||
|
p.fillRect(title->rect(), Qt::transparent);
|
||||||
|
icon->paint(
|
||||||
|
p,
|
||||||
|
std::min(
|
||||||
|
titleLabel->textMaxWidth() + st::lineWidth,
|
||||||
|
title->width() - st::lineWidth - icon->width()),
|
||||||
|
(title->height() - icon->height()) / 2,
|
||||||
|
title->width());
|
||||||
|
}, title->lifetime());
|
||||||
|
}
|
||||||
|
|
||||||
|
Ui::IconWithTitle(box->verticalLayout(), userpic, title, aboutLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
class BotAction final : public Ui::Menu::ItemBase {
|
class BotAction final : public Ui::Menu::ItemBase {
|
||||||
|
|
Loading…
Add table
Reference in a new issue