Browse Source

update on open and close with x

merge-requests/365/head
Jørgen Lien Sellæg 8 years ago
parent
commit
adb56bc5d6
  1. 7
      src/notebook.cc

7
src/notebook.cc

@ -315,6 +315,9 @@ void Notebook::open(const boost::filesystem::path &file_path_, size_t notebook_i
close(index); close(index);
})); }));
if(source_view->update_tab_label)
source_view->update_tab_label(source_view);
//Add star on tab label when the page is not saved: //Add star on tab label when the page is not saved:
source_view->get_buffer()->signal_modified_changed().connect([this, source_view]() { source_view->get_buffer()->signal_modified_changed().connect([this, source_view]() {
if(source_view->update_tab_label) if(source_view->update_tab_label)
@ -527,6 +530,10 @@ bool Notebook::close(size_t index) {
hboxes.erase(hboxes.begin()+index); hboxes.erase(hboxes.begin()+index);
tab_labels.erase(tab_labels.begin()+index); tab_labels.erase(tab_labels.begin()+index);
} }
for(auto view: get_views()) { // Update all view tabs in case one clicks cross to close a buffer
if(view->update_tab_label)
view->update_tab_label(view);
}
return true; return true;
} }

Loading…
Cancel
Save