mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibGUI: Parse ampersand string for tooltips only in GUI::Action
It seems unnecessary to pass every tooltip string through Gfx::parse_ampersand_string() when only Action tooltips need to parse a title.
This commit is contained in:
parent
aea244efe1
commit
16defb4806
4 changed files with 8 additions and 3 deletions
|
@ -297,6 +297,11 @@ void Action::set_text(DeprecatedString text)
|
|||
});
|
||||
}
|
||||
|
||||
DeprecatedString Action::tooltip() const
|
||||
{
|
||||
return m_tooltip.value_or_lazy_evaluated([this] { return Gfx::parse_ampersand_string(m_text); });
|
||||
}
|
||||
|
||||
void Action::set_tooltip(DeprecatedString tooltip)
|
||||
{
|
||||
if (m_tooltip == tooltip)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue