55
66class About (Activity ):
77
8- def _add_label (self , parent , text ):
8+ def _add_label (self , parent , text , is_header = False ):
99 """Helper to create and add a label with text."""
1010 label = lv .label (parent )
1111 label .set_text (text )
12+ if is_header :
13+ label .set_style_text_color (lv .color_hex (0x4A90E2 ), 0 )
14+ label .set_style_text_font (lv .font_montserrat_14 , 0 )
15+ label .set_style_margin_top (12 , 0 )
16+ label .set_style_margin_bottom (4 , 0 )
17+ else :
18+ label .set_style_text_font (lv .font_montserrat_12 , 0 )
19+ label .set_style_margin_bottom (2 , 0 )
1220 return label
1321
1422 def _add_disk_info (self , screen , path ):
@@ -36,12 +44,14 @@ def onCreate(self):
3644 focusgroup .add_obj (screen )
3745
3846 # Basic OS info
47+ self ._add_label (screen , f"{ lv .SYMBOL .HOME } System Information" , is_header = True )
3948 self ._add_label (screen , f"MicroPythonOS version: { mpos .info .CURRENT_OS_VERSION } " )
4049 self ._add_label (screen , f"Hardware ID: { mpos .info .get_hardware_id ()} " )
4150 self ._add_label (screen , f"sys.version: { sys .version } " )
4251 self ._add_label (screen , f"sys.implementation: { sys .implementation } " )
4352
4453 # MPY version info
54+ self ._add_label (screen , f"{ lv .SYMBOL .SETTINGS } MicroPython Version" , is_header = True )
4555 sys_mpy = sys .implementation ._mpy
4656 self ._add_label (screen , f'mpy version: { sys_mpy & 0xff } ' )
4757 self ._add_label (screen , f'mpy sub-version: { sys_mpy >> 8 & 3 } ' )
@@ -57,10 +67,12 @@ def onCreate(self):
5767 self ._add_label (screen , 'mpy flags: ' + flags )
5868
5969 # Platform info
70+ self ._add_label (screen , f"{ lv .SYMBOL .FILE } Platform" , is_header = True )
6071 self ._add_label (screen , f"sys.platform: { sys .platform } " )
6172 self ._add_label (screen , f"sys.path: { sys .path } " )
6273
6374 # MicroPython and memory info
75+ self ._add_label (screen , f"{ lv .SYMBOL .DRIVE } Memory & Performance" , is_header = True )
6476 import micropython
6577 self ._add_label (screen , f"micropython.opt_level(): { micropython .opt_level ()} " )
6678 import gc
@@ -72,6 +84,7 @@ def onCreate(self):
7284
7385 # Partition info (ESP32 only)
7486 try :
87+ self ._add_label (screen , f"{ lv .SYMBOL .SD_CARD } Partition Info" , is_header = True )
7588 from esp32 import Partition
7689 current = Partition (Partition .RUNNING )
7790 self ._add_label (screen , f"Partition.RUNNING: { current } " )
@@ -83,6 +96,7 @@ def onCreate(self):
8396 # Machine info
8497 try :
8598 print ("Trying to find out additional board info, not available on every platform..." )
99+ self ._add_label (screen , f"{ lv .SYMBOL .POWER } Machine Info" , is_header = True )
86100 import machine
87101 self ._add_label (screen , f"machine.freq: { machine .freq ()} " )
88102 self ._add_label (screen , f"machine.unique_id(): { machine .unique_id ()} " )
@@ -94,6 +108,7 @@ def onCreate(self):
94108 # Freezefs info (production builds only)
95109 try :
96110 print ("Trying to find out freezefs info, this only works on production builds..." ) # dev builds already have the /builtin folder
111+ self ._add_label (screen , f"{ lv .SYMBOL .DOWNLOAD } Frozen Filesystem" , is_header = True )
97112 import freezefs_mount_builtin
98113 self ._add_label (screen , f"freezefs_mount_builtin.date_frozen: { freezefs_mount_builtin .date_frozen } " )
99114 self ._add_label (screen , f"freezefs_mount_builtin.files_folders: { freezefs_mount_builtin .files_folders } " )
@@ -110,6 +125,7 @@ def onCreate(self):
110125 self ._add_label (screen , f"freezefs_mount_builtin exception (normal if internal storage partition has overriding /builtin folder): { e } " )
111126
112127 # Disk usage info
128+ self ._add_label (screen , f"{ lv .SYMBOL .DRIVE } Storage" , is_header = True )
113129 self ._add_disk_info (screen , '/' )
114130 self ._add_disk_info (screen , '/sdcard' )
115131
0 commit comments