[Bf-blender-cvs] [6b585718139] master: UI: Don't collapse all panels for subpanels
Hans Goudey
noreply at git.blender.org
Tue Apr 7 18:53:07 CEST 2020
Commit: 6b5857181390033b06f18d5a4b19e03f2829d51a
Author: Hans Goudey
Date: Tue Apr 7 11:51:08 2020 -0500
Branches: master
https://developer.blender.org/rB6b5857181390033b06f18d5a4b19e03f2829d51a
UI: Don't collapse all panels for subpanels
The behavior for subpanels was incorrect, and the ideal behavior isn't even clear.
This disables the "collapse all" ctrl click feature for panels that have parents.
Differential Revision: https://developer.blender.org/D7355
===================================================================
M source/blender/editors/interface/interface_panel.c
===================================================================
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index da0e8f34417..d1c61925d40 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1574,10 +1574,13 @@ static void ui_handle_panel_header(
}
else { /* collapse */
if (ctrl) {
- panels_collapse_all(area, region, block->panel);
+ /* Only collapse all for parent panels. */
+ if (block->panel->type != NULL && block->panel->type->parent == NULL) {
+ panels_collapse_all(area, region, block->panel);
- /* reset the view - we don't want to display a view without content */
- UI_view2d_offset(®ion->v2d, 0.0f, 1.0f);
+ /* reset the view - we don't want to display a view without content */
+ UI_view2d_offset(®ion->v2d, 0.0f, 1.0f);
+ }
}
if (block->panel->flag & PNL_CLOSED) {
More information about the Bf-blender-cvs
mailing list