blob: efacfd4d87f611fe7b314411f32935acd5c8b2ad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
from PyQt5 import QtCore, QtWidgets
import gui.tasks.widget
import gui.tasks.widget
import gui.tags.panel.widget
import gui.signal
def get():
window = QtWidgets.QMainWindow()
window.setWindowTitle("todo-next")
window.setMinimumSize(QtCore.QSize(640, 480))
tabs = QtWidgets.QTabWidget(window)
window.setCentralWidget(tabs)
show_todo = gui.signal.Reload()
show_waiting = gui.signal.Reload()
show_maybe = gui.signal.Reload()
def on_current_tab_changed(index: int):
if index == 0:
show_todo.emit()
elif index == 1:
show_waiting.emit()
elif index == 2:
show_maybe.emit()
tabs.currentChanged.connect(on_current_tab_changed)
tabs.addTab(gui.tasks.widget.widget(tabs, show_todo), "Todo")
tabs.addTab(gui.tasks.widget.widget(tabs, show_waiting), "Waiting")
tabs.addTab(gui.tasks.widget.widget(tabs, show_maybe), "Maybe")
tabs.addTab(gui.tags.panel.widget.widget(tabs), "Tags")
return window
|