Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draggable splitter widget. #217

Open
hydra opened this issue Nov 22, 2024 · 1 comment
Open

Draggable splitter widget. #217

hydra opened this issue Nov 22, 2024 · 1 comment

Comments

@hydra
Copy link
Contributor

hydra commented Nov 22, 2024

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 then the mouse.
  • 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.
@ecton
Copy link
Member

ecton commented Nov 22, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants