From f18bb4cda7e148fade99f4a6d849600890b030d6 Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Fri, 6 Jun 2025 10:58:27 +0200 Subject: [PATCH] Switch to light theme --- internal_filesystem/lib/mpos/ui/__init__.py | 19 ++++--------------- internal_filesystem/main.py | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/internal_filesystem/lib/mpos/ui/__init__.py b/internal_filesystem/lib/mpos/ui/__init__.py index c0e338da..b026ed89 100644 --- a/internal_filesystem/lib/mpos/ui/__init__.py +++ b/internal_filesystem/lib/mpos/ui/__init__.py @@ -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 diff --git a/internal_filesystem/main.py b/internal_filesystem/main.py index f565e490..01185fa6 100644 --- a/internal_filesystem/main.py +++ b/internal_filesystem/main.py @@ -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()