summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorKarol Kosek <krkk@serenityos.org>2023-03-10 20:25:41 +0100
committerAndreas Kling <kling@serenityos.org>2023-03-16 09:58:42 +0100
commit66402b06663f9a54a54ed25dfe9bb307f06528af (patch)
treecdfd1d7151576e2572800d294c48e8f258978c87 /Userland/Libraries
parent4f08a05a3b55ab47eb550d562b834ce124fbb26b (diff)
downloadserenity-66402b06663f9a54a54ed25dfe9bb307f06528af.zip
LibGUI+Userland: Port TabWidget set_tab_title to new string
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGUI/TabWidget.cpp4
-rw-r--r--Userland/Libraries/LibGUI/TabWidget.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGUI/TabWidget.cpp b/Userland/Libraries/LibGUI/TabWidget.cpp
index dce58a0093..6cc20289af 100644
--- a/Userland/Libraries/LibGUI/TabWidget.cpp
+++ b/Userland/Libraries/LibGUI/TabWidget.cpp
@@ -591,12 +591,12 @@ Optional<size_t> TabWidget::active_tab_index() const
return {};
}
-void TabWidget::set_tab_title(Widget& tab, StringView title)
+void TabWidget::set_tab_title(Widget& tab, String title)
{
for (auto& t : m_tabs) {
if (t.widget == &tab) {
if (t.title != title) {
- t.title = String::from_utf8(title).release_value_but_fixme_should_propagate_errors();
+ t.title = move(title);
update();
}
return;
diff --git a/Userland/Libraries/LibGUI/TabWidget.h b/Userland/Libraries/LibGUI/TabWidget.h
index ce3aa75a9a..2abd3dfb45 100644
--- a/Userland/Libraries/LibGUI/TabWidget.h
+++ b/Userland/Libraries/LibGUI/TabWidget.h
@@ -83,7 +83,7 @@ public:
void remove_tab(Widget& tab) { remove_widget(tab); }
void remove_all_tabs_except(Widget& tab);
- void set_tab_title(Widget& tab, StringView title);
+ void set_tab_title(Widget& tab, String title);
void set_tab_icon(Widget& tab, Gfx::Bitmap const*);
bool is_tab_modified(Widget& tab);