-
Notifications
You must be signed in to change notification settings - Fork 0
/
selfcheck.kv
172 lines (154 loc) · 5.5 KB
/
selfcheck.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
#:import _ localization._
<ItemEntry@BoxLayout>:
spacing: 10
padding: 10, 10, 10, 10
canvas:
Color:
rgba: 0.376, 0.475, 0.58, 1
Rectangle:
pos: self.pos
size: self.size
Label:
text: _('Title')
size_hint: 1.0, 1.0
halign: 'left'
valign: 'top'
Label:
text: _('Message')
size_hint: .2, 1.0
Button:
size_hint: .2, 1.0
height: '48dp'
width: 100
text: _('Action')
on_press: root.parent.parent.parent.parent.parent.btn_get_item_information()
#on_press: app.root.ids.main_selfcheck.btn_get_item_information()
<Selfcheck>:
id: main_selfcheck
GridLayout:
rows: 3
BoxLayout:
padding: '2sp'
size_hint: 1, None
height: '45sp'
canvas:
Color:
rgba: 1, .3, 1, .6
Rectangle:
size: self.size
pos: self.pos
BoxLayout:
size_hint: 1, 1
Label:
text: _("Autoconnect")
CheckBox:
id: sip2_btn_autologin
active: False
size_hint_x: 1
ToggleButton:
id: tgl_btn_connection
size_hint_x: None
size_hint_y: None
height: '48dp'
width: 100
text: _('Connect')
on_press: self.text = 'Connecting ...'; root.status_toggle_btn(tgl_btn_connection, 'tgl_btn_connection')
group: 'test'
BoxLayout:
id: reactive_layout
orientation: 'vertical' if self.width < self.height else 'horizontal'
Splitter:
id: editor_pane
max_size: (reactive_layout.height if self.vertical else reactive_layout.width) - self.strip_size
min_size: sp(30) + self.strip_size
vertical: 1 if reactive_layout.width < reactive_layout.height else 0
sizable_from: 'bottom' if self.vertical else 'right'
size_hint: (1, None) if self.vertical else (None, 1)
size: 400, 400
on_vertical:
mid_size = self.max_size/2
if args[1]: self.height = mid_size
if not args[1]: self.width = mid_size
Label:
id: scr_selfcheck_left
text: _('Left')
ScrollView:
id: item_list
GridLayout:
id: item_entries
cols: 1
row_force_default: True
row_default_height: 60
#ItemEntry:
# id: test123
BoxLayout:
id: bl
padding: '2sp'
size_hint: 1, None
height: '45sp'
canvas:
Color:
rgba: 1, .3, 1, .6
Rectangle:
size: self.size
pos: self.pos
Popup:
id: popup_password
title: _('Login with your library card')
size_hint: None, None
size: 400, 250
on_parent: if self.parent == bl: self.parent.remove_widget(self)
on_open: root.ids.inp_library_card.focus = True
GridLayout:
cols: 1
rows: 3
#row_force_default: True
#row_default_height: 50
padding: (0,20,0,5)
spacing: 15
TextInput:
id: inp_library_card
multiline:False
write_tab: False
font_size: 30
hint_text: _('Library card')
on_text_validate: root.ids.inp_password.focus=True
TextInput:
id: inp_password
multiline:False
write_tab: False
font_size: 30
password: True
hint_text: _('Password')
on_text_validate: root.btn_login()
Label:
id: patron_login_error
text: ''
#Button:
# text: 'press to dismiss'
# on_release: popup_password.dismiss()
Button:
text: _('Login')
size_hint: None, 1
width: 200
on_release: root.ids.popup_password.open()
BoxLayout:
size_hint: 0, 1
width: 400
Label:
text: 'Barcode'
TextInput:
id: inp_barcode
multiline:False
font_size: 20
on_text_validate: root.get_barcode(inp_barcode)
<Error>:
BoxLayout:
orientation: 'vertical'
Label:
text: "Error. Not connected"
font_size: 32
Button:
text: "Return"
font_size: 24
on_press: root.goLogin()