From 5c4ffbcb4654509ce238b3d3dc1edba7ee6c38c9 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 16 Mar 2023 16:28:11 +0000 Subject: [PATCH] GMLPlayground: Let WindowServer handle the title's modification symbol --- Userland/DevTools/GMLPlayground/main.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/Userland/DevTools/GMLPlayground/main.cpp b/Userland/DevTools/GMLPlayground/main.cpp index a6fcdb754c..e2323c71f6 100644 --- a/Userland/DevTools/GMLPlayground/main.cpp +++ b/Userland/DevTools/GMLPlayground/main.cpp @@ -114,17 +114,7 @@ ErrorOr serenity_main(Main::Arguments arguments) DeprecatedString file_path; auto update_title = [&] { - StringBuilder builder; - if (file_path.is_empty()) - builder.append("Untitled"sv); - else - builder.append(file_path); - - if (window->is_modified()) - builder.append("[*]"sv); - - builder.append(" - GML Playground"sv); - window->set_title(builder.to_deprecated_string()); + window->set_title(DeprecatedString::formatted("{}[*] - GML Playground", file_path.is_empty() ? "Untitled"sv : file_path.view())); }; editor->on_change = [&] { @@ -137,7 +127,6 @@ ErrorOr serenity_main(Main::Arguments arguments) editor->on_modified_change = [&](bool modified) { window->set_modified(modified); - update_title(); }; auto load_file = [&](auto file) {