Skip to content

Commit

Permalink
When closing last tab shows the new tab page
Browse files Browse the repository at this point in the history
  • Loading branch information
hugolabe committed Dec 12, 2023
1 parent e5d1996 commit 71984a7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,8 @@ def _new_tab_cb(self, action, parameter):
# Close current tab

def _close_tab_cb(self, action, parameter):
if self.tabview.get_n_pages() > 1:
tabpage = self.tabview.get_selected_page()
self.tabview.close_page(tabpage)
tabpage = self.tabview.get_selected_page()
self.tabview.close_page(tabpage)

# Go to next tab

Expand Down Expand Up @@ -328,15 +327,17 @@ def _tabview_selected_page_cb(self, tabview, value):
# On tab closed event destroy wikiview and confirm

def _tabview_close_page_cb(self, tabview, tabpage):
page = tabpage.get_child()
wikiview = page.wikiview

if self.tabview.get_n_pages() > 1:
page = tabpage.get_child()
wikiview = page.wikiview
page.view_stack.remove(wikiview)
wikiview.run_dispose()
tabview.close_page_finish(tabpage, True)
else:
if self.taboverview.get_open():
self.taboverview.set_open(False)
wikiview.load_message('blank')
tabview.close_page_finish(tabpage, False)

return True
Expand Down

0 comments on commit 71984a7

Please sign in to comment.