mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:37:35 +00:00
GMLPlayground: Let WindowServer handle the title's modification symbol
This commit is contained in:
parent
1fba3640cb
commit
5c4ffbcb46
1 changed files with 1 additions and 12 deletions
|
@ -114,17 +114,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
|
|
||||||
DeprecatedString file_path;
|
DeprecatedString file_path;
|
||||||
auto update_title = [&] {
|
auto update_title = [&] {
|
||||||
StringBuilder builder;
|
window->set_title(DeprecatedString::formatted("{}[*] - GML Playground", file_path.is_empty() ? "Untitled"sv : file_path.view()));
|
||||||
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());
|
|
||||||
};
|
};
|
||||||
|
|
||||||
editor->on_change = [&] {
|
editor->on_change = [&] {
|
||||||
|
@ -137,7 +127,6 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
|
|
||||||
editor->on_modified_change = [&](bool modified) {
|
editor->on_modified_change = [&](bool modified) {
|
||||||
window->set_modified(modified);
|
window->set_modified(modified);
|
||||||
update_title();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
auto load_file = [&](auto file) {
|
auto load_file = [&](auto file) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue