summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Guerinoni <guerinoni.federico@gmail.com>2022-08-04 16:23:11 +0200
committerSam Atkins <atkinssj@gmail.com>2022-08-13 16:43:18 +0100
commit8753dc72e8400d2505d13a21cf03495dfbb0081d (patch)
treeceed84ab040d3db3ad9aefdb9f45bf76b0f6b389
parent272917de284d3436e551da30fca1c9355b6572c4 (diff)
downloadserenity-8753dc72e8400d2505d13a21cf03495dfbb0081d.zip
HackStudio: Fix update modified document on tab widget
Closes #14297
-rw-r--r--Userland/DevTools/HackStudio/EditorWrapper.cpp1
-rw-r--r--Userland/DevTools/HackStudio/HackStudio.h1
-rw-r--r--Userland/DevTools/HackStudio/HackStudioWidget.h5
-rw-r--r--Userland/DevTools/HackStudio/main.cpp6
4 files changed, 11 insertions, 2 deletions
diff --git a/Userland/DevTools/HackStudio/EditorWrapper.cpp b/Userland/DevTools/HackStudio/EditorWrapper.cpp
index 45fd8d01f4..4a911add5e 100644
--- a/Userland/DevTools/HackStudio/EditorWrapper.cpp
+++ b/Userland/DevTools/HackStudio/EditorWrapper.cpp
@@ -40,6 +40,7 @@ EditorWrapper::EditorWrapper()
m_editor->on_modified_change = [this](bool) {
update_title();
+ update_editor_window_title();
};
}
diff --git a/Userland/DevTools/HackStudio/HackStudio.h b/Userland/DevTools/HackStudio/HackStudio.h
index 3458b7c116..cb4698900d 100644
--- a/Userland/DevTools/HackStudio/HackStudio.h
+++ b/Userland/DevTools/HackStudio/HackStudio.h
@@ -21,6 +21,7 @@ void open_file(String const&, size_t line, size_t column);
Project& project();
String currently_open_file();
void set_current_editor_wrapper(RefPtr<EditorWrapper>);
+void update_editor_window_title();
void for_each_open_file(Function<void(ProjectFile const&)>);
bool semantic_syntax_highlighting_is_enabled();
diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.h b/Userland/DevTools/HackStudio/HackStudioWidget.h
index e99d5ec287..582cc1a096 100644
--- a/Userland/DevTools/HackStudio/HackStudioWidget.h
+++ b/Userland/DevTools/HackStudio/HackStudioWidget.h
@@ -79,6 +79,9 @@ public:
static Vector<String> read_recent_projects();
+ void update_current_editor_title();
+ void update_window_title();
+
private:
static constexpr size_t recent_projects_history_size = 15;
@@ -160,8 +163,6 @@ private:
void update_gml_preview();
void update_tree_view();
- void update_window_title();
- void update_current_editor_title();
void on_cursor_change();
void file_renamed(String const& old_name, String const& new_name);
diff --git a/Userland/DevTools/HackStudio/main.cpp b/Userland/DevTools/HackStudio/main.cpp
index ffa24f801f..987558ec27 100644
--- a/Userland/DevTools/HackStudio/main.cpp
+++ b/Userland/DevTools/HackStudio/main.cpp
@@ -185,6 +185,12 @@ void set_current_editor_wrapper(RefPtr<EditorWrapper> wrapper)
s_hack_studio_widget->set_current_editor_wrapper(wrapper);
}
+void update_editor_window_title()
+{
+ s_hack_studio_widget->update_current_editor_title();
+ s_hack_studio_widget->update_window_title();
+}
+
Locator& locator()
{
return s_hack_studio_widget->locator();