mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +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:
parent
2029750519
commit
4b169cf25f
13 changed files with 21 additions and 48 deletions
|
@ -250,10 +250,7 @@ ErrorOr<void> MainWidget::setup()
|
|||
m_statusbar->segment(2).set_fixed_width(font().width("Ln 0,000 Col 000"sv) + font().max_glyph_width());
|
||||
|
||||
GUI::Application::the()->on_action_enter = [this](GUI::Action& action) {
|
||||
auto text = action.status_tip();
|
||||
if (text.is_empty())
|
||||
text = Gfx::parse_ampersand_string(action.text());
|
||||
m_statusbar->set_override_text(move(text));
|
||||
m_statusbar->set_override_text(action.status_tip());
|
||||
};
|
||||
|
||||
GUI::Application::the()->on_action_leave = [this](GUI::Action&) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue