cushy icon indicating copy to clipboard operation
cushy copied to clipboard

Draggable splitter widget.

Open hydra opened this issue 1 year ago • 1 comments
trafficstars

I have a requirement where I want to be able to dynamically resize two columns or two rows using a vertical or horizontal (respectively) draggable handle.

In JavaFx this is a SplitPane, details here: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/SplitPane.html

Usage something like this:

"left".into_label()
  .and("right".into_label()")
  .split_vertically()
  ...

Example screenshot from JavaFX

javafx-splitpane-1

Requirements:

  • The width of the splitter needs to be able to be set.
  • A splitter with a width of 0 is valid. Some users might not want visual cues other than the hover-over mouse cursor.
  • The width of the hover-over area needs to be settable (>=1), i.e. the area that allows the splitter to show the 'resize' mouse pointer to allow dragging with the mouse.

Would be nice:

  • Keyboard focusable, and controllable with left/right or up/down cursor keys.

Notes:

  • there are various things that could happen when the container the split pane is in is resized. e.g. resize both sides proportionally or keep the splitter handle at it's fixed position so that either the left or right pane resizes. likely similar to how GridDimension works.

hydra avatar Nov 22 '24 17:11 hydra

I've been wanting this widget recently too. Thank you for writing this up!

ecton avatar Nov 22 '24 17:11 ecton