@@ -334,6 +334,23 @@ def _handle_app_click(self, app):
334334# ------------------------------------------------------------------
335335def _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+ if focus_group :
342+ for widget_info in self ._app_widgets :
343+ try :
344+ focus_group .remove_obj (widget_info ['container' ])
345+ except :
346+ pass
347+ # Also remove mode button
348+ if self ._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
338355try :
339356parent = lv .layer_top ()
@@ -376,25 +393,46 @@ def _show_uninstall_confirmation_modal(self, app):
376393btn_cont .set_flex_flow (lv .FLEX_FLOW .ROW )
377394btn_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 (lambda e ,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+ if focus_group :
404+ focus_group .add_obj (no_btn )
405+
379406# Yes button
380407yes_btn = lv .button (btn_cont )
381408yes_btn .set_size (lv .pct (40 ),50 )
382409yes_btn .add_event_cb (lambda e ,a = app ,m = modal_bg :self ._confirm_uninstall (a ,m ),lv .EVENT .CLICKED ,None )
383410yes_label = lv .label (yes_btn )
384411yes_label .set_text ("Yes" )
385412yes_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 (lambda e ,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+ if focus_group :
414+ focus_group .add_obj (yes_btn )
394415
395416# ------------------------------------------------------------------
396417def _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+ if focus_group :
424+ for widget_info in self ._app_widgets :
425+ try :
426+ focus_group .remove_obj (widget_info ['container' ])
427+ except :
428+ pass
429+ # Also remove mode button
430+ if self ._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
399437try :
400438parent = lv .layer_top ()
@@ -436,12 +474,32 @@ def _show_builtin_info_modal(self, app):
436474ok_label = lv .label (ok_btn )
437475ok_label .set_text ("OK" )
438476ok_label .center ()
477+ if focus_group :
478+ focus_group .add_obj (ok_btn )
439479
440480# ------------------------------------------------------------------
441481def _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)
443487modal_bg .delete ()
444488
489+ # Re-add all app containers and mode button back to focus group
490+ if focus_group :
491+ for widget_info in self ._app_widgets :
492+ try :
493+ focus_group .add_obj (widget_info ['container' ])
494+ except :
495+ pass
496+ # Re-add mode button
497+ if self ._mode_button :
498+ try :
499+ focus_group .add_obj (self ._mode_button )
500+ except :
501+ pass
502+
445503# ------------------------------------------------------------------
446504def _confirm_uninstall (self ,app ,modal_bg ):
447505"""Actually uninstall the app"""