mirror of
https://github.com/mi57730/a2d.git
synced 2025-02-20 02:29:11 +00:00
Center desktop icons in columns
This commit is contained in:
parent
3a128da01d
commit
287da7395c
@ -2593,6 +2593,7 @@ ramdisk_icon:
|
||||
.byte 6 ; mapwidth
|
||||
.byte 0 ; reserved
|
||||
DEFINE_RECT 1, 0, 38, 11 ; maprect
|
||||
;; TODO: increase border size
|
||||
|
||||
ramdisk_pixels:
|
||||
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111101)
|
||||
|
@ -8693,10 +8693,10 @@ create_icon:
|
||||
jsr get_device_type
|
||||
asl ; * 2
|
||||
tay
|
||||
copy16 device_type_to_icon_offset_table,y, offset_x
|
||||
lda device_type_to_icon_address_table,y
|
||||
ldx device_type_to_icon_address_table+1,y
|
||||
|
||||
|
||||
;; Assign icon bitmap
|
||||
assign: ldy #IconEntry::iconbits
|
||||
sta (icon_ptr),y
|
||||
@ -8712,9 +8712,6 @@ assign: ldy #IconEntry::iconbits
|
||||
sta (icon_ptr),y
|
||||
inc device_num
|
||||
|
||||
;; TODO: Center icon horizontally
|
||||
;; (Currently, left edges are aligned)
|
||||
|
||||
;; Assign icon coordinates
|
||||
;; (Original logic was to assign in order based on
|
||||
;; DEVLST order. This assigns based on Slot/Drive.)
|
||||
@ -8734,6 +8731,10 @@ assign: ldy #IconEntry::iconbits
|
||||
cpy #IconEntry::iconbits
|
||||
bne :-
|
||||
|
||||
;; Center it horizontally
|
||||
ldy #IconEntry::iconx
|
||||
add16in (icon_ptr),y, offset_x, (icon_ptr),y
|
||||
|
||||
;; Assign icon number
|
||||
ldx cached_window_icon_count
|
||||
dex
|
||||
@ -8745,8 +8746,18 @@ assign: ldy #IconEntry::iconbits
|
||||
|
||||
unit_number: .byte 0
|
||||
device_num: .byte 0
|
||||
offset_x: .word 0
|
||||
.endproc
|
||||
|
||||
;;; Table of icon widths (/2) for centering icons
|
||||
;;; TODO: Keep this up to date with icon bitmaps in desktop_aux
|
||||
device_type_to_icon_offset_table:
|
||||
.word (53 - 27) / 2
|
||||
.word (53 - 38) / 2
|
||||
.word (53 - 53) / 2
|
||||
.word (53 - 21) / 2
|
||||
.word (53 - 53) / 2
|
||||
|
||||
;;; ============================================================
|
||||
|
||||
;;; +-------------------------------------------------+
|
||||
|
Loading…
x
Reference in New Issue
Block a user