1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:58: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:
Karol Kosek 2023-06-03 22:54:11 +02:00 committed by Andreas Kling
parent aea244efe1
commit 16defb4806
4 changed files with 8 additions and 3 deletions

View file

@ -27,7 +27,7 @@ class Application::TooltipWindow final : public Window {
public:
void set_tooltip(DeprecatedString const& tooltip)
{
m_label->set_text(String::from_deprecated_string(Gfx::parse_ampersand_string(tooltip)).release_value_but_fixme_should_propagate_errors());
m_label->set_text(String::from_deprecated_string(tooltip).release_value_but_fixme_should_propagate_errors());
int tooltip_width = m_label->effective_min_size().width().as_int() + 10;
int line_count = m_label->text().count("\n"sv);
int font_size = m_label->font().pixel_size_rounded_up();