diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2015-04-12 09:03:46 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2015-04-12 09:07:34 +0300 |
commit | f50fed6a6dfc24a52327f9085122e0a530fcc2ae (patch) | |
tree | a4578211f6ad8492814724c8ea1723e9d84962b3 /source/blender/editors/interface/interface_panel.c | |
parent | 17b4f57bf0ec8beb956198654589d49e261b7f97 (diff) |
Reset view after ctrl-clicking a Panel
Using ctrl+LMB to collapse all panels except of the clicked one resulted
in an empty area if done from a view that is scrolled down to some
degree. Resetting the view makes this much better, although it still
doesn't work that well if the area is really small, but I don't think
it's worth over-complicating things here.
"Feature-Request" by @maxon ;)
Diffstat (limited to 'source/blender/editors/interface/interface_panel.c')
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index d165e2719c5..5aee8e18ba0 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -1187,9 +1187,13 @@ static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, in ED_region_tag_redraw(ar); } else { /* collapse */ - if (ctrl) + if (ctrl) { panels_collapse_all(sa, ar, block->panel); + /* reset the view - we don't want to display a view without content */ + UI_view2d_offset(&ar->v2d, 0.0f, 1.0f); + } + if (block->panel->flag & PNL_CLOSED) { block->panel->flag &= ~PNL_CLOSED; /* snap back up so full panel aligns with screen edge */ |