Added skip for title in box when top button is present.
This commit is contained in:
parent
e712f9b3de
commit
1916823c98
1 changed files with 6 additions and 1 deletions
|
|
@ -225,7 +225,11 @@ 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 topButtonSkip = _topButton ? (_topButton->width() / 2) : 0;
|
||||||
|
_title->resizeToWidth(
|
||||||
|
std::min(
|
||||||
|
_title->naturalWidth(),
|
||||||
|
width() - _titleLeft * 2 - topButtonSkip));
|
||||||
_title->moveToLeft(_titleLeft, _titleTop);
|
_title->moveToLeft(_titleLeft, _titleTop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -274,6 +278,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