diff options
| author | bobzel <zzzman@gmail.com> | 2021-03-31 00:53:33 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2021-03-31 00:53:33 -0400 |
| commit | a81ea10f34369f3e36a52badd3a472fa1742cb29 (patch) | |
| tree | 19ae50c4e7379504f74e5f30dd9a446fb9a4e159 /src/client/views/collections/TreeView.tsx | |
| parent | 3172a475102691c720b7e7d0b696814237855914 (diff) | |
trying to cleanup control of displaying linkButtons in tree views.
Diffstat (limited to 'src/client/views/collections/TreeView.tsx')
| -rw-r--r-- | src/client/views/collections/TreeView.tsx | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/client/views/collections/TreeView.tsx b/src/client/views/collections/TreeView.tsx index a4f17296a..af5db3046 100644 --- a/src/client/views/collections/TreeView.tsx +++ b/src/client/views/collections/TreeView.tsx @@ -510,6 +510,7 @@ export class TreeView extends React.Component<TreeViewProps> { {StrCast(doc?.title)} </div>; case StyleProp.Decorations: return (null); + default: return this.props?.treeView?.props.styleProvider?.(doc, props, property); } } embeddedStyleProvider = (doc: (Doc | undefined), props: Opt<DocumentViewProps>, property: string): any => { @@ -535,6 +536,9 @@ export class TreeView extends React.Component<TreeViewProps> { */ @computed get renderTitle() { + if (this.props.document.title === "MARYKAY") { + console.log(); + } TraceMobx(); const view = this._editTitle ? <EditableView key="_editTitle" oneLine={true} @@ -593,11 +597,11 @@ export class TreeView extends React.Component<TreeViewProps> { renderDepth={1} isContentActive={this.props.isContentActive} isDocumentActive={this.props.isContentActive} - focus={returnTrue} + focus={this.refocus} whenChildContentsActiveChanged={this.props.whenChildContentsActiveChanged} bringToFront={emptyFunction} cantBrush={this.props.treeView.props.cantBrush} - dontRegisterView={BoolCast(this.props.treeView.props.Document.childDontRegisterViews)} + dontRegisterView={BoolCast(this.props.treeView.props.Document.childDontRegisterViews, this.props.dontRegisterView)} docFilters={returnEmptyFilter} docRangeFilters={returnEmptyFilter} searchFilterDocs={returnEmptyDoclist} @@ -645,6 +649,9 @@ export class TreeView extends React.Component<TreeViewProps> { } renderEmbeddedDocument = (asText: boolean) => { + if (this.props.document.title === "MARYKAY") { + console.log(); + } const layout = StrCast(Doc.LayoutField(this.layoutDoc)); const isExpandable = layout.includes(FormattedTextBox.name) || layout.includes(SliderBox.name); const panelWidth = asText || isExpandable ? this.rtfWidth : this.expandPanelWidth; @@ -656,19 +663,19 @@ export class TreeView extends React.Component<TreeViewProps> { PanelHeight={panelHeight} NativeWidth={!asText && (this.layoutDoc.type === DocumentType.RTF || this.layoutDoc.type === DocumentType.SLIDER) ? this.rtfWidth : undefined} NativeHeight={!asText && (this.layoutDoc.type === DocumentType.RTF || this.layoutDoc.type === DocumentType.SLIDER) ? this.rtfHeight : undefined} - fitContentsToDoc={returnTrue} + LayoutTemplateString={asText ? FormattedTextBox.LayoutString("text") : undefined} + isContentActive={asText ? this.props.isContentActive : returnFalse} + isDocumentActive={asText ? this.props.isContentActive : returnFalse} + styleProvider={asText ? this.titleStyleProvider : this.embeddedStyleProvider} hideTitle={asText} + fitContentsToDoc={returnTrue} hideDecorationTitle={this.props.treeView.outlineMode} hideResizeHandles={this.props.treeView.outlineMode} - LayoutTemplateString={asText ? FormattedTextBox.LayoutString("text") : undefined} - focus={asText ? this.refocus : returnFalse} - dontRegisterView={asText ? undefined : this.props.dontRegisterView} + focus={this.refocus} + dontRegisterView={BoolCast(this.props.treeView.props.Document.childDontRegisterViews, this.props.dontRegisterView)} ScreenToLocalTransform={this.docTransform} renderDepth={this.props.renderDepth + 1} rootSelected={returnTrue} - isContentActive={asText ? this.props.isContentActive : returnFalse} - isDocumentActive={asText ? this.props.isContentActive : returnFalse} - styleProvider={asText ? this.titleStyleProvider : this.embeddedStyleProvider} layerProvider={returnTrue} docViewPath={this.props.treeView.props.docViewPath} docFilters={returnEmptyFilter} |
