Skip to content

Commit f18bb4c

Browse files
Switch to light theme
1 parent 883faad commit f18bb4c

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

internal_filesystem/lib/mpos/ui/__init__.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
DRAWER_ANIM_DURATION=300
1717

1818
drawer=None
19-
rootscreen = None
20-
2119
drawer_open=False
2220
bar_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

112108
def 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

143132
timer1 = None

internal_filesystem/main.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
import task_handler
22

3-
43
import mpos.ui
5-
mpos.ui.create_rootscreen()
4+
5+
6+
RED = lv.palette_main(lv.PALETTE.RED)
7+
8+
DARKPINK = lv.color_hex(0xEC048C);
9+
MEDIUMPINK = lv.color_hex(0xF480C5);
10+
LIGHTPINK = lv.color_hex(0xF9E9F2);
11+
DARKYELLOW = lv.color_hex(0xFBDC05);
12+
LIGHTYELLOW = lv.color_hex(0xFBE499);
13+
14+
theme = lv.theme_default_init(display._disp_drv, DARKPINK, DARKYELLOW, False, lv.font_montserrat_12)
15+
#theme = lv.theme_default_init(display._disp_drv, DARKPINK, DARKYELLOW, True, lv.font_montserrat_12)
16+
17+
#display.set_theme(theme)
18+
19+
mpos.ui.init_rootscreen()
620
mpos.ui.create_notification_bar()
721
mpos.ui.create_drawer(display)
822
mpos.ui.handle_back_swipe()

0 commit comments

Comments
 (0)