Fixed peer name width on profile tab buttons toggle.

This commit is contained in:
23rd
2026-07-12 10:45:54 +03:00
parent 6eb299a2b1
commit fa58d971e9
2 changed files with 31 additions and 22 deletions
@@ -1795,6 +1795,32 @@ void TopBar::updateLabelsPosition() {
}();
const auto progressCurrent = _progress.current();
updateTitlePosition(progressCurrent);
updateStatusPosition(progressCurrent);
if (_badgeTooltip) {
_badgeTooltip->setOpacity(progressCurrent);
}
{
const auto userpicRect = userpicGeometry();
if (_userpicButton) {
_userpicButton->setGeometry(userpicGeometry());
}
updateGiftButtonsGeometry(progressCurrent, userpicRect);
}
updateRightButtonsPosition();
updateTabSwapVisibility();
updateTabSelectionGeometry();
updateTabSearchGeometry();
}
void TopBar::updateTitlePosition(float64 progressCurrent) {
if (width() <= 0) {
return;
}
const auto rightButtonsWidth = calculateRightButtonsWidth();
const auto reservedRight = anim::interpolate(
@@ -1827,8 +1853,8 @@ void TopBar::updateLabelsPosition() {
- reservedRight
- badgesWidth;
if (titleWidth > 0 && _title->textMaxWidth() > titleWidth) {
_title->resizeToWidth(titleWidth);
if (titleWidth > 0) {
_title->resizeToNaturalWidth(titleWidth);
}
const auto titleTop = anim::interpolate(
@@ -1879,26 +1905,6 @@ void TopBar::updateLabelsPosition() {
badgeTop,
badgeBottom);
}
updateStatusPosition(progressCurrent);
if (_badgeTooltip) {
_badgeTooltip->setOpacity(progressCurrent);
}
{
const auto userpicRect = userpicGeometry();
if (_userpicButton) {
_userpicButton->setGeometry(userpicGeometry());
}
updateGiftButtonsGeometry(progressCurrent, userpicRect);
}
updateRightButtonsPosition();
updateTabSwapVisibility();
updateTabSelectionGeometry();
updateTabSearchGeometry();
}
void TopBar::updateStatusPosition(float64 progressCurrent) {
@@ -2391,6 +2397,8 @@ void TopBar::updateTabSwapVisibility() {
}
if (togglesChanged) {
updateRightButtonsPosition();
updateTitlePosition(_progress.current());
updateStatusPosition(_progress.current());
}
if (!_tabSubtitle && !swap) {
return;
@@ -198,6 +198,7 @@ private:
void setupStoryOutline(const QRect &geometry = QRect());
void updateStoryOutline(std::optional<QColor> edgeColor);
void paintStoryOutline(QPainter &p, const QRect &geometry);
void updateTitlePosition(float64 progressCurrent);
void updateStatusPosition(float64 progressCurrent);
void applyTabBindings(TabTopBarBindings &&bindings);
void updateTabSwapVisibility();