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

Pane grid widget #224

Merged
merged 56 commits into from
Mar 20, 2020
Merged

Pane grid widget #224

merged 56 commits into from
Mar 20, 2020

Conversation

hecrj
Copy link
Member

@hecrj hecrj commented Mar 18, 2020

Pane grid - Iced

This PR introduces a new widget: PaneGrid.

A PaneGrid consists of a collection of panes, which are distributed using either vertical or horizontal splits to completely fill the space available. This distribution of space is common in tiling window managers (like awesome, i3, or even tmux).

The new PaneGrid features:

  • Vertical and horizontal splits
  • Tracking of the last active pane
  • Mouse-based resizing
  • Drag and drop to reorganize panes
  • Hotkey support
  • Configurable modifier keys
  • API to perform actions programmatically (split, swap, resize, etc.)

I believe this widget can be very useful if you want to allow your users to dynamically customize the layout of the application. For instance, it could be used to build a three-pane interface, a dashboard with different kinds of data visualization, etc.

Additionally, I have:

  • Added a couple of new variants to MouseCursor for the new resizing interactions.
  • Moved some reusable keyboard types to iced_core, as we will need them in iced_web soon enough.
  • Implemented Subscription::with, which can be used to move external data into a subscription.

As always, I have created an example (pane_grid) to showcase all the current features of the new widget.

hecrj added 30 commits March 4, 2020 04:10
It's too contrived. I will work on something simpler.
We can use the `split` method directly instead.
@hecrj hecrj added the feature New feature or request label Mar 18, 2020
@hecrj hecrj added this to the 0.1.0 milestone Mar 18, 2020
@hecrj hecrj self-assigned this Mar 18, 2020
@Songtronix
Copy link
Contributor

Holy moly! This is awesome!

core/src/point.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants