Open a new tab to begin with, and open a new tab when the last tab is closed

This commit is contained in:
Micah Lee 2019-10-27 15:04:04 -07:00
parent 68310070a4
commit eb78b77073
2 changed files with 6 additions and 5 deletions

View file

@ -105,6 +105,10 @@ class TabWidget(QtWidgets.QTabWidget):
self.removeTab(index)
del self.tabs[tab.tab_id]
# If the last tab is closed, open a new one
if self.count() == 0:
self.new_tab_clicked()
def resizeEvent(self, event):
# Make sure to move new tab button on each resize
super(TabWidget, self).resizeEvent(event)