Commit: 13a4bccdb196770b4f357c2a3c312bd4629ecb36
Author: Julian Eisel
Date:   Mon Sep 20 22:01:28 2021 +0200
Branches: master
https://developer.blender.org/rB13a4bccdb196770b4f357c2a3c312bd4629ecb36

Asset Browser: Redraw sidebars on mode switches

There may be mode specific panels for some assets in the navigation or
the asset metadata sidebar. For example the pose library will likely do
this. So let the regions redraw on mode changes.

===================================================================

M       source/blender/editors/space_file/space_file.c

===================================================================

diff --git a/source/blender/editors/space_file/space_file.c 
b/source/blender/editors/space_file/space_file.c
index a4f36c2a6ee..42a9c4aa2d5 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -738,8 +738,18 @@ static void file_tools_region_draw(const bContext *C, 
ARegion *region)
   ED_region_panels(C, region);
 }
 
-static void file_tools_region_listener(const wmRegionListenerParams 
*UNUSED(listener_params))
+static void file_tools_region_listener(const wmRegionListenerParams 
*listener_params)
 {
+  const wmNotifier *wmn = listener_params->notifier;
+  ARegion *region = listener_params->region;
+
+  switch (wmn->category) {
+    case NC_SCENE:
+      if (ELEM(wmn->data, ND_MODE)) {
+        ED_region_tag_redraw(region);
+      }
+      break;
+  }
 }
 
 static void file_tool_props_region_listener(const wmRegionListenerParams 
*listener_params)
@@ -754,6 +764,11 @@ static void file_tool_props_region_listener(const 
wmRegionListenerParams *listen
         ED_region_tag_redraw(region);
       }
       break;
+    case NC_SCENE:
+      if (ELEM(wmn->data, ND_MODE)) {
+        ED_region_tag_redraw(region);
+      }
+      break;
   }
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to