Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6435ac8

Browse files
author
Quasi Kili
committed
more tests but not working to get focus to stick to popup on removal confirm etc.
1 parent22fda1e commit6435ac8

File tree

1 file changed

+67
-9
lines changed
  • internal_filesystem/builtin/apps/com.micropythonos.launcher/assets

1 file changed

+67
-9
lines changed

‎internal_filesystem/builtin/apps/com.micropythonos.launcher/assets/launcher.py‎

Lines changed: 67 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,23 @@ def _handle_app_click(self, app):
334334
# ------------------------------------------------------------------
335335
def_show_uninstall_confirmation_modal(self,app):
336336
"""Show confirmation modal for uninstalling an app"""
337+
# Get current focus group
338+
focus_group=lv.group_get_default()
339+
340+
# Remove all app containers from focus group temporarily
341+
iffocus_group:
342+
forwidget_infoinself._app_widgets:
343+
try:
344+
focus_group.remove_obj(widget_info['container'])
345+
except:
346+
pass
347+
# Also remove mode button
348+
ifself._mode_button:
349+
try:
350+
focus_group.remove_obj(self._mode_button)
351+
except:
352+
pass
353+
337354
# Create modal background on layer_top to ensure it's above everything
338355
try:
339356
parent=lv.layer_top()
@@ -376,25 +393,46 @@ def _show_uninstall_confirmation_modal(self, app):
376393
btn_cont.set_flex_flow(lv.FLEX_FLOW.ROW)
377394
btn_cont.set_flex_align(lv.FLEX_ALIGN.SPACE_EVENLY,lv.FLEX_ALIGN.CENTER,lv.FLEX_ALIGN.CENTER)
378395

396+
# No button (add first so it gets focus by default - safer option)
397+
no_btn=lv.button(btn_cont)
398+
no_btn.set_size(lv.pct(40),50)
399+
no_btn.add_event_cb(lambdae,m=modal_bg:self._close_modal(m),lv.EVENT.CLICKED,None)
400+
no_label=lv.label(no_btn)
401+
no_label.set_text("No")
402+
no_label.center()
403+
iffocus_group:
404+
focus_group.add_obj(no_btn)
405+
379406
# Yes button
380407
yes_btn=lv.button(btn_cont)
381408
yes_btn.set_size(lv.pct(40),50)
382409
yes_btn.add_event_cb(lambdae,a=app,m=modal_bg:self._confirm_uninstall(a,m),lv.EVENT.CLICKED,None)
383410
yes_label=lv.label(yes_btn)
384411
yes_label.set_text("Yes")
385412
yes_label.center()
386-
387-
# No button
388-
no_btn=lv.button(btn_cont)
389-
no_btn.set_size(lv.pct(40),50)
390-
no_btn.add_event_cb(lambdae,m=modal_bg:self._close_modal(m),lv.EVENT.CLICKED,None)
391-
no_label=lv.label(no_btn)
392-
no_label.set_text("No")
393-
no_label.center()
413+
iffocus_group:
414+
focus_group.add_obj(yes_btn)
394415

395416
# ------------------------------------------------------------------
396417
def_show_builtin_info_modal(self,app):
397418
"""Show info modal explaining builtin apps cannot be uninstalled"""
419+
# Get current focus group
420+
focus_group=lv.group_get_default()
421+
422+
# Remove all app containers from focus group temporarily
423+
iffocus_group:
424+
forwidget_infoinself._app_widgets:
425+
try:
426+
focus_group.remove_obj(widget_info['container'])
427+
except:
428+
pass
429+
# Also remove mode button
430+
ifself._mode_button:
431+
try:
432+
focus_group.remove_obj(self._mode_button)
433+
except:
434+
pass
435+
398436
# Create modal background on layer_top to ensure it's above everything
399437
try:
400438
parent=lv.layer_top()
@@ -436,12 +474,32 @@ def _show_builtin_info_modal(self, app):
436474
ok_label=lv.label(ok_btn)
437475
ok_label.set_text("OK")
438476
ok_label.center()
477+
iffocus_group:
478+
focus_group.add_obj(ok_btn)
439479

440480
# ------------------------------------------------------------------
441481
def_close_modal(self,modal_bg):
442-
"""Close and delete modal"""
482+
"""Close and delete modal and restore focus group"""
483+
# Get focus group
484+
focus_group=lv.group_get_default()
485+
486+
# Delete modal (this will remove modal buttons from group)
443487
modal_bg.delete()
444488

489+
# Re-add all app containers and mode button back to focus group
490+
iffocus_group:
491+
forwidget_infoinself._app_widgets:
492+
try:
493+
focus_group.add_obj(widget_info['container'])
494+
except:
495+
pass
496+
# Re-add mode button
497+
ifself._mode_button:
498+
try:
499+
focus_group.add_obj(self._mode_button)
500+
except:
501+
pass
502+
445503
# ------------------------------------------------------------------
446504
def_confirm_uninstall(self,app,modal_bg):
447505
"""Actually uninstall the app"""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp