mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:38:11 +00:00
Userland: Port GUI::Application::show_tooltip() to String
This most importantly gets rid of a chain of "String to DeprecatedString to String" transformations when setting a tooltip from GUI::Widget's set_tooltip function.
This commit is contained in:
parent
16defb4806
commit
a3ddba4191
7 changed files with 12 additions and 12 deletions
|
@ -25,9 +25,9 @@ class Application::TooltipWindow final : public Window {
|
|||
C_OBJECT(TooltipWindow);
|
||||
|
||||
public:
|
||||
void set_tooltip(DeprecatedString const& tooltip)
|
||||
void set_tooltip(String tooltip)
|
||||
{
|
||||
m_label->set_text(String::from_deprecated_string(tooltip).release_value_but_fixme_should_propagate_errors());
|
||||
m_label->set_text(move(tooltip));
|
||||
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();
|
||||
|
@ -152,7 +152,7 @@ Action* Application::action_for_shortcut(Shortcut const& shortcut) const
|
|||
return (*it).value;
|
||||
}
|
||||
|
||||
void Application::show_tooltip(DeprecatedString tooltip, Widget const* tooltip_source_widget)
|
||||
void Application::show_tooltip(String tooltip, Widget const* tooltip_source_widget)
|
||||
{
|
||||
if (!Desktop::the().system_effects().tooltips())
|
||||
return;
|
||||
|
@ -173,7 +173,7 @@ void Application::show_tooltip(DeprecatedString tooltip, Widget const* tooltip_s
|
|||
}
|
||||
}
|
||||
|
||||
void Application::show_tooltip_immediately(DeprecatedString tooltip, Widget const* tooltip_source_widget)
|
||||
void Application::show_tooltip_immediately(String tooltip, Widget const* tooltip_source_widget)
|
||||
{
|
||||
if (!Desktop::the().system_effects().tooltips())
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue