diff options
author | Joris | 2020-05-31 13:59:35 +0200 |
---|---|---|
committer | Joris | 2020-05-31 13:59:35 +0200 |
commit | 0f1610333324d58acafee8c0fa9d9c9bc293b219 (patch) | |
tree | 302c37dd3751e9fe2e50ab656d56253bfd2d55fc /src/gui/window.py | |
parent | 8a6e10d401eea8db0947f8c4b309b8a6256f9748 (diff) |
Use defined tags for tasks
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 |