-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathwidgets.py
125 lines (107 loc) · 3.07 KB
/
widgets.py
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import gi
gi.require_version('Gtk', '3.0')
from fabric.widgets.box import Box
from fabric.widgets.stack import Stack
from modules.buttons import Buttons
from modules.calendar import Calendar
from modules.player import Player
from modules.bluetooth import BluetoothConnections
from modules.metrics import Metrics
from modules.controls import ControlSliders
class Widgets(Box):
def __init__(self, **kwargs):
super().__init__(
name="dash-widgets",
h_align="fill",
v_align="fill",
h_expand=True,
v_expand=True,
visible=True,
all_visible=True,
)
self.notch = kwargs["notch"]
self.buttons = Buttons(widgets=self)
self.bluetooth = BluetoothConnections(widgets=self)
self.box_1 = Box(
name="box-1",
h_expand=True,
v_expand=True,
)
self.box_2 = Box(
name="box-2",
h_expand=True,
v_expand=True,
)
self.box_3 = Box(
name="box-3",
v_expand=True,
)
self.controls = ControlSliders()
self.player = Player()
self.metrics = Metrics()
self.notification_history = self.notch.notification_history
self.applet_stack = Stack(
h_expand=True,
v_expand=True,
transition_type="slide-left-right",
children=[
self.notification_history,
self.bluetooth,
]
)
self.applet_stack_box = Box(
name="applet-stack",
h_expand=True,
v_expand=True,
children=[
self.applet_stack,
]
)
self.container_1 = Box(
name="container-1",
h_expand=True,
v_expand=True,
orientation="h",
spacing=8,
children=[
Box(
name="container-sub-1",
h_expand=True,
v_expand=True,
spacing=8,
children=[
Calendar(),
self.applet_stack_box,
]
),
self.metrics,
]
)
self.container_2 = Box(
name="container-2",
h_expand=True,
v_expand=True,
orientation="v",
spacing=8,
children=[
self.buttons,
self.controls,
self.container_1,
]
)
self.container_3 = Box(
name="container-3",
h_expand=True,
v_expand=True,
orientation="h",
spacing=8,
children=[
self.player,
self.container_2,
]
)
self.add(self.container_3)
def show_bt(self):
self.applet_stack.set_visible_child(self.bluetooth)
def show_notif(self):
self.applet_stack.set_visible_child(self.notification_history)