-
Notifications
You must be signed in to change notification settings - Fork 0
/
pollen.kv
278 lines (263 loc) · 6.96 KB
/
pollen.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# pollen.im gui (main.kv) by max
#:kivy 1.0.9
#:import NoTransition kivy.uix.screenmanager.NoTransition
<ScreenManagement>:
transition: NoTransition()
HomeScreen:
InboxScreen:
OutboxScreen:
ComposeScreen:
ConversationScreen:
SettingsScreen:
SetupScreen:
ScanScreen:
StartScreen:
<ConvoItem>:
orientation: 'horizontal'
size_hint: (1, 1)
contact_name: ''
# on_press: root.parent.parent.parent.parent.manager.current = 'convo' # swap screens
on_press: root.select_convo() # swap screens
Image:
size_hint: (0.2, 1)
source: 'images/contact_noun.png'
Label:
size_hint: (0.6, 1)
# text: root.parent.text
text: root.contact_name
font_size: 30
Image:
size_hint: (0.2, 1)
source: 'images/right_noun.png'
<Message>:
orientation: 'horizontal'
size_hint: (1, 1)
# sent: root.sent
message_text: ''
BoxLayout:
size_hint: (0.075, 1)
Label:
text: root.message_text
# size_hint: (0.8, 1)
# font_size: 15
padding_y: 20
size_hint_y: None
text_size: self.width, None
height: self.texture_size[1]
Image:
size_hint: (0.2, 1)
source: root.get_arrow()
BoxLayout:
size_hint: (0.05, 1)
# needs to be fixed and dropped into non-homescreens
<HeaderBar>:
orientation: 'horizontal'
size_hint: (1, 0.15)
title: root.parent.parent.title
ImageButton: # back button
size_hint: (0.2, 1)
source: 'images/left_noun.png'
on_press: root.parent.parent.manager.current = 'home'
Label:
size_hint: (0.8, 1)
font_size: 30
text: root.title
<MessageBox>:
viewclass: 'Message' # defines the viewtype for the data items.
orientation: 'vertical'
size_hint: (1, 0.85)
spacing: 40
padding: 10, 10
space_x: self.size[0]/3
RecycleBoxLayout:
color:(0, 0.7, 0.4, 0.8)
default_size: None, dp(56)
# defines the size of the widget in reference to width and height
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
orientation: 'vertical' # defines the orientation of data items
<ConvoBox>:
on_parent: self.populate_convos() # populates conversations when added to screen
viewclass: 'ConvoItem' # defines the viewtype for the data items.
orientation: 'vertical'
size_hint: (1, 0.7)
spacing: 40
padding: 10, 10
space_x: self.size[0]/3
RecycleBoxLayout:
color:(0, 0.7, 0.4, 0.8)
default_size: None, dp(56)
# defines the size of the widget in reference to width and height
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
orientation: 'vertical' # defines the orientation of data items
<HomeScreen>:
name: 'home'
BoxLayout:
orientation: 'vertical'
size_hint: (1, 1)
BoxLayout:
size_hint: (1, 0.15)
ImageButton:
id: inbox_button
source: 'images/inbox_noun.png'
size_hint: (0.33, 1)
# on_press: root.manager.current = 'inbox'
on_press: self.parent.parent.parent.box_navigate('inbox')
ImageButton:
id: outbox_button
source: 'images/outbox_noun.png'
size_hint: (0.33, 1)
# on_press: root.manager.current = 'outbox'
on_press: self.parent.parent.parent.box_navigate('outbox')
ImageButton:
id: exchange_button
source: 'images/refresh_noun.png'
size_hint: (0.33, 1)
# on_press: root.manager.current = 'settings'
on_press: root.exchange()
ConvoBox:
id: convo_box
ImageButton:
id: compose_button
source: 'images/compose_noun.png'
size_hint: (1, 0.15)
on_press: root.manager.current = 'compose'
<ComposeScreen>:
name: 'compose'
title: 'Compose'
BoxLayout:
orientation: 'vertical'
size_hint: (1, 1)
HeaderBar:
# title: 'Compose'
size_hint: (1, 0.15)
BoxLayout:
size_hint: (1, 0.85)
orientation: 'vertical'
BoxLayout:
size_hint: (1, 0.125)
HighlightTextInput:
id: recipient_key
size_hint: (0.8, 1)
hint_text: 'Recipient PGP Key'
font_size: 20
ImageButton:
id: qr_read_button
size_hint: (0.2, 1)
source: 'images/qr.png'
on_press: root.manager.current = 'scan'
TextInput:
id: message_body
hint_text: 'Message Body'
size_hint: (1, 0.75)
BoxButton:
size_hint: (1, 0.125)
on_press: self.parent.parent.parent.send_message(recipient_key.text, message_body.text)
Label:
text: 'Send'
<ConversationScreen>:
name: 'convo'
title: ''
message_box: message_box
BoxLayout:
# message_box: message_box # not sure how to add for grandchild
size_hint: (1, 1)
orientation: 'vertical'
HeaderBar:
MessageBox:
id: message_box
BoxButton:
size_hint: (1, 0.15)
# on_press: root.manager.current = 'compose'
on_press: root.start_message()
canvas.before:
Color:
rgb: (0, 0, 0)
Rectangle:
pos: self.pos
size: self.size
Image:
id: compose_button
source: 'images/compose_noun.png'
# size_hint: (1, 0.15)
<InboxScreen>:
name: 'inbox'
title: 'Inbox'
message_box: message_box
BoxLayout:
size_hint: (1, 1)
orientation: 'vertical'
HeaderBar:
MessageBox:
id: message_box
<OutboxScreen>:
name: 'outbox'
title: 'Outbox'
message_box: message_box
BoxLayout:
size_hint: (1, 1)
orientation: 'vertical'
HeaderBar:
MessageBox:
id: message_box
<SettingsScreen>:
name: 'settings'
BoxLayout:
orientation: 'vertical'
size_hint: (1, 1)
HeaderBar:
title: 'Settings'
size_hint: (1, 0.15)
RecycleView:
viewclass: 'Label' # defines the viewtype for the data items.
orientation: 'vertical'
size_hint: (1, 0.7)
spacing: 40
padding: 10, 10
space_x: self.size[0]/3
RecycleBoxLayout:
color:(0, 0.7, 0.4, 0.8)
default_size: None, dp(56)
# defines the size of the widget in reference to width and height
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
orientation: 'vertical' # defines the orientation of data items
<SetupScreen>:
name: 'setup'
<ScanScreen>:
name: 'scan'
title: 'Scan'
#qr_data: ', '.join([str(symbol.data) for symbol in zbarcam.symbols]) # review/verify
qr_data: ''
BoxLayout:
orientation: 'vertical'
HeaderBar:
size_hint: (1, 0.15)
BoxLayout:
canvas.before:
Color:
rgb: (0, 0, 0)
Rectangle:
pos: self.pos
size: self.size
#ZBarCam:
# id: zbarcam
# # optional, by default checks all types
# code_types: 'QRCODE', 'EAN13'
# Label:
# size_hint: None, None
# size: self.texture_size[0], 50
# text: ', '.join([str(symbol.data) for symbol in zbarcam.symbols])
BoxButton:
size_hint: (1, 0.2)
on_press: root.scan_qr()
Label:
text: 'Scan Now'
font_size: 20
<StartScreen>:
name: 'start'
BoxLayout: