Correctly resize box title if it has top button
This commit is contained in:
parent
a76cb8e35e
commit
8bab33ccc9
1 changed files with 3 additions and 1 deletions
|
|
@ -221,7 +221,8 @@ void BoxLayerWidget::updateTitlePosition() {
|
||||||
_titleLeft = st::boxTitlePosition.x();
|
_titleLeft = st::boxTitlePosition.x();
|
||||||
_titleTop = st::boxTitlePosition.y();
|
_titleTop = st::boxTitlePosition.y();
|
||||||
if (_title) {
|
if (_title) {
|
||||||
_title->resizeToWidth(qMin(_title->naturalWidth(), width() - _titleLeft * 2));
|
const auto buttonWidth = (_topButton ? _titleLeft : 0);
|
||||||
|
_title->resizeToWidth(qMin(_title->naturalWidth(), width() - _titleLeft * 2 - buttonWidth));
|
||||||
_title->moveToLeft(_titleLeft, _titleTop);
|
_title->moveToLeft(_titleLeft, _titleTop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -270,6 +271,7 @@ QPointer<IconButton> BoxLayerWidget::addTopButton(const style::IconButton &st, F
|
||||||
result->setClickedCallback(std::move(clickCallback));
|
result->setClickedCallback(std::move(clickCallback));
|
||||||
result->show();
|
result->show();
|
||||||
updateButtonsPositions();
|
updateButtonsPositions();
|
||||||
|
updateTitlePosition();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue