Fixed adjustment of menu items by largest width.
This commit is contained in:
parent
f03209c1f9
commit
d94cb34219
1 changed files with 7 additions and 5 deletions
|
|
@ -122,15 +122,17 @@ not_null<QAction*> Menu::addAction(base::unique_qptr<ItemBase> widget) {
|
||||||
}, widget->lifetime());
|
}, widget->lifetime());
|
||||||
|
|
||||||
widget->minWidthValue(
|
widget->minWidthValue(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=](int minWidth) {
|
||||||
const auto newWidth = _forceWidth
|
const auto newWidth = _forceWidth
|
||||||
? _forceWidth
|
? _forceWidth
|
||||||
: _actionWidgets.empty()
|
: _actionWidgets.empty()
|
||||||
? _st.widthMin
|
? _st.widthMin
|
||||||
: (*ranges::max_element(
|
: std::max(
|
||||||
_actionWidgets,
|
minWidth,
|
||||||
std::less<>(),
|
(*ranges::max_element(
|
||||||
&ItemBase::minWidth))->minWidth();
|
_actionWidgets,
|
||||||
|
std::less<>(),
|
||||||
|
&ItemBase::minWidth))->minWidth());
|
||||||
resizeFromInner(newWidth, height());
|
resizeFromInner(newWidth, height());
|
||||||
}, widget->lifetime());
|
}, widget->lifetime());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue