Add configurable disabled color field to editbox in box_lib #400
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I was going through the box_lib library to understand how widgets are implemented, especially the editbox. While reading editbox.asm, I noticed that in edit_box_draw.bg the disabled background color is hardcoded:
mov edx, 0xCACACA
; TODO: add disabled_color field to editbox struct
There is already a TODO comment in the code suggesting that a disabled color field should be added to the editbox structure.
The disabled state color is hardcoded, which makes it difficult to customize the appearance of editbox widgets in different applications or UI themes.
Improvement :
Adding a new field to the editbox structure like:
ed_disabled_color
and using this field in edit_box_draw.bg instead of the hardcoded value.
Also, a default value (0xCACACA) can be kept to maintain backward compatibility.
Adding field to structure will change it's size.
Wouldn't it break compatibility because of this?
yess changing the structure size could break compatibility with existing applications that already use the editbox.