Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2013-06-26 11:28:55 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-06-26 11:28:55 +0400
commit063be8fdc03e2fed9d2bec4fc80db6b55fec42c1 (patch)
treefb830bcb53fd5a6575c66d9b598038de98dbbd98 /source/blender/editors/interface/interface_handlers.c
parentc0c9f5386bac539e3824a5a97bd2243484598594 (diff)
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.
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r--source/blender/editors/interface/interface_handlers.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 7aee228ddaa..d86f22df4a7 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -276,7 +276,7 @@ void ui_pan_to_scroll(const wmEvent *event, int *type, int *val)
static bool ui_but_editable(uiBut *but)
{
- return ELEM5(but->type, LABEL, SEPR, ROUNDBOX, LISTBOX, PROGRESSBAR);
+ return ELEM6(but->type, LABEL, LISTLABEL, SEPR, ROUNDBOX, LISTBOX, PROGRESSBAR);
}
static uiBut *ui_but_prev(uiBut *but)
@@ -2010,7 +2010,7 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
uiBut *but;
/* label and roundbox can overlap real buttons (backdrops...) */
- if (ELEM4(actbut->type, LABEL, SEPR, ROUNDBOX, LISTBOX))
+ if (ELEM5(actbut->type, LABEL, LISTLABEL, SEPR, ROUNDBOX, LISTBOX))
return;
for (but = actbut->next; but; but = but->next) {
@@ -2038,7 +2038,7 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
uiBut *but;
/* label and roundbox can overlap real buttons (backdrops...) */
- if (ELEM4(actbut->type, LABEL, SEPR, ROUNDBOX, LISTBOX))
+ if (ELEM5(actbut->type, LABEL, LISTLABEL, SEPR, ROUNDBOX, LISTBOX))
return;
for (but = actbut->prev; but; but = but->prev) {
@@ -5361,6 +5361,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
case ROUNDBOX:
case LISTBOX:
case LABEL:
+ case LISTLABEL:
case ROW:
case LISTROW:
case BUT_IMAGE:
@@ -5558,7 +5559,7 @@ static bool ui_mouse_inside_button(ARegion *ar, uiBut *but, int x, int y)
bool ui_is_but_interactive(uiBut *but)
{
/* note, LABEL is included for highlights, this allows drags */
- if (but->type == LABEL && but->dragpoin == NULL)
+ if (ELEM(but->type, LABEL, LISTLABEL) && but->dragpoin == NULL)
return false;
if (ELEM3(but->type, ROUNDBOX, SEPR, LISTBOX))
return false;
@@ -6995,7 +6996,7 @@ static int ui_handle_menu_event(bContext *C, const wmEvent *event, uiPopupBlockH
for (but = block->buttons.first; but; but = but->next) {
int doit = FALSE;
- if (but->type != LABEL && but->type != SEPR)
+ if (but->type != LABEL && but->type != LISTLABEL && but->type != SEPR)
count++;
/* exception for rna layer buts */