1616DRAWER_ANIM_DURATION = 300
1717
1818drawer = None
19- rootscreen = None
20-
2119drawer_open = False
2220bar_open = False
2321
@@ -96,7 +94,6 @@ def open_bar():
9694 #print("not open so opening...")
9795 bar_open = True
9896 hide_bar_animation .current_value = hide_bar_animation_end_value
99- #show_bar_animation.current_value = hide_bar_animation_start_value
10097 show_bar_animation .start ()
10198 else :
10299 print ("bar already open" )
@@ -106,20 +103,12 @@ def close_bar():
106103 if bar_open :
107104 bar_open = False
108105 show_bar_animation .current_value = show_bar_animation_end_value
109- #hide_bar_animation.current_value = hide_bar_animation_start_value
110106 hide_bar_animation .start ()
111107
112108def show_launcher ():
113109 mpos .apps .restart_launcher ()
114- #global rootscreen
115- #set_foreground_app("com.example.launcher")
116- #open_bar()
117- #prevscreen = screen_stack[0] # load previous screen
118- #lv.screen_load(prevscreen)
119- #lv.screen_load(rootscreen)
120-
121- def create_rootscreen ():
122- global rootscreen
110+
111+ def init_rootscreen ():
123112 rootscreen = lv .screen_active ()
124113 # Create a style for the undecorated screen
125114 style = lv .style_t ()
@@ -134,10 +123,10 @@ def create_rootscreen():
134123 # Apply the style to the screen
135124 rootscreen .add_style (style , 0 )
136125 rootscreen .set_scrollbar_mode (lv .SCROLLBAR_MODE .OFF )
137- # rootscreen.set_scroll_mode (lv.SCROLL_MODE.OFF )
126+ rootscreen .set_scroll_dir (lv .DIR . NONE )
138127 rootlabel = lv .label (rootscreen )
139- rootlabel .set_text ("Welcome! " )
140- rootlabel .align ( lv . ALIGN . CENTER , 0 , 0 )
128+ rootlabel .set_text ("Welcome to MicroPythonOS " )
129+ rootlabel .center ( )
141130
142131
143132timer1 = None
0 commit comments