diff options
author | Julian Eisel <julian@blender.org> | 2021-01-21 23:40:25 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-01-22 00:23:43 +0300 |
commit | ca475479eb26b4798857b4e67f03eea89324da4b (patch) | |
tree | 029cf44f54840f526b5fb85f5f073280d10f24d9 /source/blender/editors/space_file/space_file.c | |
parent | 41982af6a0fc8e11cf004a356f97222d7eb72c02 (diff) |
Fix Asset Browser showing old name after renaming data-block
The "Current File" asset library didn't get refreshed after the data-block name
changed. But rather than entirely refreshing the file list, or doing possibly
problematic partial refreshes, reference the data-block name directly, so a
simple redraw gets the new name displayed.
Addresses T83751
Diffstat (limited to 'source/blender/editors/space_file/space_file.c')
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 193b141d528..9fe380e382f 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -463,6 +463,12 @@ static void file_main_region_listener(const wmRegionListenerParams *params) break; } break; + case NC_ID: + if (ELEM(wmn->action, NA_RENAME)) { + /* In case the filelist shows ID names. */ + ED_region_tag_redraw(region); + } + break; } } @@ -650,6 +656,21 @@ static void file_tools_region_listener(const wmRegionListenerParams *UNUSED(para { } +static void file_tool_props_region_listener(const wmRegionListenerParams *params) +{ + const wmNotifier *wmn = params->notifier; + ARegion *region = params->region; + + switch (wmn->category) { + case NC_ID: + if (ELEM(wmn->action, NA_RENAME)) { + /* In case the filelist shows ID names. */ + ED_region_tag_redraw(region); + } + break; + } +} + /* add handlers, stuff you only do once or on area/region changes */ static void file_header_region_init(wmWindowManager *wm, ARegion *region) { @@ -916,7 +937,7 @@ void ED_spacetype_file(void) art->prefsizex = 240; art->prefsizey = 60; art->keymapflag = ED_KEYMAP_UI; - art->listener = file_tools_region_listener; + art->listener = file_tool_props_region_listener; art->init = file_tools_region_init; art->draw = file_tools_region_draw; BLI_addhead(&st->regiontypes, art); |