This repository was archived by the owner on Nov 6, 2019. It is now read-only.
DashboardLayout with additional API#347
Open
alalonde wants to merge 4 commits intophosphorjs:masterfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have a requirement for a Widget that has much of the functionality of a
DockPanelbut without the concept of tabs and a more granular API. This is my initial stab at such functionality. ADashboardLayoutis essentially aDockPanelwith the following modifications:TabBar. It is up to the Widget to define its own "header" and/or drag and drop functionality if desired.DockPanelare supported.DashboardPanel:areaResizedwhich is called when a handle is dragged,widgetRemoved, andlayoutRearrangedwhich is fired when a widget is dragged and dropped from one place within the panel to another.resizeLayoutAreamethod allows explicitly setting the relative sizes of a split area. In order to accomplish this, areas within aDashboardPanelare assigned UUIDs at creation.We will likely need some of this functionality in a
DockPanelas 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 theDockPanelwhich of course is not ideal. I'm up for suggestions on refactoring / extracting common functionality elsewhere.I included an example implementation in the
example-dashboardpanelpackage demonstrating much of the functionality, including save/restore and drag and drop.