Page MenuHome

Panel drag-collapse
AbandonedPublic

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

Details

Summary

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

Event Timeline

This is great! :)

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

Gif:

Campbell Barton (campbellbarton) requested changes to this revision.EditedApr 16 2015, 12:05 PM
Campbell Barton (campbellbarton) edited edge metadata.
  • 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.
Julian Eisel (Severin) edited edge metadata.
  • 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
Campbell Barton (campbellbarton) edited edge metadata.

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

source/blender/editors/interface/interface_panel.c
90

This is used, why is it deprecated?

1191

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

This revision now requires changes to proceed.Apr 22 2015, 3:49 PM
source/blender/editors/interface/interface_panel.c
90

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

Julian Eisel (Severin) edited edge metadata.

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

Julian Eisel (Severin) edited edge metadata.

Accidentally removed this before diffing