Exemplo n.º 1
0
void AboutBox::prepare() {
	setTitle(qsl("Telegram Desktop"));

	addButton(lang(lng_close), [this] { closeBox(); });

	_text3->setRichText(lng_about_text_3(lt_faq_open, qsl("[a href=\"%1\"]").arg(telegramFaqLink()), lt_faq_close, qsl("[/a]")));

	_version->setClickedCallback([this] { showVersionHistory(); });

	setDimensions(st::aboutWidth, st::aboutTextTop + _text1->height() + st::aboutSkip + _text2->height() + st::aboutSkip + _text3->height());
}
void AboutBox::prepare() {
	setTitle([] { return qsl("Telegram Desktop"); });

	addButton(langFactory(lng_close), [this] { closeBox(); });

	const auto linkFilter = [](const ClickHandlerPtr &link, auto button) {
		if (const auto url = dynamic_cast<UrlClickHandler*>(link.get())) {
			url->UrlClickHandler::onClick({ button });
			return false;
		}
		return true;
	};

	_text3->setRichText(lng_about_text_3(lt_faq_open, qsl("[a href=\"%1\"]").arg(telegramFaqLink()), lt_faq_close, qsl("[/a]")));
	_text1->setClickHandlerFilter(linkFilter);
	_text2->setClickHandlerFilter(linkFilter);
	_text3->setClickHandlerFilter(linkFilter);

	_version->setClickedCallback([this] { showVersionHistory(); });

	setDimensions(st::aboutWidth, st::aboutTextTop + _text1->height() + st::aboutSkip + _text2->height() + st::aboutSkip + _text3->height());
}