Skip to content

Commit

Permalink
HackStudio: Fix update modified document on tab widget
Browse files Browse the repository at this point in the history
  • Loading branch information
guerinoni authored and AtkinsSJ committed Aug 13, 2022
1 parent 272917d commit 8753dc7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions Userland/DevTools/HackStudio/EditorWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ EditorWrapper::EditorWrapper()

m_editor->on_modified_change = [this](bool) {
update_title();
update_editor_window_title();
};
}

Expand Down
1 change: 1 addition & 0 deletions Userland/DevTools/HackStudio/HackStudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
5 changes: 3 additions & 2 deletions Userland/DevTools/HackStudio/HackStudioWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ class HackStudioWidget : public GUI::Widget {

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;

Expand Down Expand Up @@ -160,8 +163,6 @@ class HackStudioWidget : public GUI::Widget {

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);

Expand Down
6 changes: 6 additions & 0 deletions Userland/DevTools/HackStudio/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8753dc7

Please sign in to comment.