aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-04-06 17:59:50 -0400
committerbobzel <zzzman@gmail.com>2021-04-06 17:59:50 -0400
commitd5b1abae714b4bae0f02ce57a91477bdb2502078 (patch)
tree93118a654ad6c8a57a4c6001e163cfdebf25cda3 /src
parentb9d1ec2d3a7b49ad902eea17bb26525429d50dbf (diff)
little cleanup
Diffstat (limited to 'src')
-rw-r--r--src/client/views/EditableView.tsx1
-rw-r--r--src/client/views/StyleProvider.tsx3
-rw-r--r--src/client/views/collections/TreeView.tsx2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx
index 5daac77ee..03d9efff3 100644
--- a/src/client/views/EditableView.tsx
+++ b/src/client/views/EditableView.tsx
@@ -47,7 +47,6 @@ export interface EditableProps {
toggle?: () => void;
background?: string | undefined;
placeholder?: string;
- fullWidth?: boolean; // used in PropertiesView to make the whole key:value input box clickable
}
/**
diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx
index 3853d5888..d15cd5458 100644
--- a/src/client/views/StyleProvider.tsx
+++ b/src/client/views/StyleProvider.tsx
@@ -69,13 +69,14 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<DocumentViewProps
const isCaption = property.includes(":caption");
const isAnchor = property.includes(":anchor");
const isAnnotated = property.includes(":annotated");
+ const isOpen = property.includes(":open");
const isBackground = () => StrListCast(doc?._layerTags).includes(StyleLayers.Background);
const backgroundCol = () => props?.styleProvider?.(doc, props, StyleProp.BackgroundColor);
const opacity = () => props?.styleProvider?.(doc, props, StyleProp.Opacity);
const showTitle = () => props?.styleProvider?.(doc, props, StyleProp.ShowTitle);
switch (property.split(":")[0]) {
- case StyleProp.TreeViewIcon: return doc ? Doc.toIcon(doc) : "question";
+ case StyleProp.TreeViewIcon: return doc?.isFolder ? "chevron-" + (isOpen ? "down" : "right") : doc ? Doc.toIcon(doc) : "question";
case StyleProp.DocContents: return undefined;
case StyleProp.WidgetColor: return isAnnotated ? "lightBlue" : darkScheme() ? "lightgrey" : "dimgrey";
case StyleProp.Opacity: return Cast(doc?._opacity, "number", Cast(doc?.opacity, "number", null));
diff --git a/src/client/views/collections/TreeView.tsx b/src/client/views/collections/TreeView.tsx
index c7322598c..5cf8a6986 100644
--- a/src/client/views/collections/TreeView.tsx
+++ b/src/client/views/collections/TreeView.tsx
@@ -441,7 +441,7 @@ export class TreeView extends React.Component<TreeViewProps> {
@computed get renderBullet() {
TraceMobx();
- const iconType = this.doc.isFolder ? (this.treeViewOpen ? "chevron-down" : "chevron-right") : Doc.toIcon(this.doc);
+ const iconType = this.props.treeView.props.styleProvider?.(this.doc, this.props.treeView.props, StyleProp.TreeViewIcon + (this.treeViewOpen ? ":open" : "")) || "question";
const checked = this.onCheckedClick ? (this.doc.treeViewChecked ?? "unchecked") : undefined;
return <div className={`bullet${this.props.treeView.outlineMode ? "-outline" : ""}`} key={"bullet"}
title={this.childDocs?.length ? `click to see ${this.childDocs?.length} items` : "view fields"}