mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibGUI: Store Tab titles using the new string class
This commit is contained in:
parent
446c600d09
commit
4f08a05a3b
Notes:
sideshowbarker
2024-07-17 18:06:52 +09:00
Author: https://github.com/krkk
Commit: 4f08a05a3b
Pull-request: https://github.com/SerenityOS/serenity/pull/17800
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/awesomekling
2 changed files with 3 additions and 3 deletions
|
@ -53,7 +53,7 @@ TabWidget::TabWidget()
|
||||||
|
|
||||||
ErrorOr<void> TabWidget::try_add_widget(Widget& widget)
|
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));
|
TRY(try_add_child(widget));
|
||||||
update_focus_policy();
|
update_focus_policy();
|
||||||
if (on_tab_count_change)
|
if (on_tab_count_change)
|
||||||
|
@ -596,7 +596,7 @@ void TabWidget::set_tab_title(Widget& tab, StringView title)
|
||||||
for (auto& t : m_tabs) {
|
for (auto& t : m_tabs) {
|
||||||
if (t.widget == &tab) {
|
if (t.widget == &tab) {
|
||||||
if (t.title != title) {
|
if (t.title != title) {
|
||||||
t.title = title;
|
t.title = String::from_utf8(title).release_value_but_fixme_should_propagate_errors();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -147,7 +147,7 @@ private:
|
||||||
|
|
||||||
struct TabData {
|
struct TabData {
|
||||||
int width(Gfx::Font const&) const;
|
int width(Gfx::Font const&) const;
|
||||||
DeprecatedString title;
|
String title;
|
||||||
RefPtr<Gfx::Bitmap const> icon;
|
RefPtr<Gfx::Bitmap const> icon;
|
||||||
Widget* widget { nullptr };
|
Widget* widget { nullptr };
|
||||||
bool modified { false };
|
bool modified { false };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue