-
Notifications
You must be signed in to change notification settings - Fork 0
/
task_manager.kv
163 lines (154 loc) · 5.11 KB
/
task_manager.kv
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<SHLabel@Label,SHButton@Button>:
size_hint_min: [v + dp(8) for v in self.texture_size]
halign: 'center'
<SHTask>:
orientation: 'vertical'
spacing: '4dp'
drag_timeout: 0
drag_cls: 'task_to_be_done'
size: '200dp', '200dp'
size_hint: None, None
opacity: .5 if self.is_being_dragged else 1.
canvas.before:
Color:
rgba: .4, .4, .4, 1
Line:
rectangle: (*self.pos, *self.size, )
Image:
allow_stretch: True
texture: root.datum.texture
size_hint_y: 3.
SHLabel:
text: '{} \n({} energy)'.format(root.datum.name, root.datum.energy)
color: rgba("#E75480")
bold: True
<CircularProgresBar>
canvas.before:
Color:
rgba: root.bar_color + [0.3]
Line:
width: root.bar_width/2
ellipse: (self.x, self.y, self.width, self.height, 0, 360)
canvas.after:
Color:
rgb: root.bar_color
Line:
width: root.bar_width/2
ellipse: (self.x, self.y, self.width, self.height, 0, root.set_value*36)
Label:
text : f"{root.set_value*10}%"
font_size:"40sp"
pos_hint:{"center_x":.5, "center_y":.5}
halign:"center"
color:root.bar_color
<SHActorImage@BoxLayout>:
orientation: 'vertical'
source : 'default'
name : 'default'
energy : 0
spacing: '4dp'
size: '200dp', '300dp'
size_hint: None, None
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
color_code : "#E75480"
Image:
allow_stretch: True
source: root.source
size_hint_y: 3
Label:
text:'\n{}'.format(root.name)
color: rgba(root.color_code)
bold: True
CircularProgresBar:
size_hint: None, None
size : 200, 200
pos_hint:{"center_x":.5, "center_y":.5}
set_value: root.energy
<SHShelf@KXReorderableBehavior+RVLikeBehavior+StackLayout>:
padding: '10dp'
spacing: '10dp'
size_hint_min_y: self.minimum_height
drag_classes: ['task_to_be_done', ]
viewclass: 'SHTask'
<SHMain>:
orientation: 'vertical'
padding: '10dp'
spacing: '10dp'
prompt : prompt_text
fact_button : fact
EquitableBoxLayout:
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas.before:
Rectangle:
pos: self.pos
size: self.size
source: 'assets/city_bg.jpg'
SHLabel:
id : prompt_text
text: "Balance \n\n"
font_size: max(30, sp(20))
text_size: self.width, None
center_x: root.width / 4
top: root.top - 50
size: self.texture_size
bold: True
color: rgba("#A52A2A")
SHLabel:
text: '\n\n\nDistribute tasks for our lovely couple. Aim to Balance the % between them'
font_size: max(30, sp(20))
bold: True
color: rgba("#734F96")
ScrollView:
size_hint_y: 1000.
always_overscroll: False
SHShelf:
id: shelf
Splitter:
sizable_from: 'left'
min_size: 100
max_size: root.width
BoxLayout:
orientation: 'vertical'
canvas.before:
Rectangle:
pos: self.pos
size: self.size
source: 'assets/city_bg2.jpeg'
BoxLayout:
SHActorImage:
id : male_details
color_code:"#FF0000"
SHShelf:
canvas.before:
Color:
rgba: 1, 0, 0, 1
Line:
rectangle: (*self.pos, *self.size, )
width: 2
id: man
SHActorImage:
id : female_details
color_code:"#0000FF"
SHShelf:
canvas.before:
Color:
rgba: 0, 0, 1, 1
Line:
rectangle: (*self.pos, *self.size, )
width: 2
id: woman
BoxLayout:
size_hint_y: None
height: self.minimum_height
SHButton:
text: 'Complete Story'
on_press: root.complete_story()
SHButton:
id : fact
text: 'Do you know'
on_press: root.show_message(title='Gender equality', content=root._equality_text)
SHButton:
text: 'Restart'
on_press: app.restart_app()