Resize centered labels wide by default.

This commit is contained in:
John Preston 2023-08-01 19:05:34 +02:00
parent ad356135e4
commit 7c60b03c9b
2 changed files with 6 additions and 1 deletions

View file

@ -318,10 +318,14 @@ int FlatLabel::resizeGetHeight(int newWidth) {
return countTextHeight(_textWidth);
}
int FlatLabel::naturalWidth() const {
int FlatLabel::textMaxWidth() const {
return _text.maxWidth();
}
int FlatLabel::naturalWidth() const {
return (_st.align == style::al_top) ? -1 : textMaxWidth();
}
QMargins FlatLabel::getMargins() const {
return _st.margin;
}

View file

@ -139,6 +139,7 @@ public:
_animationsPausedCallback = std::move(callback);
}
[[nodiscard]] int textMaxWidth() const;
int naturalWidth() const override;
QMargins getMargins() const override;