gui2: fixed problems with layouts

need to look into spread mode, too.
This commit is contained in:
Martin Preuss
2026-03-11 00:32:08 +01:00
parent 282cd738b4
commit 51cedae0cb
10 changed files with 493 additions and 84 deletions

View File

@@ -98,7 +98,7 @@ Layout_SetDefaultHeights_ret:
; Ignores invisible widgets.
;
; @param Y pointer to widget
; @return r19:r18 total width of all child widgets plus space between
; @return r19:r18 total size of all child widgets plus space between
; @clobbers r16, r17, r18, r19, r20, r21, r22, r23, Z
Layout_SumTmpValues:
@@ -119,7 +119,7 @@ Layout_SumTmpValues:
push yl
push yh
bigcall OBJ_GetFirstChild
brcc Layout_SumTmpValues_loopEnd
brcc Layout_SumTmpValues_finish
Layout_SumTmpValues_loop:
mov yl, r18
mov yh, r19
@@ -139,10 +139,11 @@ Layout_SumTmpValues_next:
Layout_SumTmpValues_loopEnd:
mov r16, r20
or r16, r21
breq Layout_SumTmpValues_done
breq Layout_SumTmpValues_finish
sub r20, r22 ; sub last spacing
sbc r21, r22
add r21, r22
Layout_SumTmpValues_finish:
add r20, r23 ; add outer border (begin)
adc r21, r23
sub r21, r23
@@ -251,8 +252,8 @@ LayoutCountVisibleChildren:
push yl
push yh
bigcall OBJ_GetFirstChild
brcc LayoutCountVisibleChildren_done
LayoutCountVisibleChildren_loop:
brcc LayoutCountVisibleChildren_done
mov yl, r18
mov yh, r19
ldd r17, Y+OBJECT_OFFS_FLAGS
@@ -260,7 +261,7 @@ LayoutCountVisibleChildren_loop:
inc r16
LayoutCountVisibleChildren_next:
rcall OBJ_GetNext
rjmp LayoutCountVisibleChildren_loop
brcs LayoutCountVisibleChildren_loop
LayoutCountVisibleChildren_done:
pop yh
pop yl