[Bf-blender-cvs] [f50fed6] master: Reset view after ctrl-clicking a Panel
Julian Eisel
noreply at git.blender.org
Sun Apr 12 08:07:52 CEST 2015
Commit: f50fed6a6dfc24a52327f9085122e0a530fcc2ae
Author: Julian Eisel
Date: Sun Apr 12 08:03:46 2015 +0200
Branches: master
https://developer.blender.org/rBf50fed6a6dfc24a52327f9085122e0a530fcc2ae
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 ;)
===================================================================
M source/blender/editors/interface/interface_panel.c
===================================================================
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index d165e27..5aee8e1 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 */
More information about the Bf-blender-cvs
mailing list