Skip to content

Commit 50384d4

Browse files
Simplify
1 parent 1e7fc35 commit 50384d4

File tree

1 file changed

+5
-10
lines changed
  • internal_filesystem/builtin/apps/com.micropythonos.settings/assets

1 file changed

+5
-10
lines changed

internal_filesystem/builtin/apps/com.micropythonos.settings/assets/settings.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,9 @@ def getIntent(self):
3939
("Teal", "008080"),
4040
("Turquoise", "40e0d0")
4141
]
42-
# Create a mock intent-like object with extras
43-
class MockIntent:
44-
def __init__(self, extras):
45-
self.extras = extras
46-
47-
return MockIntent({
48-
"prefs": mpos.config.SharedPreferences("com.micropythonos.settings"),
49-
"settings": [
42+
intent = Intent()
43+
intent.putExtra("prefs", mpos.config.SharedPreferences("com.micropythonos.settings"))
44+
intent.putExtra("settings", [
5045
# Basic settings, alphabetically:
5146
{"title": "Light/Dark Theme", "key": "theme_light_dark", "ui": "radiobuttons", "ui_options": [("Light", "light"), ("Dark", "dark")], "changed_callback": self.theme_changed},
5247
{"title": "Theme Color", "key": "theme_primary_color", "placeholder": "HTML hex color, like: EC048C", "ui": "dropdown", "ui_options": theme_colors, "changed_callback": self.theme_changed},
@@ -61,8 +56,8 @@ def __init__(self, extras):
6156
# This is currently only in the drawer but would make sense to have it here for completeness:
6257
#{"title": "Display Brightness", "key": "display_brightness", "placeholder": "A value from 0 to 100."},
6358
# Maybe also add font size (but ideally then all fonts should scale up/down)
64-
]
65-
})
59+
])
60+
return intent
6661

6762
# Change handlers:
6863
def reset_into_bootloader(self, new_value):

0 commit comments

Comments
 (0)