-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy.kv
190 lines (152 loc) · 4.54 KB
/
my.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
ManageScreens:
LogInWindow:
MainScreen:
RegisterWindow:
<LogInWindow>:
name : "login_page"
username : username
password : password
canvas.before:
Rectangle:
pos: self.pos
size: self.size
source: 'bg.jpg'
MDBoxLayout:
pos_hint : {"center_x":0.5, "center_y": 0.675}
size_hint_x: None
MDLabel:
text : "Autentificare"
MDBoxLayout:
pos_hint : {"center_y": 0.8}
size_hint: 1,0.13
Image:
#pos_hint : {"center_x":0.5, "center_y":0.8}
#size_hint_x : None
source: "united.png"
MDTextField:
id : username
pos_hint : {"center_x":0.5, "center_y":0.6}
icon_right: "account-outline"
icon_right_color: 1,1,1,1
size_hint_x : None
width : 250
color_mode : "custom"
line_color_normal : 1,1,1,0.3
line_color_focus : 1,1,1,1
MDTextField:
id : password
pos_hint : {"center_x":0.5, "center_y": 0.5}
size_hint_x : None
width : 250
password : True
password_mask : "*"
color_mode : "custom"
line_color_normal : 1,1,1,0.3
line_color_focus : 1,1,1,1
icon_right: "lock"
icon_right_color: 1,1,1,1
MDIconButton:
pos_hint : {"center_x":0.5, "center_y": 0.4}
icon: "arrow-right"
on_release:
if root.login(): app.root.current = "main_screen"
MDTextButton:
color : 1,1,1,0.7
text : "Nu ai un cont? Creeaza unul!"
pos_hint : {"center_x":0.5, "center_y": 0.3}
on_release:
app.root.current = "register_window"
root.clear_text_fields()
<RegisterWindow>:
name : "register_window"
username : username
password : password
canvas.before:
Rectangle:
pos: self.pos
size: self.size
source: 'bg.jpg'
MDBoxLayout:
pos_hint : {"center_x":0.5, "center_y": 0.675}
size_hint_x: None
MDLabel:
text : "Inregistrare"
MDBoxLayout:
pos_hint : {"center_y": 0.8}
size_hint: 1,0.13
Image:
source: "united.png"
MDTextField:
id : username
pos_hint : {"center_x":0.5, "center_y":0.6}
icon_right: "account-outline"
icon_right_color: 1,1,1,1
size_hint_x : None
width : 250
color_mode : "custom"
line_color_normal : 1,1,1,0.3
line_color_focus : 1,1,1,1
MDTextField:
id : password
pos_hint : {"center_x":0.5, "center_y": 0.5}
size_hint_x : None
width : 250
password : True
password_mask : "*"
color_mode : "custom"
line_color_normal : 1,1,1,0.3
line_color_focus : 1,1,1,1
icon_right: "lock"
icon_right_color: 1,1,1,1
MDIconButton:
pos_hint : {"center_x":0.5, "center_y": 0.4}
icon: "arrow-right"
on_release:
app.root.current = "login_page" if root.register() else "register_window"
MDTextButton:
color : 1,1,1,0.7
text : "Ai deja un cont? Conecteaza-te la acesta!"
pos_hint : {"center_x":0.5, "center_y": 0.3}
on_release:
app.root.current = "login_page"
root.clear_text_fields()
<CustomLabel>:
size_hint_y: None
text_size: self.width, None
height: self.texture_size[1]
markup : True
md_bg_color : 0,0,0,0.1
<MainScreen>:
name : "main_screen"
messages : messages
text: text
canvas.before:
Rectangle:
pos: self.pos
size: self.size
source: 'bg.jpg'
ScrollView:
size_hint : 1,0.88
pos_hint : {"x":0.01, "y":0.1}
bar_width: 5
effect_cls: "ScrollEffect"
scroll_type: ['bars']
GridLayout:
id: messages
cols: 1
spacing: 10
size_hint_y: None
height: self.minimum_height
MDTextField:
id: text
size_hint : 0.8075,0.1
multiline : True
mode : "rectangle"
hint_text : "Type...."
line_color_normal : 1,1,1,0.3
line_color_focus : 1,1,1,1
MDFlatButton:
text : "Send"
size_hint : 0.2,0.09
pos_hint : {"center_x" : 0.915}
on_release: root.send()