void PhoneWidget::resizeEvent(QResizeEvent *e) { Step::resizeEvent(e); _country->moveToLeft(contentLeft(), contentTop() + st::introStepFieldTop); auto phoneTop = _country->y() + _country->height() + st::introPhoneTop; _code->moveToLeft(contentLeft(), phoneTop); _phone->moveToLeft(contentLeft() + _country->width() - st::introPhone.width, phoneTop); updateSignupGeometry(); }
int CoverWidget::resizeGetHeight(int newWidth) { int newHeight = 0; newHeight += st::settingsMarginTop; _userpicButton->moveToLeft(contentLeft() + st::settingsPhotoLeft, newHeight, newWidth); int infoLeft = _userpicButton->x() + _userpicButton->width(); _statusPosition = QPoint(infoLeft + st::settingsStatusLeft, _userpicButton->y() + st::settingsStatusTop); if (_cancelPhotoUpload) { _cancelPhotoUpload->moveToLeft(_statusPosition.x() + st::settingsStatusFont->width(_statusText) + st::settingsStatusFont->spacew, _statusPosition.y(), newWidth); } int buttonLeft = _userpicButton->x() + _userpicButton->width() + st::settingsButtonLeft; int buttonsRight = newWidth - st::settingsButtonSkip; _setPhoto->moveToLeft(buttonLeft, _userpicButton->y() + st::settingsButtonTop, newWidth); buttonLeft += _setPhoto->width() + st::settingsButtonSkip; _editName->moveToLeft(buttonLeft, _setPhoto->y(), newWidth); _editNameVisible = (buttonLeft + _editName->width() + st::settingsButtonSkip <= newWidth); _editName->setVisible(_editNameVisible); refreshNameGeometry(newWidth); newHeight += st::settingsPhotoSize; newHeight += st::settingsMarginBottom; _dividerTop = newHeight; newHeight += st::profileDividerFill.height(); newHeight += st::settingsBlocksTop; resizeDropArea(); return newHeight; }
int BlockWidget::resizeGetHeight(int newWidth) { int x = contentLeft(), result = contentTop(); int availw = newWidth - x; auto margins = getMargins(); _content->resizeToWidth(availw); _content->moveToLeft(margins.left() + x, margins.top() + result, newWidth); result += _content->heightNoMargins() + st::settingsBlockMarginBottom; return result; }
void BlockWidget::paintTitle(Painter &p) { if (emptyTitle()) return; p.setFont(st::settingsBlockTitleFont); p.setPen(st::settingsBlockTitleFg); auto margins = getMargins(); auto titleTop = st::settingsBlockMarginTop + st::settingsBlockTitleTop; p.drawTextLeft( margins.left() + contentLeft(), margins.top() + titleTop, width(), _title); }
int CoverWidget::resizeGetHeight(int newWidth) { int newHeight = 0; newHeight += st::settingsMarginTop; auto margins = getMargins(); _userpicButton->moveToLeft( margins.left() + contentLeft() + st::settingsPhotoLeft, margins.top() + newHeight, newWidth); int infoLeft = _userpicButton->x() + _userpicButton->width(); _statusPosition = QPoint(infoLeft + st::settingsStatusLeft, _userpicButton->y() + st::settingsStatusTop); if (_cancelPhotoUpload) { _cancelPhotoUpload->moveToLeft( margins.left() + _statusPosition.x() + st::settingsStatusFont->width(_statusText) + st::settingsStatusFont->spacew, margins.top() + _statusPosition.y(), newWidth); } refreshButtonsGeometry(newWidth); refreshNameGeometry(newWidth); newHeight += st::settingsPhoto.size.height(); newHeight += st::settingsMarginBottom; _dividerTop = newHeight; newHeight += st::profileDividerLeft.height(); newHeight += st::settingsBlocksTop; resizeDropArea(); return newHeight; }
void PhoneWidget::updateSignupGeometry() { if (_signup) { _signup->moveToLeft(contentLeft() + st::buttonRadius, contentTop() + st::introDescriptionTop); } }
int GeneralWidget::resizeGetHeight(int newWidth) { _changeLanguage->moveToRight(contentLeft(), st::settingsBlockMarginTop + st::settingsBlockTitleTop + st::settingsBlockTitleFont->ascent - st::defaultLinkButton.font->ascent, newWidth); return BlockWidget::resizeGetHeight(newWidth); }
void CodeWidget::updateControlsGeometry() { _code->moveToLeft(contentLeft(), contentTop() + st::introStepFieldTop); auto linkTop = _code->y() + _code->height() + st::introLinkTop; _noTelegramCode->moveToLeft(contentLeft() + st::buttonRadius, linkTop); _callLabel->moveToLeft(contentLeft() + st::buttonRadius, linkTop); }