diff options
author | Hans Goudey <h.goudey@me.com> | 2020-04-07 19:51:08 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-04-07 19:51:08 +0300 |
commit | 6b5857181390033b06f18d5a4b19e03f2829d51a (patch) | |
tree | aa78a2a52ca7e3112e45f2b1ee747d49bd342336 /source/blender/editors/interface | |
parent | c5ed2eb95e3d75121b93b0271abf6cdec69d5a66 (diff) |
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
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 9 |
1 files changed, 6 insertions, 3 deletions
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) { |