[Bf-committers] Proposed patch for bug #35750 Text colors of list items

Bastien Montagne montagne29 at wanadoo.fr
Tue Jun 25 15:37:00 CEST 2013


Hi devs,

Here is a patch that fixes bug #35750 (text color of list items not 
following style set for list items) : http://www.pasteall.org/43485

First of all, it's a rather hackish solution, but I don't think we can 
reach a nice one without a rather involved redesign of that area... :/
Basically, it:
* Marks the uiBlock of each item with the new flag UI_BLOCK_LIST_ITEM.
* Then, when a uiItemL is defined, it checks whether its block has this 
flag, and if so, sets its own but flag. Here comes the worst hack: as 
buttons flags are already full, I abused UI_BUT_COLOR_LOCK (which I 
don't expect to be used for a LABEL).
* In drawing code, widget_state_label checks for UI_BUT_COLOR_LOCK and 
if set, uses colors from wcol_list_item instead of wcol_regular.
* Finally, added a ui_layout_list_set_labels_active utils that will set 
every LABEL but inside given uiLayout as selected/active (UI_SELECT 
flag), called when "drawing" active item.

So, a bit twisty and nasty of a solution, but as far as I can tell, it 
works nice. ;)

Best regards,
Bastien




More information about the Bf-committers mailing list