-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdesign.kv
164 lines (153 loc) · 4.72 KB
/
design.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
<LoginScreen>:
GridLayout:
cols: 1
GridLayout:
cols: 1
padding: 15, 15
spacing: 20, 20
Label:
text: "User Login"
font_size: '20sp'
TextInput:
id: username
hint_text: "Username"
write_tab: False
multiline: False
TextInput:
password: False if switch.active else True
id: password
# password: True
hint_text: "Password"
write_tab: False
multiline: False
GridLayout:
cols: 2
Label:
text:"Show Password"
Switch:
id: switch
RelativeLayout:
Button:
text: "Login"
on_press: root.login(root.ids.username.text, root.ids.password.text)
size_hint: 0.3, 0.5
pos_hint: {'center_x': 0.5, 'center_y': 0.6}
Label:
id: login_wrong
text: ""
GridLayout:
cols: 2
size_hint: 0.2, 0.2
padding: 10, 10
spacing: 10, 0
Button:
text: "Forgot Password"
background_color: 1, 1, 1, 0
opacity: 1 if self.state == 'normal' else 0.5
color: 0.1, 0.7, 1, 1
on_press: root.go_to_forgot_password()
Button:
text: "Sign Up"
background_color: 1, 1, 1, 0
opacity: 1 if self.state == 'normal' else 0.5
color: 0.1, 0.7, 1, 1
on_press: root.sign_up()
<SignUpScreen>:
GridLayout:
cols: 1
padding: 20, 20
spacing: 20, 20
Label:
text: "Sign up for a space journey!"
font_size: '20sp'
TextInput:
id: username
hint_text: "Username"
TextInput:
id: password
hint_text: "Password"
Button:
text: "Submit"
on_press:root.add_user(root.ids.username.text, root.ids.password.text)
Button:
text: "Go back to login page"
background_color: 1, 1, 1, 0
opacity: 1 if self.state == 'normal' else 0.5
color: 0.1, 0.7, 1, 1
on_press: root.go_back_to_login()
<SignUpScreenSuccess>:
GridLayout:
cols: 1
Label:
text: "Sign up successful!"
font_size: '20sp'
Button:
text: "Go back to login page"
background_color: 1, 1, 1, 0
opacity: 1 if self.state == 'normal' else 0.5
color: 0.1, 0.7, 1, 1
on_press: root.go_back_to_login()
<LoginScreenSuccess>:
GridLayout:
cols: 1
padding: 30, 30
spacing: 30, 30
RelativeLayout:
ImageButton:
on_press: root.log_out()
source: 'logout_hover.png' if self.hovered else 'logout_nothover.png'
size_hint: 0.35, 0.35
pos_hint: {'center_x': 0.85, 'center_y': 0.8}
Label:
text: "How do you feel?"
TextInput:
id: feeling
hint_text: "Things to try: happy, sad, unloved..."
Button:
text: "Enlighten me"
on_press: root.get_quote(root.ids.feeling.text)
ScrollView:
Label:
id: quotes
text: ""
text_size: self.width, None
size_hint_y: None
height: self.texture_size[1]
<ForgotPassword>:
GridLayout:
cols: 1
padding: 20, 20
spacing: 20, 20
Label:
text: "Username"
TextInput:
id: username
hint_text: "Username"
Label:
text: "New Password"
TextInput:
id: new_password
hint_text: "Enter New Password"
Button:
text: "Change Password"
on_press: root.change_password(root.ids.username.text,root.ids.new_password.text)
Label:
id: password_status
text: ""
Button:
text: "Go back to login page"
background_color: 1, 1, 1, 0
opacity: 1 if self.state == 'normal' else 0.5
color: 0.1, 0.7, 1, 1
on_press: root.go_back_to_login()
<RootWidget>:
LoginScreen:
name: "login_screen"
SignUpScreen:
name: "sign_up_screen"
SignUpScreenSuccess:
name: "sign_up_screen_success"
LoginScreenSuccess:
name: "login_screen_success"
ForgotPassword:
name: "forgot_password"