mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibGUI+Userland: Use action text as a fallback in Action::status_tip()
Many applications already do this in their code. This change will simply move the logic to a single function to stop repeating ourselves!
This commit is contained in:
@@ -156,10 +156,7 @@ ErrorOr<NonnullRefPtr<HackStudioWidget>> HackStudioWidget::create(DeprecatedStri
|
||||
widget->update_statusbar();
|
||||
|
||||
GUI::Application::the()->on_action_enter = [widget](GUI::Action& action) {
|
||||
auto text = action.status_tip();
|
||||
if (text.is_empty())
|
||||
text = Gfx::parse_ampersand_string(action.text());
|
||||
widget->m_statusbar->set_override_text(move(text));
|
||||
widget->m_statusbar->set_override_text(action.status_tip());
|
||||
};
|
||||
|
||||
GUI::Application::the()->on_action_leave = [widget](GUI::Action&) {
|
||||
|
||||
Reference in New Issue
Block a user