diff options
author | bobzel <zzzman@gmail.com> | 2019-01-29 21:48:52 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2019-01-29 21:48:52 -0500 |
commit | 02891812b01888aba3eada58d6051a80a79c1a18 (patch) | |
tree | 0fe0d23799211ef46874de771c07e47c401ef686 /src/views/collections/CollectionDockingView.tsx | |
parent | c45dd584af76e1cd6e48fa44f9296228cdceb649 (diff) |
flexLayout fixes, but flexlayout seems hopelessly broken once it gets scaled.
Diffstat (limited to 'src/views/collections/CollectionDockingView.tsx')
-rw-r--r-- | src/views/collections/CollectionDockingView.tsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/views/collections/CollectionDockingView.tsx b/src/views/collections/CollectionDockingView.tsx index cdcdf3bf1..19b212bde 100644 --- a/src/views/collections/CollectionDockingView.tsx +++ b/src/views/collections/CollectionDockingView.tsx @@ -77,6 +77,7 @@ export class CollectionDockingView extends React.Component<CollectionViewProps> } public static BORDER_WIDTH = 2; + public static TAB_HEADER_HEIGHT = 20; @computed public get active(): boolean { @@ -131,7 +132,6 @@ export class CollectionDockingView extends React.Component<CollectionViewProps> if (component === "button") { return <button>{node.getName()}</button>; } - console.log("Gettting " + component); const { fieldKey, Document: Document } = this.props; const value: Document[] = Document.GetFieldValue(fieldKey, ListField, []); if (component === "doc1" && value.length > 0) { @@ -153,8 +153,10 @@ export class CollectionDockingView extends React.Component<CollectionViewProps> const value: Document[] = Document.GetFieldValue(fieldKey, ListField, []); // bcz: not sure why, but I need these to force the flexlayout to update when the collection size changes. - var w = Document.GetFieldValue(KeyStore.Width, NumberField, Number(0)); - var h = Document.GetFieldValue(KeyStore.Height, NumberField, Number(0)); + var s = this.props.ContainingDocumentView!.ScalingToScreenSpace; + var w = Document.GetFieldValue(KeyStore.Width, NumberField, Number(0)) / s; + var h = Document.GetFieldValue(KeyStore.Height, NumberField, Number(0)) / s; + return ( <div className="border" style={{ borderStyle: "solid", @@ -162,8 +164,8 @@ export class CollectionDockingView extends React.Component<CollectionViewProps> }}> <div className="collectiondockingview-container" onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()} ref={this._containerRef} style={{ - width: "100%", - height: `calc(100% - 2*${CollectionDockingView.BORDER_WIDTH}px)`, + width: s > 1 ? "100%" : w - 2 * CollectionDockingView.BORDER_WIDTH, + height: s > 1 ? "100%" : h - 2 * CollectionDockingView.BORDER_WIDTH }} > <FlexLayout.Layout model={this._model} factory={this.factory} /> </div> |