diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-11-21 19:51:29 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-11-21 19:51:29 +0400 |
commit | 904129fd9b11988c5915d940773552d2110f23ab (patch) | |
tree | b66dc8f91980fe72d49c7f130c02441ae2cd5155 /source/blender/editors/interface/interface_handlers.c | |
parent | 254aa8f3a0fbffcbcb886cfaa81b630ae3e9bb78 (diff) |
Squashed commit of the following:
commit b8b7180760b7c57f15b9930c29207febcf5fefb3
Author: Bastien Montagne <montagne29@wanadoo.fr>
Date: Thu Nov 21 16:31:16 2013 +0100
Code cleanup: replace "LISTLABEL" button type by an "UI_BUT_LIST_ITEM" button flag.
Summary:
Rationals:
I) I was never that happy to have a full button type just to set custom colors to labels inside listitems!
II) If we use (as planned) TEX buttons instead of labels to allow listitems click-rename, I'd like to be able to use listitems' theme color here as well, much easier witha flag than adding yet another button type!
Note: related to D8
Reviewers: brecht
Differential Revision: http://developer.blender.org/D25
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 33a054318b6..db53809c7c4 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -301,7 +301,7 @@ void ui_pan_to_scroll(const wmEvent *event, int *type, int *val) static bool ui_but_editable(uiBut *but) { - return ELEM6(but->type, LABEL, LISTLABEL, SEPR, ROUNDBOX, LISTBOX, PROGRESSBAR); + return ELEM5(but->type, LABEL, SEPR, ROUNDBOX, LISTBOX, PROGRESSBAR); } static uiBut *ui_but_prev(uiBut *but) @@ -2097,7 +2097,7 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa uiBut *but; /* label and roundbox can overlap real buttons (backdrops...) */ - if (ELEM5(actbut->type, LABEL, LISTLABEL, SEPR, ROUNDBOX, LISTBOX)) + if (ELEM4(actbut->type, LABEL, SEPR, ROUNDBOX, LISTBOX)) return; for (but = actbut->next; but; but = but->next) { @@ -2125,7 +2125,7 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa uiBut *but; /* label and roundbox can overlap real buttons (backdrops...) */ - if (ELEM5(actbut->type, LABEL, LISTLABEL, SEPR, ROUNDBOX, LISTBOX)) + if (ELEM4(actbut->type, LABEL, SEPR, ROUNDBOX, LISTBOX)) return; for (but = actbut->prev; but; but = but->prev) { @@ -5675,7 +5675,6 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * break; case ROUNDBOX: case LABEL: - case LISTLABEL: case ROW: case LISTROW: case BUT_IMAGE: @@ -5888,7 +5887,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 (ELEM(but->type, LABEL, LISTLABEL) && but->dragpoin == NULL) + if ((but->type == LABEL) && but->dragpoin == NULL) return false; if (ELEM3(but->type, ROUNDBOX, SEPR, LISTBOX)) return false; @@ -7444,7 +7443,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 != LISTLABEL && but->type != SEPR) + if (!ELEM(but->type, LABEL, SEPR)) count++; /* exception for rna layer buts */ |