-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsplash_screen.py
More file actions
30 lines (25 loc) · 968 Bytes
/
splash_screen.py
File metadata and controls
30 lines (25 loc) · 968 Bytes
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
from kivy.uix.screenmanager import Screen
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
from kivy.graphics import Color, Rectangle
from styles import apply_font
class SplashScreen(Screen):
def __init__(self, **kwargs):
super().__init__(**kwargs)
layout = BoxLayout(orientation="vertical")
with layout.canvas.before:
Color(0.52, 0.66, 0.28, 1)
self.rect = Rectangle(pos=layout.pos, size=layout.size)
layout.bind(pos=self.update_rect, size=self.update_rect)
self.app_name_label = Label(
text="UzHealthAI",
font_size=48,
bold=True,
color=(0.07, 0.21, 0.14, 1)
)
apply_font(self.app_name_label)
layout.add_widget(self.app_name_label)
self.add_widget(layout)
def update_rect(self, instance, value):
self.rect.pos = instance.pos
self.rect.size = instance.size