diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-11-09 21:05:07 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-11-09 21:05:07 +0400 |
commit | efa23a47edebb7a459ca2e62ba922a01bff76dbb (patch) | |
tree | 78fbf8dc59c04966b854dd025fb4a54217e6c3e2 | |
parent | 8c256de95999c8d1edbc148028c45b03f01a0398 (diff) |
uiList: fix a bug in computing visual active index (afaict, in case of reordering, was affecting "keep active visible" feature when resizing, and the "active label color" in custom themes).
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 11990a5d052..46cff2fb458 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2855,6 +2855,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co items_shown = dyn_data->items_shown; if (items_shown >= 0) { + bool activei_mapping_pending = true; items_ptr = MEM_mallocN(sizeof(_uilist_item) * items_shown, AT); //printf("%s: items shown: %d.\n", __func__, items_shown); RNA_PROP_BEGIN (dataptr, itemptr, prop) @@ -2875,8 +2876,10 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co items_ptr[ii].org_idx = i; items_ptr[ii].flt_flag = dyn_data->items_filter_flags ? dyn_data->items_filter_flags[i] : 0; - if (activei == i) { + if (activei_mapping_pending && activei == i) { activei = ii; + /* So that we do not map again activei! */ + activei_mapping_pending = false; } # if 0 /* For now, do not alter active element, even if it will be hidden... */ else if (activei < i) { |