Skip to content

Commit e9810a3

Browse files
Merge branch 'main' into camera-resolution
2 parents 8c1903d + 4f18d84 commit e9810a3

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
0.5.1
22
=====
3-
- OSUpdate app: pause download when wifi is lost, resume when reconnected
43
- Fri3d Camp 2024 Badge: workaround ADC2+WiFi conflict by temporarily disable WiFi to measure battery level
5-
- Fri3d Camp 2024 Badge: improve battery monitor calibration
4+
- Fri3d Camp 2024 Badge: improve battery monitor calibration to fix 0.1V delta
65
- AppStore app: remove unnecessary scrollbar over publisher's name
6+
- OSUpdate app: pause download when wifi is lost, resume when reconnected
7+
- Settings app: fix un-checking of radio button
78

89
0.5.0
910
=====

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,18 @@ def radio_event_handler(self, event):
260260
target_obj_state = target_obj.get_state()
261261
print(f"target_obj state {target_obj.get_text()} is {target_obj_state}")
262262
checked = target_obj_state & lv.STATE.CHECKED
263+
current_checkbox_index = target_obj.get_index()
264+
print(f"current_checkbox_index: {current_checkbox_index}")
263265
if not checked:
264-
print("it's not checked, nothing to do!")
266+
if self.active_radio_index == current_checkbox_index:
267+
print(f"unchecking {current_checkbox_index}")
268+
self.active_radio_index = -1 # nothing checked
265269
return
266270
else:
267-
new_checked = target_obj.get_index()
268-
print(f"new_checked: {new_checked}")
269-
if self.active_radio_index >= 0:
271+
if self.active_radio_index >= 0: # is there something to uncheck?
270272
old_checked = self.radio_container.get_child(self.active_radio_index)
271273
old_checked.remove_state(lv.STATE.CHECKED)
272-
new_checked_obj = self.radio_container.get_child(new_checked)
273-
new_checked_obj.add_state(lv.STATE.CHECKED)
274-
self.active_radio_index = new_checked
274+
self.active_radio_index = current_checkbox_index
275275

276276
def create_radio_button(self, parent, text, index):
277277
cb = lv.checkbox(parent)

0 commit comments

Comments
 (0)