From afa7bd53c906f9fd32c581ca8f2f2ae9be6daa41 Mon Sep 17 00:00:00 2001 From: Kili <60932529+QuasiKili@users.noreply.github.com> Date: Tue, 20 Jan 2026 13:29:05 +0100 Subject: [PATCH] Update display.py Logo at boot IMPORTANT: change the url to a correct location and put this logo there https://github.com/QuasiKili/MPOS-logo/blob/main/all_formats/MicroPythonOS-logo-white-long-w240.png --- internal_filesystem/lib/mpos/ui/display.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/internal_filesystem/lib/mpos/ui/display.py b/internal_filesystem/lib/mpos/ui/display.py index 4066cb20..9da0cbf6 100644 --- a/internal_filesystem/lib/mpos/ui/display.py +++ b/internal_filesystem/lib/mpos/ui/display.py @@ -1,10 +1,13 @@ # lib/mpos/ui/display.py import lvgl as lv +from mpos.ui.theme import _is_light_mode _horizontal_resolution = None _vertical_resolution = None _dpi = None +logo_url="M:lib/assets/MicroPythonOS-logo-white-long-w240.png" # change this + def init_rootscreen(): global _horizontal_resolution, _vertical_resolution, _dpi screen = lv.screen_active() @@ -13,9 +16,16 @@ def init_rootscreen(): _vertical_resolution = disp.get_vertical_resolution() _dpi = disp.get_dpi() print(f"init_rootscreen set resolution to {_horizontal_resolution}x{_vertical_resolution} at {_dpi} DPI") - label = lv.label(screen) - label.set_text("Welcome to MicroPythonOS") - label.center() + try: + img = lv.image(screen) + img.set_src(logo_url) + if _is_light_mode: + img.set_blend_mode(lv.BLEND_MODE.DIFFERENCE) # invert the logo color + img.center() + except: # if image loading fails + label = lv.label(screen) + label.set_text("MicroPythonOS") + label.center() def get_pointer_xy(): indev = lv.indev_active() @@ -50,4 +60,4 @@ def get_display_height(): def get_dpi(): print(f"get_dpi_called {_dpi}") return _dpi - \ No newline at end of file +