Switch to light theme

This commit is contained in:
Thomas Farstrike
2025-06-06 10:58:27 +02:00
parent 883faad931
commit f18bb4cda7
2 changed files with 20 additions and 17 deletions
+4 -15
View File
@@ -16,8 +16,6 @@ MEMFREE_UPDATE_INTERVAL = 5000 # not too frequent because there's a forced gc.co
DRAWER_ANIM_DURATION=300
drawer=None
rootscreen = None
drawer_open=False
bar_open=False
@@ -96,7 +94,6 @@ def open_bar():
#print("not open so opening...")
bar_open=True
hide_bar_animation.current_value = hide_bar_animation_end_value
#show_bar_animation.current_value = hide_bar_animation_start_value
show_bar_animation.start()
else:
print("bar already open")
@@ -106,20 +103,12 @@ def close_bar():
if bar_open:
bar_open=False
show_bar_animation.current_value = show_bar_animation_end_value
#hide_bar_animation.current_value = hide_bar_animation_start_value
hide_bar_animation.start()
def show_launcher():
mpos.apps.restart_launcher()
#global rootscreen
#set_foreground_app("com.example.launcher")
#open_bar()
#prevscreen = screen_stack[0] # load previous screen
#lv.screen_load(prevscreen)
#lv.screen_load(rootscreen)
def create_rootscreen():
global rootscreen
def init_rootscreen():
rootscreen = lv.screen_active()
# Create a style for the undecorated screen
style = lv.style_t()
@@ -134,10 +123,10 @@ def create_rootscreen():
# Apply the style to the screen
rootscreen.add_style(style, 0)
rootscreen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
#rootscreen.set_scroll_mode(lv.SCROLL_MODE.OFF)
rootscreen.set_scroll_dir(lv.DIR.NONE)
rootlabel = lv.label(rootscreen)
rootlabel.set_text("Welcome!")
rootlabel.align(lv.ALIGN.CENTER, 0, 0)
rootlabel.set_text("Welcome to MicroPythonOS")
rootlabel.center()
timer1 = None
+16 -2
View File
@@ -1,8 +1,22 @@
import task_handler
import mpos.ui
mpos.ui.create_rootscreen()
RED = lv.palette_main(lv.PALETTE.RED)
DARKPINK = lv.color_hex(0xEC048C);
MEDIUMPINK = lv.color_hex(0xF480C5);
LIGHTPINK = lv.color_hex(0xF9E9F2);
DARKYELLOW = lv.color_hex(0xFBDC05);
LIGHTYELLOW = lv.color_hex(0xFBE499);
theme = lv.theme_default_init(display._disp_drv, DARKPINK, DARKYELLOW, False, lv.font_montserrat_12)
#theme = lv.theme_default_init(display._disp_drv, DARKPINK, DARKYELLOW, True, lv.font_montserrat_12)
#display.set_theme(theme)
mpos.ui.init_rootscreen()
mpos.ui.create_notification_bar()
mpos.ui.create_drawer(display)
mpos.ui.handle_back_swipe()