Renamed contentWidth property to minWidth in menu items.
This commit is contained in:
parent
0d6a0d9cef
commit
5d74463bc9
4 changed files with 13 additions and 13 deletions
|
|
@ -123,7 +123,7 @@ not_null<QAction*> Menu::addAction(base::unique_qptr<ItemBase> widget) {
|
|||
}
|
||||
}, widget->lifetime());
|
||||
|
||||
widget->contentWidthValue(
|
||||
widget->minWidthValue(
|
||||
) | rpl::start_with_next([=] {
|
||||
const auto newWidth = _forceWidth
|
||||
? _forceWidth
|
||||
|
|
@ -132,7 +132,7 @@ not_null<QAction*> Menu::addAction(base::unique_qptr<ItemBase> widget) {
|
|||
: (*ranges::max_element(
|
||||
_actionWidgets,
|
||||
std::greater<>(),
|
||||
&ItemBase::width))->contentWidth();
|
||||
&ItemBase::width))->minWidth();
|
||||
resizeFromInner(newWidth, height());
|
||||
}, widget->lifetime());
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ void Action::processAction() {
|
|||
const auto w = std::clamp(goodWidth, _st.widthMin, _st.widthMax);
|
||||
_textWidth = w - (goodWidth - textWidth);
|
||||
_shortcut = actionShortcut;
|
||||
setContentWidth(w);
|
||||
setMinWidth(w);
|
||||
update();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,12 +69,12 @@ rpl::producer<CallbackData> ItemBase::clicks() const {
|
|||
});
|
||||
}
|
||||
|
||||
rpl::producer<int> ItemBase::contentWidthValue() const {
|
||||
return _contentWidth.value();
|
||||
rpl::producer<int> ItemBase::minWidthValue() const {
|
||||
return _minWidth.value();
|
||||
}
|
||||
|
||||
int ItemBase::contentWidth() const {
|
||||
return _contentWidth.current();
|
||||
int ItemBase::minWidth() const {
|
||||
return _minWidth.current();
|
||||
}
|
||||
|
||||
bool ItemBase::hasSubmenu() const {
|
||||
|
|
@ -107,8 +107,8 @@ void ItemBase::initResizeHook(rpl::producer<QSize> &&size) {
|
|||
}, lifetime());
|
||||
}
|
||||
|
||||
void ItemBase::setContentWidth(int w) {
|
||||
_contentWidth = w;
|
||||
void ItemBase::setMinWidth(int w) {
|
||||
_minWidth = w;
|
||||
}
|
||||
|
||||
void ItemBase::finishAnimating() {
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ public:
|
|||
|
||||
rpl::producer<CallbackData> clicks() const;
|
||||
|
||||
rpl::producer<int> contentWidthValue() const;
|
||||
int contentWidth() const;
|
||||
void setContentWidth(int w);
|
||||
rpl::producer<int> minWidthValue() const;
|
||||
int minWidth() const;
|
||||
void setMinWidth(int w);
|
||||
|
||||
bool hasSubmenu() const;
|
||||
void setHasSubmenu(bool value);
|
||||
|
|
@ -60,7 +60,7 @@ private:
|
|||
rpl::variable<bool> _selected = false;
|
||||
rpl::event_stream<> _clicks;
|
||||
|
||||
rpl::variable<int> _contentWidth = 0;
|
||||
rpl::variable<int> _minWidth = 0;
|
||||
|
||||
TriggeredSource _lastTriggeredSource = TriggeredSource::Mouse;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue