impuve UI to all screens

This commit is contained in:
2025-06-05 16:08:15 +03:00
parent 418ebc6f49
commit 8652940879
6 changed files with 214 additions and 142 deletions

View File

@@ -1,148 +1,207 @@
<LoginScreen>:
BoxLayout:
orientation: "vertical"
padding: 20
spacing: 20
padding: [16, 24, 16, 16]
spacing: 14
canvas.before:
Color:
rgba: 0.11, 0.10, 0.15, 1 # Background color: #1C1A27
rgba: 0.11, 0.10, 0.15, 1
Rectangle:
pos: self.pos
size: self.size
Widget:
size_hint_y: 0.10 # Spacer at the top
Image:
source: "resources/track.png"
size_hint: (1, 0.66) # 2/3 of the screen height
source: "resources/images/track.png" # <-- updated path
size_hint: (1, 0.28) # Smaller logo for phones
allow_stretch: True
keep_ratio: True
Widget:
size_hint_y: 0.05 # Spacer
TextInput:
id: username_input
hint_text: "Username"
multiline: False
font_size: 20 # Text size
height: self.minimum_height
size_hint_y: None # Fix height
size_hint_x: 0.8 # Center horizontally
pos_hint: {"center_x": 0.5}
font_size: 18
height: 44
size_hint_y: None
size_hint_x: 1
padding: [12, 12, 12, 12]
background_normal: ''
background_color: 0.15, 0.15, 0.18, 1
foreground_color: 1, 1, 1, 1
TextInput:
id: password_input
hint_text: "Password"
multiline: False
password: True
font_size: 20 # Text size
height: self.minimum_height
size_hint_y: None # Fix height
size_hint_x: 0.8 # Center horizontally
pos_hint: {"center_x": 0.5}
font_size: 18
height: 44
size_hint_y: None
size_hint_x: 1
padding: [12, 12, 12, 12]
background_normal: ''
background_color: 0.15, 0.15, 0.18, 1
foreground_color: 1, 1, 1, 1
Widget:
size_hint_y: 0.02 # Small spacer
BoxLayout:
orientation: "horizontal"
size_hint_y: None
height: 50 # Fixed height for the button group
size_hint_x: 0.8 # Match the width of the TextInput fields
pos_hint: {"center_x": 0.5} # Center horizontally
height: 48
spacing: 10
Button:
text: "Login"
font_size: 20 # Match the font size of the TextInput fields
size_hint_x: 0.5 # Half the width of the BoxLayout
size_hint_y: None
height: 50 # Fixed height for the button
background_color: 0.341, 0.235, 0.980, 1 # Purple color (#573CFA)
font_size: 18
size_hint_x: 0.5
background_color: 0.341, 0.235, 0.980, 1
color: 1, 1, 1, 1
on_press: root.login()
Button:
text: "Register"
font_size: 20
font_size: 18
size_hint_x: 0.5
size_hint_y: None
height: 50
background_color: 0.341, 0.235, 0.980, 1 # Purple color (#573CFA)
on_press: app.root.current = "register" # Navigate to the RegisterScreen
background_color: 0.341, 0.235, 0.980, 1
color: 1, 1, 1, 1
on_press: app.root.current = "register"
Widget:
size_hint_y: 0.08 # Spacer
Label:
id: result_label
text: ""
font_size: 15
size_hint_y: None
height: 28
color: 1, 1, 1, 1
<RegisterScreen>:
BoxLayout:
orientation: "vertical"
padding: 20
spacing: 20
padding: [16, 24, 16, 16]
spacing: 14
canvas.before:
Color:
rgba: 0.11, 0.10, 0.15, 1 # Background color: #1C1A27
rgba: 0.11, 0.10, 0.15, 1
Rectangle:
pos: self.pos
size: self.size
Widget:
size_hint_y: 0.08
Image:
source: "resources/track.png"
size_hint: (1, 0.66) # 2/3 of the screen height
source: "resources/images/track.png"
size_hint: (1, 0.22)
allow_stretch: True
keep_ratio: True
Label:
text: "Register"
font_size: 22
color: 1, 1, 1, 1
size_hint_y: None
height: 36
TextInput:
id: set_username_input
hint_text: "Set Username"
hint_text: "Username"
multiline: False
font_size: 20 # Text size
height: self.minimum_height
size_hint_y: None # Fix height
size_hint_x: 0.8 # Center horizontally
pos_hint: {"center_x": 0.5}
font_size: 18
height: 44
size_hint_y: None
size_hint_x: 1
padding: [12, 12, 12, 12]
background_normal: ''
background_color: 0.15, 0.15, 0.18, 1
foreground_color: 1, 1, 1, 1
TextInput:
id: set_email_input
hint_text: "Email"
multiline: False
font_size: 18
height: 44
size_hint_y: None
size_hint_x: 1
padding: [12, 12, 12, 12]
background_normal: ''
background_color: 0.15, 0.15, 0.18, 1
foreground_color: 1, 1, 1, 1
TextInput:
id: set_password_input
hint_text: "Set Password"
hint_text: "Password"
multiline: False
password: True
font_size: 20 # Text size
height: self.minimum_height
size_hint_y: None # Fix height
size_hint_x: 0.8 # Center horizontally
pos_hint: {"center_x": 0.5}
font_size: 18
height: 44
size_hint_y: None
size_hint_x: 1
padding: [12, 12, 12, 12]
background_normal: ''
background_color: 0.15, 0.15, 0.18, 1
foreground_color: 1, 1, 1, 1
TextInput:
id: confirm_password_input
hint_text: "Confirm Password"
multiline: False
password: True
font_size: 20 # Text size
height: self.minimum_height
size_hint_y: None # Fix height
size_hint_x: 0.8 # Center horizontally
pos_hint: {"center_x": 0.5}
TextInput:
id: set_email_input
hint_text: "Set Email"
multiline: False
font_size: 20 # Text size
height: self.minimum_height
size_hint_y: None # Fix height
size_hint_x: 0.8 # Center horizontally
pos_hint: {"center_x": 0.5}
Button:
text: "Create Username"
font_size: 20 # Match the font size of the TextInput fields
size_hint_x: 0.8 # Match the width of the TextInput fields
font_size: 18
height: 44
size_hint_y: None
height: 50 # Fixed height for the button
pos_hint: {"center_x": 0.5}
on_press: root.create_user()
size_hint_x: 1
padding: [12, 12, 12, 12]
background_normal: ''
background_color: 0.15, 0.15, 0.18, 1
foreground_color: 1, 1, 1, 1
Button:
text: "Back to Login"
font_size: 20
size_hint_x: 0.8
Widget:
size_hint_y: 0.02
BoxLayout:
orientation: "horizontal"
size_hint_y: None
height: 50
pos_hint: {"center_x": 0.5}
on_press: app.root.current = "login"
height: 48
spacing: 10
Button:
text: "Register"
font_size: 18
size_hint_x: 0.5
background_color: 0.341, 0.235, 0.980, 1
color: 1, 1, 1, 1
on_press: root.create_user()
Button:
text: "Back"
font_size: 18
size_hint_x: 0.5
background_color: 0.341, 0.235, 0.980, 1
color: 1, 1, 1, 1
on_press: app.root.current = "login"
Widget:
size_hint_y: 0.06
Label:
id: result_label
text: ""
size_hint: (1, 0.2)
font_size: 15
size_hint_y: None
height: 28
color: 1, 1, 1, 1
<HomeScreen>:
BoxLayout:
@@ -387,105 +446,115 @@
<SettingsScreen>:
BoxLayout:
orientation: "vertical"
padding: 20
spacing: 20
padding: [16, 24, 16, 16]
spacing: 14
canvas.before:
Color:
rgba: 0.11, 0.10, 0.15, 1 # Background color: #1C1A27
rgba: 0.11, 0.10, 0.15, 1
Rectangle:
pos: self.pos
size: self.size
Image:
source: "resources/track.png"
size_hint: (1, 0.66) # 2/3 of the screen height
source: "resources/images/track.png"
size_hint: (1, 0.22)
allow_stretch: True
keep_ratio: True
TextInput:
id: server_url_input
hint_text: "Traccar Server URL"
multiline: False
font_size: 20
font_size: 18
height: 44
size_hint_y: None
height: self.minimum_height
size_hint_x: 0.8
pos_hint: {"center_x": 0.5}
size_hint_x: 1
padding: [12, 12, 12, 12]
background_normal: ''
background_color: 0.15, 0.15, 0.18, 1
foreground_color: 1, 1, 1, 1
TextInput:
id: username_input
hint_text: "Username"
multiline: False
font_size: 20
font_size: 18
height: 44
size_hint_y: None
height: self.minimum_height
size_hint_x: 0.8
pos_hint: {"center_x": 0.5}
size_hint_x: 1
padding: [12, 12, 12, 12]
background_normal: ''
background_color: 0.15, 0.15, 0.18, 1
foreground_color: 1, 1, 1, 1
TextInput:
id: password_input
hint_text: "Password"
multiline: False
password: True
font_size: 20
font_size: 18
height: 44
size_hint_y: None
height: self.minimum_height
size_hint_x: 0.8
pos_hint: {"center_x": 0.5}
size_hint_x: 1
padding: [12, 12, 12, 12]
background_normal: ''
background_color: 0.15, 0.15, 0.18, 1
foreground_color: 1, 1, 1, 1
TextInput:
id: token_input
hint_text: "Token"
multiline: False
font_size: 20
font_size: 18
height: 44
size_hint_y: None
height: self.minimum_height
size_hint_x: 0.8
pos_hint: {"center_x": 0.5}
size_hint_x: 1
padding: [12, 12, 12, 12]
background_normal: ''
background_color: 0.15, 0.15, 0.18, 1
foreground_color: 1, 1, 1, 1
BoxLayout:
orientation: "horizontal"
size_hint_y: None
height: 50
size_hint_x: 0.8
pos_hint: {"center_x": 0.5}
height: 48
spacing: 10
Button:
text: "Test Connection"
size_hint_x: 0.5 # Half the width of the BoxLayout
size_hint_y: None
height: 50
background_color: 0.341, 0.235, 0.980, 1 # Purple color (#573CFA)
font_size: 16
size_hint_x: 0.5
background_color: 0.341, 0.235, 0.980, 1
color: 1, 1, 1, 1
on_press: root.test_connection()
Button:
text: "Save Settings"
size_hint_x: 0.5 # Half the width of the BoxLayout
size_hint_y: None
height: 50
background_color: 0.008, 0.525, 0.290, 1 # Purple color (#573CFA)
font_size: 16
size_hint_x: 0.5
background_color: 0.008, 0.525, 0.290, 1
color: 1, 1, 1, 1
on_press: root.save_settings()
Label:
id: result_label
text: "Waiting to test connection..."
font_size: 15
size_hint_y: None
height: 50
size_hint_x: 0.8
pos_hint: {"center_x": 0.5}
canvas.before:
Color:
rgba: 1, 1, 1, 1 # White color
Line:
width: 1.5
rectangle: self.x, self.y, self.width, self.height
height: 28
color: 1, 1, 1, 1
halign: "center"
valign: "middle"
text_size: self.size
padding: [0, 8]
Button:
text: "Return to Home"
size_hint_y: None
height: 50
size_hint_x: 0.8
pos_hint: {"center_x": 0.5}
background_color: 0.341, 0.235, 0.980, 1 # Purple color (#573CFA)
height: 48
background_color: 0.341, 0.235, 0.980, 1
color: 1, 1, 1, 1
font_size: 16
on_press: app.root.current = "home"
<CreateAnimationScreen>: