gui: set WIDGET_FLAGS_VISIBLE_BIT early in Dialog_OnShow

This commit is contained in:
Martin Preuss
2026-05-13 20:07:45 +02:00
parent a4722bc8f6
commit 76def6c8dc

View File

@@ -204,10 +204,15 @@ Dialog_OnAbort:
; @clobbers any, !Y ; @clobbers any, !Y
Dialog_OnShow: Dialog_OnShow:
; check VISIBLE flag
ldd r16, Y+OBJECT_OFFS_FLAGS ldd r16, Y+OBJECT_OFFS_FLAGS
sbrc r16, WIDGET_FLAGS_VISIBLE_BIT sbrc r16, WIDGET_FLAGS_VISIBLE_BIT
rjmp Dialog_OnShow_ret rjmp Dialog_OnShow_ret
; set VISIBLE flag
sbr r16, (1<<WIDGET_FLAGS_VISIBLE_BIT) | (1<<WIDGET_FLAGS_DIRTY_BIT) | (1<<WIDGET_FLAGS_LAYOUT_BIT)
std Y+OBJECT_OFFS_FLAGS, r16
bigcall MainWindow_CreateContentWidget bigcall MainWindow_CreateContentWidget
brcc Dialog_OnShow_ret brcc Dialog_OnShow_ret
@@ -221,10 +226,6 @@ Dialog_OnShow:
Dialog_OnShow_toGui: Dialog_OnShow_toGui:
rcall Dialog_toGui rcall Dialog_toGui
; set VISIBLE flag
ldd r16, Y+OBJECT_OFFS_FLAGS
sbr r16, (1<<WIDGET_FLAGS_VISIBLE_BIT) | (1<<WIDGET_FLAGS_DIRTY_BIT) | (1<<WIDGET_FLAGS_LAYOUT_BIT)
std Y+OBJECT_OFFS_FLAGS, r16
Dialog_OnShow_ret: Dialog_OnShow_ret:
sec sec
ret ret