Add configurable disabled color field to editbox in box_lib #400

Open
opened 2026-03-31 16:14:46 +00:00 by Saditya-raj · 2 comments

mov edx, 0xCACACA ; TODO: add disabled_color field to editbox struct

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.

https://git.kolibrios.org/KolibriOS/kolibrios/src/commit/de6724017de723175c3a561abeaaf75ab293fdb7/programs/develop/libraries/box_lib/trunk/editbox.asm#L782 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.
Owner

Adding field to structure will change it's size.
Wouldn't it break compatibility because of this?

Adding field to structure will change it's size. Wouldn't it break compatibility because of this?
Author

yess changing the structure size could break compatibility with existing applications that already use the editbox.

yess changing the structure size could break compatibility with existing applications that already use the editbox.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KolibriOS/kolibrios#400