From 14751a4122715d1e60265d2b35bc91f06ce3548b Mon Sep 17 00:00:00 2001 From: timre13 Date: Fri, 15 Apr 2022 18:37:24 +0200 Subject: [PATCH] HackStudio: Update window close button on document change --- Userland/DevTools/HackStudio/HackStudioWidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index c9b2be04bf..7a3741aebb 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -368,6 +368,7 @@ bool HackStudioWidget::open_file(String const& full_filename, size_t line, size_ current_editor().set_focus(true); current_editor().on_cursor_change = [this] { on_cursor_change(); }; + current_editor().on_change = [this] { update_window_title(); }; current_editor_wrapper().on_change = [this] { update_gml_preview(); }; current_editor().set_cursor(line, column); update_gml_preview(); @@ -1588,6 +1589,7 @@ void HackStudioWidget::update_tree_view() void HackStudioWidget::update_window_title() { window()->set_title(String::formatted("{} - {} - Hack Studio", m_current_editor_wrapper->filename_title(), m_project->name())); + window()->set_modified(any_document_is_dirty()); } void HackStudioWidget::update_current_editor_title()