blob: 0391ee937a4ee679ac9d0ae78d2374faf6784734 (
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
36
|
from PyQt5 import QtCore, QtWidgets
import todo.gui.tasks.widget
import todo.gui.tasks.widget
import todo.gui.tags.panel.widget
import todo.gui.signal
from todo.model.status import Status
def get():
window = QtWidgets.QMainWindow()
window.setWindowTitle("todo")
window.setMinimumSize(QtCore.QSize(640, 480))
tabs = QtWidgets.QTabWidget(window)
window.setCentralWidget(tabs)
show_ready = todo.gui.signal.Reload()
show_waiting = todo.gui.signal.Reload()
show_maybe = todo.gui.signal.Reload()
def on_current_tab_changed(index: int):
if index == 0:
show_ready.emit()
elif index == 1:
show_waiting.emit()
elif index == 2:
show_maybe.emit()
tabs.currentChanged.connect(on_current_tab_changed)
tabs.addTab(todo.gui.tasks.widget.widget(tabs, show_ready, Status.READY), "Ready")
tabs.addTab(todo.gui.tasks.widget.widget(tabs, show_waiting, Status.WAITING), "Waiting")
tabs.addTab(todo.gui.tasks.widget.widget(tabs, show_maybe, Status.MAYBE), "Maybe")
tabs.addTab(todo.gui.tags.panel.widget.widget(tabs), "Tags")
return window
|