2
0
mirror of https://github.com/ComradCollective/Comrad synced 2024-11-09 13:10:44 +00:00
Comrad/app/screens/login/login.kv

162 lines
4.0 KiB
Plaintext
Raw Normal View History

2020-08-10 16:37:42 +00:00
#:import LoginScreen screens.login.login.LoginScreen
2020-08-12 06:49:14 +00:00
#:import LoginBoxLayout screens.login.login.LoginBoxLayout
#:import UsernameField screens.login.login.UsernameField
#:import PasswordField screens.login.login.PasswordField
#:import LoginButtonLayout screens.login.login.LoginButtonLayout
#:import LoginButton screens.login.login.LoginButton
#:import RegisterButton screens.login.login.RegisterButton
#:import LoginStatus screens.login.login.LoginStatus
2020-08-19 23:26:25 +00:00
#:import rgb main.rgb
#:import COLOR_TEXT main.COLOR_TEXT
#:import COLOR_CARD main.COLOR_CARD
#:import COLOR_CARD_BORDER main.COLOR_CARD_BORDER
2020-08-21 11:49:39 +00:00
#:import COLOR_ACCENT main.COLOR_ACCENT
2020-08-10 16:37:42 +00:00
2020-08-12 06:49:14 +00:00
<LoginBoxLayout>:
id: loginbox
orientation:'vertical'
cols:1
2020-08-19 19:33:25 +00:00
size_hint:0.5,None
2020-08-12 06:49:14 +00:00
pos_hint: {'center_x':0.5,'center_y':0.5}
2020-08-19 23:26:25 +00:00
md_bg_color: rgb(*COLOR_CARD)
2020-08-12 06:49:14 +00:00
radius:[20,]
border_radius:20
spacing:'10dp'
2020-08-19 19:33:25 +00:00
padding:'25dp'
adaptive_height: True
2020-08-19 23:26:25 +00:00
# canvas:
# Color:
# rgba: rgb(*COLOR_CARD_BORDER)
# Line:
# width: 1
# rounded_rectangle: (self.x, self.y, self.width, self.height, 20, 20, 20, 20)
2020-08-19 19:33:25 +00:00
<UsernameLayout>:
cols:2
orientation:'horizontal'
adaptive_height: True
size_hint:1,None
# pos_hint:{'right':0.9}
# spacing:'100sp'
# md_bg_color:1,1,0,1
2020-08-21 11:49:39 +00:00
<WelcomeLabel>:
text: 'Enter, Komrade'
halign: 'center'
size_hint_x: 1
theme_text_color: 'Custom'
color: rgb(*COLOR_ACCENT)
adaptive_width: True
# size_hint:0.333,None
# md_bg_color:rgb(*COLOR_TEXT)
# pos_hint: {'y':1}
halign:'center'
2020-08-19 19:33:25 +00:00
<UsernameLabel>:
theme_text_color: 'Custom'
2020-08-19 23:26:25 +00:00
text_color: rgb(*COLOR_TEXT)
2020-08-21 12:01:41 +00:00
width:'100sp'
# adaptive_width: True
size_hint:None,None
2020-08-19 23:26:25 +00:00
# md_bg_color:rgb(*COLOR_TEXT)
2020-08-19 19:33:25 +00:00
# pos_hint: {'y':1}
halign:'center'
2020-08-21 11:49:39 +00:00
2020-08-19 19:33:25 +00:00
2020-08-12 06:49:14 +00:00
<UsernameField>:
id: username
2020-08-19 19:33:25 +00:00
text: ""
2020-08-12 06:49:14 +00:00
hint_text: "username"
required: True
write_tab: False
multiline: False
2020-08-21 13:33:01 +00:00
helper_text_mode: "on_error"
2020-08-12 06:49:14 +00:00
color_mode: 'custom'
2020-08-19 23:26:25 +00:00
line_color_focus: rgb(*COLOR_TEXT)
line_color_normal: rgb(*COLOR_TEXT)
current_hint_text_color: rgb(*COLOR_TEXT)
error_color:rgb(*COLOR_TEXT)
2020-08-21 12:01:41 +00:00
# pos_hint: {'center_x':0.5,'y':0.2}
2020-08-21 11:49:39 +00:00
size_hint:0.666,None
2020-08-21 12:01:41 +00:00
# font_size:'2dp'
2020-08-19 19:33:25 +00:00
2020-08-10 16:37:42 +00:00
2020-08-12 06:49:14 +00:00
<PasswordField>:
id: password
2020-08-19 19:33:25 +00:00
text: ""
2020-08-12 06:49:14 +00:00
password: True
hint_text: "password"
required: True
write_tab: False
multiline: False
2020-08-21 13:33:01 +00:00
helper_text_mode: "on_error"
2020-08-12 06:49:14 +00:00
color_mode: 'custom'
2020-08-19 23:26:25 +00:00
line_color_focus: rgb(*COLOR_TEXT)
line_color_normal: rgb(*COLOR_TEXT)
current_hint_text_color: rgb(*COLOR_TEXT)
text_color: rgb(*COLOR_TEXT)
2020-08-19 19:33:25 +00:00
pos_hint: {'center_x':0.5,'y':0.2}
2020-08-21 11:49:39 +00:00
size_hint:0.666,None
2020-08-10 16:37:42 +00:00
2020-08-12 06:49:14 +00:00
<LoginButtonLayout>:
id: buttonbox
2020-08-19 19:33:25 +00:00
orientation:'horizontal'
cols: 2
# size_hint_y: None
2020-08-12 06:49:14 +00:00
adaptive_width: True
height: '56dp'
2020-08-19 19:33:25 +00:00
spacing: '25dp'
padding: '10dp'
# md_bg_color:1,1,0,1
size_hint:None,None
pos_hint: {'center_x': .5}#, 'bottom':1}
2020-08-10 16:37:42 +00:00
2020-08-12 06:49:14 +00:00
<LoginButton>:
text: "login"
on_release:
app.login(self.parent.parent.parent.username_field.text, self.parent.parent.parent.password_field.text)
#app.root.change_screen("welcome")
theme_text_color: "Custom"
2020-08-19 23:26:25 +00:00
text_color: rgb(*COLOR_TEXT)
2020-08-12 06:49:14 +00:00
md_bg_color: 0,0,0,1
2020-08-19 19:33:25 +00:00
size_hint:None,None
2020-08-21 13:12:13 +00:00
# font_size:'24sp'
2020-08-19 19:33:25 +00:00
# pos_hint: {'center_x': .5, 'bottom':1}
2020-08-10 16:37:42 +00:00
2020-08-12 06:49:14 +00:00
<RegisterButton>:
2020-08-19 23:26:25 +00:00
text: "join"
2020-08-12 06:49:14 +00:00
on_release:
app.register(self.parent.parent.parent.username_field.text, self.parent.parent.parent.password_field.text)
theme_text_color: "Custom"
2020-08-19 23:26:25 +00:00
text_color: rgb(*COLOR_TEXT)
2020-08-12 06:49:14 +00:00
md_bg_color: 0,0,0,1
2020-08-21 13:12:13 +00:00
# font_size:'24sp'
2020-08-19 19:33:25 +00:00
# size_hint:1,None
2020-08-10 16:37:42 +00:00
2020-08-12 06:49:14 +00:00
<LoginStatus>:
id: login_status
text:""
theme_text_color: 'Error'
2020-08-19 19:33:25 +00:00
size_hint:1,1
halign:'center'
pos_hint:{'center_x':.5, 'center_y':0.5}
2020-08-12 06:49:14 +00:00
2020-08-10 16:37:42 +00:00
2020-08-19 19:33:25 +00:00
2020-08-12 06:49:14 +00:00
<LoginScreen>:
name: "login"
id: login_screen
2020-08-10 16:37:42 +00:00
2020-08-12 06:49:14 +00:00
# LoginBoxLayout:
# UsernameField:
# PasswordField:
# LoginButtonLayout:
# LoginButton:
# RegisterButton:
# LoginStatus: