LibGUI: Store Tab titles using the new string class

This commit is contained in:
Karol Kosek 2023-03-10 20:34:00 +01:00 committed by Andreas Kling
parent 446c600d09
commit 4f08a05a3b
Notes: sideshowbarker 2024-07-17 18:06:52 +09:00
2 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@ TabWidget::TabWidget()
ErrorOr<void> TabWidget::try_add_widget(Widget& widget)
{
TRY(m_tabs.try_append({ widget.title().to_deprecated_string(), nullptr, &widget, false }));
TRY(m_tabs.try_append({ widget.title(), nullptr, &widget, false }));
TRY(try_add_child(widget));
update_focus_policy();
if (on_tab_count_change)
@ -596,7 +596,7 @@ void TabWidget::set_tab_title(Widget& tab, StringView title)
for (auto& t : m_tabs) {
if (t.widget == &tab) {
if (t.title != title) {
t.title = title;
t.title = String::from_utf8(title).release_value_but_fixme_should_propagate_errors();
update();
}
return;

View File

@ -147,7 +147,7 @@ private:
struct TabData {
int width(Gfx::Font const&) const;
DeprecatedString title;
String title;
RefPtr<Gfx::Bitmap const> icon;
Widget* widget { nullptr };
bool modified { false };