Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

DashboardLayout with additional API #347

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

alalonde
Copy link

We have a requirement for a Widget that has much of the functionality of a DockPanel but without the concept of tabs and a more granular API. This is my initial stab at such functionality. A DashboardLayout is essentially a DockPanel with the following modifications:

  1. Panel areas do not have a built-in TabBar. It is up to the Widget to define its own "header" and/or drag and drop functionality if desired.
  2. You cannot drop a widget "on top of" another widget since there is no concept of stacked areas within a panel. All other insertion types provided by the DockPanel are supported.
  3. There are a few additional signals to capture more granular events from a DashboardPanel: areaResized which is called when a handle is dragged, widgetRemoved, and layoutRearranged which is fired when a widget is dragged and dropped from one place within the panel to another.
  4. A resizeLayoutArea method allows explicitly setting the relative sizes of a split area. In order to accomplish this, areas within a DashboardPanel are assigned UUIDs at creation.

We will likely need some of this functionality in a DockPanel as well, but this can serve as at least a starting point for discussion of some of the Signals and mutation API methods that would provide much more granular programmatic interactions. There is a great deal of duplicated code between this and the DockPanel which of course is not ideal. I'm up for suggestions on refactoring / extracting common functionality elsewhere.

I included an example implementation in the example-dashboardpanel package demonstrating much of the functionality, including save/restore and drag and drop.

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

Successfully merging this pull request may close these issues.

1 participant