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
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-06-21 17:47:37 +0300
committerHans Goudey <h.goudey@me.com>2020-06-21 17:47:37 +0300
commit0de14fbe78f529edfd7aff151878ceb883006fee (patch)
treebc6a983ae98a10606c09c1d07018a844b3ba1ef7 /source/blender/editors/interface/interface_panel.c
parent3fc5826f7c6c7606a6bc7e01970321c4e5b41751 (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/interface/interface_panel.c')
-rw-r--r--source/blender/editors/interface/interface_panel.c8
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(&region->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(&region->v2d, 0.0f, 1.0f);
}
}