LibGUI: Propagate changing an action's text to its associated buttons

All other action state changes are already propagated to the action's
buttons. Do the same for text.
This commit is contained in:
Timothy Flynn 2022-11-19 09:50:35 -05:00 committed by Andreas Kling
parent 234ae3a2ae
commit 4addad67d1
Notes: sideshowbarker 2024-07-17 04:04:14 +09:00

View file

@ -275,6 +275,9 @@ void Action::set_text(String text)
if (m_text == text)
return;
m_text = move(text);
for_each_toolbar_button([&](auto& button) {
button.set_text(m_text);
});
for_each_menu_item([&](auto& menu_item) {
menu_item.update_from_action({});
});