From 063be8fdc03e2fed9d2bec4fc80db6b55fec42c1 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 26 Jun 2013 07:28:55 +0000 Subject: Fix [#35750] list items in properties editor (text colors not following list item theme). Issue goes back since we stopped using LISTROW button to draw item's name (i.e. since we have custom buttons in list items!). This commit: * Adds a new flag to uiBlock, UI_BLOCK_LIST_ITEM, to mark blocks used for each list item. * Adds a new button type, LISTLABEL, which basically behaves exactly as LABEL, but uses wcol_list_item color set. * When uiItemL is called, it checks whether current block has UI_BLOCK_LIST_ITEM set, and if so, switch produced button to LISTLABEL type. * Adds a new helper func, ui_layout_list_set_labels_active, called after the active list item has been "drawn", to set all LISTLABEL buttons as UI_SELECT. Note custom widget_state_label() was removed, in interface_widgets.c, as it did nothing more than default widget_state(). Thanks to Brecht for the review and advices. --- source/blender/editors/include/UI_interface.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/include') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 9c9ab2972b3..b997d0ef6a0 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -125,9 +125,11 @@ typedef struct uiLayout uiLayout; #define UI_BLOCK_POPUP_MEMORY (1 << 12) #define UI_BLOCK_CLIP_EVENTS (1 << 13) /* stop handling mouse events */ -/* XXX This comment is no more valid! */ +/* XXX This comment is no more valid! Maybe it is now bits 14-17? */ /* block->flag bits 12-15 are identical to but->flag bits */ +#define UI_BLOCK_LIST_ITEM (1 << 19) + /* uiPopupBlockHandle->menuretval */ #define UI_RETURN_CANCEL (1 << 0) /* cancel all menus cascading */ #define UI_RETURN_OK (1 << 1) /* choice made */ @@ -251,7 +253,8 @@ typedef enum { VECTORSCOPE = (50 << 9), PROGRESSBAR = (51 << 9), SEARCH_MENU_UNLINK = (52 << 9), - NODESOCKET = (53 << 9) + NODESOCKET = (53 << 9), + LISTLABEL = (54 << 9), } eButType; #define BUTTYPE (63 << 9) -- cgit v1.2.3