void MainWindow::setTitleVisible(bool visible) { if (_title && (_title->isHidden() == visible)) { _title->setVisible(visible); updateControlsGeometry(); } titleVisibilityChangedHook(); }
void MainMenu::checkSelf() { if (auto self = App::self()) { auto showSelfChat = [] { if (auto self = App::self()) { App::main()->choosePeer(self->id, ShowAtUnreadMsgId); } }; _userpicButton.create( this, _controller, self, Ui::UserpicButton::Role::Custom, st::mainMenuUserpic); _userpicButton->setClickedCallback(showSelfChat); _userpicButton->show(); _cloudButton.create(this, st::mainMenuCloudButton); _cloudButton->setClickedCallback(showSelfChat); _cloudButton->show(); update(); updateControlsGeometry(); } else { _userpicButton.destroy(); _cloudButton.destroy(); } }
int MainWindow::tryToExtendWidthBy(int addToWidth) { auto desktop = QDesktopWidget().availableGeometry(this); auto inner = geometry(); accumulate_min( addToWidth, std::max(desktop.width() - inner.width(), 0)); auto newWidth = inner.width() + addToWidth; auto newLeft = std::min( inner.x(), desktop.x() + desktop.width() - newWidth); if (inner.x() != newLeft || inner.width() != newWidth) { setGeometry(newLeft, inner.y(), newWidth, inner.height()); } else { updateControlsGeometry(); } return addToWidth; }
void MainWindow::showRightColumn(object_ptr<TWidget> widget) { auto wasWidth = width(); auto wasRightWidth = _rightColumn ? _rightColumn->width() : 0; _rightColumn = std::move(widget); if (_rightColumn) { _rightColumn->setParent(this); _rightColumn->show(); _rightColumn->setFocus(); } else if (App::wnd()) { App::wnd()->setInnerFocus(); } auto nowRightWidth = _rightColumn ? _rightColumn->width() : 0; setMinimumWidth(st::windowMinWidth + nowRightWidth); if (!isMaximized()) { tryToExtendWidthBy(wasWidth + nowRightWidth - wasRightWidth - width()); } else { updateControlsGeometry(); } }
void MainMenu::resizeEvent(QResizeEvent *e) { _menu->setForceWidth(width()); updateControlsGeometry(); }
void WarningWidget::refreshLang() { InvokeQueued(this, [this] { updateControlsGeometry(); }); }
void WarningWidget::resizeEvent(QResizeEvent *e) { _inner = QRect((width() - st::themeWarningWidth) / 2, (height() - st::themeWarningHeight) / 2, st::themeWarningWidth, st::themeWarningHeight); _outer = _inner.marginsAdded(st::boxRoundShadow.extend); updateControlsGeometry(); update(); }
void CodeWidget::refreshLang() { if (_noTelegramCode) _noTelegramCode->setText(lang(lng_code_no_telegram)); updateDescText(); updateControlsGeometry(); }
void CodeWidget::resizeEvent(QResizeEvent *e) { Step::resizeEvent(e); updateControlsGeometry(); }
void MainWindow::resizeEvent(QResizeEvent *e) { updateControlsGeometry(); }