Switched preferred width of multiline menu item to fit icon height.
This commit is contained in:
parent
3185e6cd55
commit
db4419eb30
1 changed files with 4 additions and 2 deletions
|
|
@ -66,9 +66,11 @@ void MultilineAction::paintEvent(QPaintEvent *e) {
|
||||||
void MultilineAction::updateMinWidth() {
|
void MultilineAction::updateMinWidth() {
|
||||||
const auto skip = _labelPosition.x();
|
const auto skip = _labelPosition.x();
|
||||||
auto min = _text->naturalWidth() / 2;
|
auto min = _text->naturalWidth() / 2;
|
||||||
auto max = _text->naturalWidth() - skip;
|
auto max = _icon ? _st.widthMax : (_text->naturalWidth() - skip);
|
||||||
_text->resizeToWidth(max);
|
_text->resizeToWidth(max);
|
||||||
const auto height = _text->height();
|
const auto height = _icon
|
||||||
|
? ((_st.itemIconPosition.y() * 2) + _icon->height())
|
||||||
|
: _text->height();
|
||||||
_text->resizeToWidth(min);
|
_text->resizeToWidth(min);
|
||||||
const auto heightMax = _text->height();
|
const auto heightMax = _text->height();
|
||||||
if (heightMax > height) {
|
if (heightMax > height) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue