コード例 #1
0
ファイル: aboutbox.cpp プロジェクト: GRIM2D/tdesktop
AboutBox::AboutBox() :
_done(this, lang(lng_about_done), st::aboutCloseButton),
_version(this, qsl("[a href=\"https://desktop.telegram.org/#changelog\"]") + textClean(lng_about_version(lt_version, QString::fromWCharArray(AppVersionStr) + (cDevVersion() ? " dev" : ""))) + qsl("[/a]"), st::aboutVersion, st::defaultTextStyle),
_text(this, lang(lng_about_text), st::aboutLabel, st::aboutTextStyle) {
	
	resizeMaxHeight(st::aboutWidth, st::aboutHeight);

	_version.move(0, st::aboutVersionTop);
	_text.move(0, st::aboutTextTop);

	_headerWidth = st::aboutHeaderFont->width(qsl("Telegram "));
	_subheaderWidth = st::aboutSubheaderFont->width(qsl("Desktop"));

	_done.move(0, height() - _done.height());

	connect(&_done, SIGNAL(clicked()), this, SLOT(onClose()));

	prepare();
}
コード例 #2
0
AboutBox::AboutBox() : AbstractBox(st::aboutWidth)
, _version(this, lng_about_version(lt_version, QString::fromWCharArray(AppVersionStr) + (cDevVersion() ? " dev" : "") + (cBetaVersion() ? qsl(" beta %1").arg(cBetaVersion()) : QString())), st::aboutVersionLink)
, _text1(this, lang(lng_about_text_1), st::aboutLabel, st::aboutTextStyle)
, _text2(this, lang(lng_about_text_2), st::aboutLabel, st::aboutTextStyle)
, _text3(this, QString(), st::aboutLabel, st::aboutTextStyle)
, _done(this, lang(lng_close), st::defaultBoxButton) {
	_text3.setRichText(lng_about_text_3(lt_faq_open, qsl("[a href=\"%1\"]").arg(telegramFaqLink()), lt_faq_close, qsl("[/a]")));

	setMaxHeight(st::boxTitleHeight + st::aboutTextTop + _text1.height() + st::aboutSkip + _text2.height() + st::aboutSkip + _text3.height() + st::boxButtonPadding.top() + _done.height() + st::boxButtonPadding.bottom());

	connect(&_version, SIGNAL(clicked()), this, SLOT(onVersion()));
	connect(&_done, SIGNAL(clicked()), this, SLOT(onClose()));

	prepare();
}