Resize centered labels wide by default.
This commit is contained in:
parent
ad356135e4
commit
7c60b03c9b
2 changed files with 6 additions and 1 deletions
|
|
@ -318,10 +318,14 @@ int FlatLabel::resizeGetHeight(int newWidth) {
|
||||||
return countTextHeight(_textWidth);
|
return countTextHeight(_textWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
int FlatLabel::naturalWidth() const {
|
int FlatLabel::textMaxWidth() const {
|
||||||
return _text.maxWidth();
|
return _text.maxWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int FlatLabel::naturalWidth() const {
|
||||||
|
return (_st.align == style::al_top) ? -1 : textMaxWidth();
|
||||||
|
}
|
||||||
|
|
||||||
QMargins FlatLabel::getMargins() const {
|
QMargins FlatLabel::getMargins() const {
|
||||||
return _st.margin;
|
return _st.margin;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,7 @@ public:
|
||||||
_animationsPausedCallback = std::move(callback);
|
_animationsPausedCallback = std::move(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] int textMaxWidth() const;
|
||||||
int naturalWidth() const override;
|
int naturalWidth() const override;
|
||||||
QMargins getMargins() const override;
|
QMargins getMargins() const override;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue