Skip to content

Commit 48de7d5

Browse files
DeskTop: Reduce cursor flickering when computing volume/folder size
Use ShieldCursor to reduce flicker when enumerating/recursing to compute total volume/folder size. This actually shields all uses of DrawDialogLabel but the other cases are probably not noticeable.
1 parent b54bc42 commit 48de7d5

2 files changed

Lines changed: 31 additions & 17 deletions

File tree

RELEASE-NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Project Page: https://github.com/a2stuff/a2d
7272
* Handle write protected disk when modifying shortcuts.
7373
* Fix label/border overlaps in Get Info and Format/Erase dialogs in some locales.
7474
* Reduce cursor flickering when animating windows open/closed.
75+
* File > Get Info: Reduce cursor flickering when computing volume/folder size.
7576

7677
### Selector
7778

src/desktop/main.s

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14202,34 +14202,24 @@ params: .res 3
1420214202
sta row
1420314203
tya
1420414204
and #%11110000 ; A = flags
14205-
beq calc_y ; DDL_LEFT
14206-
14207-
IF A = #DDL_VALUE
14208-
copy16 #kDialogValueLeft, dialog_label_pos::xcoord
14209-
ASSERT_EQUALS .hibyte(::kDialogValueLeft), 0
14210-
beq calc_y
14211-
END_IF
1421214205

1421314206
;; Compute string width
1421414207
pha ; A = flags
1421514208
copy16 ptr, stringptr
1421614209
MGTK_CALL MGTK::StringWidth, stringwidth_params
1421714210
pla ; A = flags
1421814211

14219-
IF A = #DDL_CENTER
14212+
IF A = #DDL_VALUE
14213+
copy16 #kDialogValueLeft, dialog_label_pos::xcoord
14214+
ELSE_IF A = #DDL_CENTER
1422014215
sub16 #kPromptDialogWidth, result, dialog_label_pos::xcoord
1422114216
lsr16 dialog_label_pos::xcoord
14222-
jmp calc_y
14223-
END_IF
14224-
14225-
IF A = #DDL_RIGHT
14217+
ELSE_IF A = #DDL_RIGHT
1422614218
sub16 #kPromptDialogWidth - kDialogLabelDefaultX, result, dialog_label_pos::xcoord
14227-
ELSE
14228-
;; DDL_LRIGHT
14219+
ELSE_IF A = #DDL_LRIGHT
1422914220
sub16 #kDialogLabelRightX, result, dialog_label_pos::xcoord
1423014221
END_IF
1423114222

14232-
calc_y:
1423314223
;; y = base + aux::kDialogLabelHeight * line
1423414224
row := *+1
1423514225
lda #SELF_MODIFIED_BYTE ; low byte
@@ -14239,11 +14229,34 @@ calc_y:
1423914229
addax #aux::kDialogLabelBaseY, dialog_label_pos::ycoord
1424014230
MGTK_CALL MGTK::MoveTo, dialog_label_pos
1424114231
copy16 ptr, @addr
14242-
MGTK_CALL MGTK::DrawString, SELF_MODIFIED, @addr
14232+
14233+
;; Compute shield rect
14234+
lda dialog_label_pos::xcoord
14235+
sta tmp_rect::x1
14236+
clc
14237+
adc result
14238+
sta tmp_rect::x2
14239+
lda dialog_label_pos::xcoord+1
14240+
sta tmp_rect::x1+1
14241+
adc result+1
14242+
sta tmp_rect::x2+1
14243+
14244+
lda dialog_label_pos::ycoord
14245+
sta tmp_rect::y2
14246+
sec
14247+
sbc #<kSystemFontHeight
14248+
sta tmp_rect::y1
14249+
lda dialog_label_pos::ycoord+1
14250+
sta tmp_rect::y2+2
14251+
sbc #>kSystemFontHeight
14252+
sta tmp_rect::y1+1
1424314253

1424414254
;; Restore default X position
1424514255
copy16 #kDialogLabelDefaultX, dialog_label_pos::xcoord
14246-
rts
14256+
14257+
MGTK_CALL MGTK::ShieldCursor, tmp_rect
14258+
MGTK_CALL MGTK::DrawString, SELF_MODIFIED, @addr
14259+
TAIL_CALL UnshieldCursor
1424714260
.endproc ; DrawDialogLabel
1424814261

1424914262
;;; ============================================================

0 commit comments

Comments
 (0)