1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:37:44 +00:00

LibGUI: Make GUI::Widget::set_tooltip() take a String

There was no reason for this to take a StringView.
This commit is contained in:
Andreas Kling 2021-04-16 19:12:37 +02:00
parent 4454735bf8
commit d33fdc925b
2 changed files with 3 additions and 3 deletions

View file

@ -983,9 +983,9 @@ Gfx::IntRect Widget::content_rect() const
return rect; return rect;
} }
void Widget::set_tooltip(const StringView& tooltip) void Widget::set_tooltip(String tooltip)
{ {
m_tooltip = tooltip; m_tooltip = move(tooltip);
if (Application::the()->tooltip_source_widget() == this) if (Application::the()->tooltip_source_widget() == this)
show_or_hide_tooltip(); show_or_hide_tooltip();
} }

View file

@ -140,7 +140,7 @@ public:
bool has_tooltip() const { return !m_tooltip.is_empty(); } bool has_tooltip() const { return !m_tooltip.is_empty(); }
String tooltip() const { return m_tooltip; } String tooltip() const { return m_tooltip; }
void set_tooltip(const StringView&); void set_tooltip(String);
bool is_enabled() const { return m_enabled; } bool is_enabled() const { return m_enabled; }
void set_enabled(bool); void set_enabled(bool);