mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 04:08:08 +00:00
LibGUI: Add TabWidget::set_tab_title(Widget&, StringView)
This lets you change the title of a tab after creating it.
This commit is contained in:
@@ -259,4 +259,18 @@ int TabWidget::active_tab_index() const
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void TabWidget::set_tab_title(Widget& tab, const StringView& title)
|
||||
{
|
||||
for (auto& t : m_tabs) {
|
||||
if (t.widget == &tab) {
|
||||
if (t.title != title) {
|
||||
t.title = title;
|
||||
update();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user