-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathglucometer.kv
More file actions
141 lines (132 loc) · 4.47 KB
/
glucometer.kv
File metadata and controls
141 lines (132 loc) · 4.47 KB
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
#: import sm kivy.uix.screenmanager
#:import Factory kivy.factory.Factory
<ActionSpinnerOptions@SpinnerOption>
background_color: .4, .4, .4, 1
sync_height: True
height: '80sp'
<ActionSpinner@Spinner+ActionItem>
sync_height: True
#pos_hint: {'center_x': .5, 'center_y': .5}
canvas.before:
Color:
rgba: 0.120, 0.120, 0.120, 1
Rectangle:
size: self.size
pos: self.pos
border: 27, 20, 12, 12
background_normal: 'atlas://data/images/defaulttheme/action_group'
option_cls: Factory.ActionSpinnerOptions
BoxLayout:
orientation: 'vertical'
canvas.before:
Color:
rgb: .6, .6, .6
Rectangle:
size: self.size
source: 'res/background.png'
ActionBar:
id: bar
size_hint: 1, 0.09
ActionView:
use_separator: True
ActionPrevious:
id: previousid
important: True
title: app.set_time(0)
on_press: sm.transition.direction = 'right'
on_release:
sm.current = 'home'
spnr.text = 'Home'
app.set_previous('home')
with_previous: False
app_icon_width: 0.1
ActionSpinner:
id: spnr
size_hint: 0.75, None
#width: '200sp'
height: bar.height
important: False
values: app.screen_names
on_text: app.set_screen()
BoxLayout:
size_hint_y: None
height: '2sp'
canvas:
Color:
rgba: (34.0/256, 201.0/256, 198.0/256, .6)
Rectangle:
size: self.size
pos: self.pos
CustomScreenManager:
id: sm
<NewEntryPopup>:
size: app.width/1.5, app.height/1.5
pos_hint:{'y':(.25)}
size_hint: None, None
title: 'New Entry'
BoxLayout:
orientation: 'vertical'
BoxLayout:
size_hint_y: 1.78
BoxLayout:
orientation: 'vertical'
Label:
text: 'Date'
TextInput:
id: date
font_size: '15sp'
multiline: False
text: root.get_date()
BoxLayout:
orientation: 'vertical'
Label:
text: 'Time'
TextInput:
id: time
font_size: '15sp'
multiline: False
text: root.get_time()
BoxLayout:
size_hint_y: 1.9
BoxLayout:
orientation: 'vertical'
Label:
text: 'Bg'
TextInput:
id: bg
multiline: False
font_size: '15sp'
# A really messy char limit + only numbers
input_filter: (lambda text, from_undo: str(text[:3 - len(self.text)]).translate(None, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/=-:;][!@#$%^&*(){}\\\'\".,'))
BoxLayout:
orientation: 'vertical'
Label:
text: 'Carbs'
TextInput:
id: carbs
multiline: False
font_size: '15sp'
# A really messy char limit + only numbers
input_filter: (lambda text, from_undo: str(text[:3 - len(self.text)]).translate(None, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/=-:;][!@#$%^&*(){}\\\'\".,'))
BoxLayout:
orientation: 'vertical'
Label:
text: 'Bolus'
TextInput:
id: bolus
font_size: '15sp'
multiline: False
# A really messy char limit + only numbers
input_filter: (lambda text, from_undo: str(text[:2 - len(self.text)]).translate(None, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/=-:;][!@#$%^&*(){}\\\'\".,'))
Label:
text: 'Notes'
size_hint_y: .8
TextInput:
id: notes
multiline: False
font_size: '15sp'
input_filter: (lambda text, from_undo: text[:100 - len(self.text)])
Button:
text: "submit"
on_release:
root.submit()