diff options
author | Hans Goudey <h.goudey@me.com> | 2020-06-21 17:47:37 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-06-21 17:47:37 +0300 |
commit | 0de14fbe78f529edfd7aff151878ceb883006fee (patch) | |
tree | bc6a983ae98a10606c09c1d07018a844b3ba1ef7 /source/blender/editors | |
parent | 3fc5826f7c6c7606a6bc7e01970321c4e5b41751 (diff) |
UI: Fix view reset when toggling subpanel expansion
The view should only reset for the ctrl-click mode that collapses
all other panels.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 924b886f167..ffaeb999df7 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -2051,10 +2051,13 @@ static void ui_handle_panel_header( /* Collapse and expand panels. */ if (ctrl) { - /* Only collapse all for parent panels. */ + /* For parent panels, collapse all other panels or toggle children. */ if (block->panel->type != NULL && block->panel->type->parent == NULL) { if (block->panel->flag & PNL_CLOSED || BLI_listbase_is_empty(&block->panel->children)) { panels_collapse_all(C, 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); } else { const int closed_flag = (align == BUT_HORIZONTAL) ? PNL_CLOSEDX : PNL_CLOSEDY; @@ -2066,9 +2069,6 @@ static void ui_handle_panel_header( block->panel, closed_flag, (first_child->flag & PNL_CLOSED) == 0); block->panel->flag |= closed_flag; } - - /* reset the view - we don't want to display a view without content */ - UI_view2d_offset(®ion->v2d, 0.0f, 1.0f); } } |