Panel drag-collapse

Authored by Julian Eisel (Severin) on Apr 12 2015, 9:09 PM.



Panel drag-collapse

Adds a way to quickly open/close multiple panels by holding LMB and dragging over the desired panels

The decision if the panels are opened or closed is made based on the first Panel the user drags over. If it is closed, all panels he drags over are opened (including the first one) if it's opened, they get closed.

Again the basic idea comes from @Manu Järvinen (maxon) :P

Diff Detail

This is great! :)

Why Shift+LMB instead of the simple dragging that is in use in Outliner, for example?


Campbell Barton (campbellbarton) requested changes to this revision.EditedApr 16 2015, 12:05 PM
  • Generally good functionality.
  • Agree with Manu, shift isnt needed.
  • Prefer have this prepared for master, not very happy with multiple UI patches in gooseberry, especially since changes in this area so easily conflict.

This should be done via WM_event_add_ui_handler as with boolean drag toggle. see ui_but_drag_init

Having to store modal flags in the region - drag_collapse_flag, is bad code-smell.

This revision now requires changes to proceed.Apr 16 2015, 12:05 PM
Julian Eisel (Severin) updated this object.
  • Use LMB+Drag instead of Shift+LMB+Drag
  • Use modal handler
  • Get rid of bad code smells ;)
Campbell Barton (campbellbarton) requested changes to this revision.Apr 22 2015, 3:49 PM

Mostly looks good, however its a bit unreliable since you can drag your mouse *over* a panel and skip it by accident - depending on redraw/mouse speed.

Check how I handled this for toggle-drag.ui_drag_toggle_set_xy_xy


This is used, why is it deprecated?


This may call the function 3 times. assign a var first.

This revision now requires changes to proceed.Apr 22 2015, 3:49 PM

Ahh it's used for preview resize... thought it was unused or a 2.4x-leftover

Addressing review points by @Campbell Barton (campbellbarton) (left in uiPanelMouseState stuff even though it isn't needed anymore)

Accidentally removed this before diffing