Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-04-07 19:51:08 +0300
committerHans Goudey <h.goudey@me.com>2020-04-07 19:51:08 +0300
commit6b5857181390033b06f18d5a4b19e03f2829d51a (patch)
treeaa78a2a52ca7e3112e45f2b1ee747d49bd342336 /source
parentc5ed2eb95e3d75121b93b0271abf6cdec69d5a66 (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')
-rw-r--r--source/blender/editors/interface/interface_panel.c9
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(&region->v2d, 0.0f, 1.0f);
+ /* reset the view - we don't want to display a view without content */
+ UI_view2d_offset(&region->v2d, 0.0f, 1.0f);
+ }
}
if (block->panel->flag & PNL_CLOSED) {