diff options
Diffstat (limited to 'src/gui/window.py')
-rw-r--r-- | src/gui/window.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gui/window.py b/src/gui/window.py index 622f65d..4865edf 100644 --- a/src/gui/window.py +++ b/src/gui/window.py @@ -1,9 +1,11 @@ from PyQt5 import QtCore, QtWidgets import gui.tasks.widget -import gui.tags.widget +import gui.tasks.widget +import gui.tags.panel.widget +import gui.signal -def get(database): +def get(): window = QtWidgets.QMainWindow() window.setWindowTitle("todo-next") window.setMinimumSize(QtCore.QSize(640, 480)) @@ -11,7 +13,13 @@ def get(database): tabs = QtWidgets.QTabWidget(window) window.setCentralWidget(tabs) - tabs.addTab(gui.tasks.widget.widget(database, tabs), 'Tasks') - tabs.addTab(gui.tags.widget.widget(database, tabs), 'Tags') + open_tasks = gui.signal.Reload() + def on_current_tab_changed(index: int): + if index == 0: + open_tasks.emit() + tabs.currentChanged.connect(on_current_tab_changed) + + tabs.addTab(gui.tasks.widget.widget(tabs, open_tasks), 'Tasks') + tabs.addTab(gui.tags.panel.widget.widget(tabs), 'Tags') return window |