-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_widgets.py
64 lines (49 loc) · 2.55 KB
/
main_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
from customtkinter import CTkFrame
from components import *
#! Accounts for resizing the window
#! Depending on size, layout and information shown will be different
class SmallWidget(CTkFrame):
def __init__(self, parent, current_data, location, color, animation):
super().__init__(parent, fg_color = 'transparent')
self.pack(expand = True, fill = 'both')
#* LAYOUT
self.rowconfigure(0, weight = 6, uniform = 'a')
self.rowconfigure(1, weight = 1, uniform = 'a')
self.columnconfigure(0, weight = 1, uniform = 'a')
#* WIDGETS
SimplePanel(self, current_data, 0, 0, color, animation)
DatePanel(self, location, row = 1, col = 0, color = color)
class WideWidget(CTkFrame):
def __init__(self, parent, current_data, forecast_data, location, color, animation):
super().__init__(parent, fg_color = 'transparent')
self.pack(expand = True, fill = 'both')
#* LAYOUT
self.rowconfigure(0, weight = 6, uniform = 'a')
self.rowconfigure(1, weight = 1, uniform = 'a')
self.columnconfigure(0, weight = 1, uniform = 'a')
self.columnconfigure(1, weight = 2, uniform = 'a')
#* WIDGETS
SimplePanel(self, current_data, 0, 0, color, animation)
DatePanel(self, location, row = 1, col = 0, color = color)
HorizontalForecastPanel(self, forecast_data, 0, 1, 2, color['divider color']) #! row, col, rowspan for the #s
class TallWidget(CTkFrame):
def __init__(self, parent, current_data, forecast_data, location, color, animation):
super().__init__(parent, fg_color = 'transparent')
self.pack(expand = True, fill = 'both')
#* Layout
self.rowconfigure(0, weight = 3, uniform = 'a')
self.rowconfigure(1, weight = 1, uniform = 'a')
self.columnconfigure(0, weight = 1, uniform = 'a')
#* WIDGET
HorizontalForecastPanel(self, forecast_data, 1, 0, 1, color['divider color'])
SimpleTallPanel(self, current_data, location, 0, 0, color, animation)
class MaxWidget(CTkFrame):
def __init__(self, parent, current_data, forecast_data, location, color, animation):
super().__init__(parent, fg_color = 'transparent')
self.pack(expand = True, fill = 'both')
#* Layout
self.rowconfigure(0, weight = 1, uniform = 'a')
self.columnconfigure((0,1), weight = 1, uniform = 'a')
#* WIDGETS
SimpleTallPanel(self, current_data, location, 0, 0, color, animation)
VerticalForecastPanel(self, forecast_data, 0, 1, color['divider color'])