You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Simplify imports
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
# Most of this time is actually spent reading and parsing manifests.
|
||||
import lvgl as lv
|
||||
import mpos.apps
|
||||
from mpos import ui, PackageManager, Activity, pct_of_display_width
|
||||
from mpos import NOTIFICATION_BAR_HEIGHT, PackageManager, Activity, pct_of_display_width
|
||||
import time
|
||||
import uhashlib
|
||||
import ubinascii
|
||||
@@ -28,9 +28,9 @@ class Launcher(Activity):
|
||||
main_screen = lv.obj()
|
||||
main_screen.set_style_border_width(0, lv.PART.MAIN)
|
||||
main_screen.set_style_radius(0, 0)
|
||||
main_screen.set_pos(0, mpos.ui.topmenu.NOTIFICATION_BAR_HEIGHT)
|
||||
main_screen.set_pos(0, NOTIFICATION_BAR_HEIGHT)
|
||||
main_screen.set_style_pad_hor(pct_of_display_width(2), 0)
|
||||
main_screen.set_style_pad_ver(mpos.ui.topmenu.NOTIFICATION_BAR_HEIGHT, 0)
|
||||
main_screen.set_style_pad_ver(NOTIFICATION_BAR_HEIGHT, 0)
|
||||
main_screen.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP)
|
||||
self.setContentView(main_screen)
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ class OSUpdate(Activity):
|
||||
self.force_update = lv.checkbox(self.main_screen)
|
||||
self.force_update.set_text("Force Update")
|
||||
self.force_update.add_event_cb(lambda *args: self.force_update_clicked(), lv.EVENT.VALUE_CHANGED, None)
|
||||
#self.force_update.add_event_cb(lambda e: mpos.ui.print_event(e), lv.EVENT.ALL, None)
|
||||
self.force_update.align_to(self.current_version_label, lv.ALIGN.OUT_BOTTOM_LEFT, 0, pct_of_display_height(5))
|
||||
self.install_button = lv.button(self.main_screen)
|
||||
self.install_button.align(lv.ALIGN.TOP_RIGHT, 0, 0)
|
||||
|
||||
@@ -95,5 +95,5 @@ class Settings(SettingsActivity):
|
||||
PackageManager.refresh_apps()
|
||||
|
||||
def theme_changed(self, new_value):
|
||||
import mpos.ui
|
||||
mpos.ui.set_theme(self.prefs)
|
||||
from mpos import set_theme
|
||||
set_theme(self.prefs)
|
||||
|
||||
Reference in New Issue
Block a user