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

LibGUI+HackStudio+PixelPaint: Port Widget title to the new String

I had to add a set_title(String) helper function for ImageEditor because
TabWidget requires it. This is a temporary fix and will be handled in
subsequent commit.
This commit is contained in:
Karol Kosek 2023-03-10 18:40:34 +01:00 committed by Andreas Kling
parent 858e55b653
commit 3805e4e3a9
7 changed files with 15 additions and 13 deletions

View file

@ -59,7 +59,7 @@ public:
ErrorOr<NonnullRefPtr<T>> try_add_tab(DeprecatedString title, Args&&... args)
{
auto t = TRY(T::try_create(forward<Args>(args)...));
t->set_title(move(title));
t->set_title(TRY(String::from_deprecated_string(title)));
TRY(try_add_widget(*t));
return *t;
}
@ -68,14 +68,14 @@ public:
T& add_tab(DeprecatedString title, Args&&... args)
{
auto t = T::construct(forward<Args>(args)...);
t->set_title(move(title));
t->set_title(String::from_deprecated_string(title).release_value_but_fixme_should_propagate_errors());
add_widget(*t);
return *t;
}
ErrorOr<void> add_tab(NonnullRefPtr<Widget> const& tab, DeprecatedString title)
{
tab->set_title(move(title));
tab->set_title(TRY(String::from_deprecated_string(title)));
TRY(try_add_widget(*tab));
return {};
}