MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / drawName

Method drawName

Telegram/SourceFiles/window/window_main_menu.cpp:896–921  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

894}
895
896void MainMenu::drawName(Painter &p) {
897 const auto widthText = width()
898 - st::mainMenuCoverNameLeft
899 - _toggleAccounts->rightSkip();
900
901 const auto user = _controller->session().user();
902 if (_nameVersion < user->nameVersion()) {
903 _nameVersion = user->nameVersion();
904 _name.setText(
905 st::semiboldTextStyle,
906 user->name(),
907 Ui::NameTextOptions());
908 moveBadge();
909 }
910 p.setFont(st::semiboldFont);
911 p.setPen(st::windowBoldFg);
912 _name.drawLeftElided(
913 p,
914 st::mainMenuCoverNameLeft,
915 st::mainMenuCoverNameTop,
916 (widthText
917 - (_badge->widget()
918 ? (st::semiboldFont->spacew + _badge->widget()->width())
919 : 0)),
920 width());
921}
922
923void MainMenu::initResetScaleButton() {
924 _controller->widget()->screenValue(

Callers

nothing calls this directly

Calls 8

rightSkipMethod · 0.80
nameVersionMethod · 0.80
userMethod · 0.45
sessionMethod · 0.45
setTextMethod · 0.45
nameMethod · 0.45
widgetMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected