aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/StyleProvider.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-03-17 10:54:30 -0400
committerbobzel <zzzman@gmail.com>2023-03-17 10:54:30 -0400
commitbdccbc7a37216ffc88920ec48f9119a8ada0be60 (patch)
tree9bf89ba599abdf13eb395b1b24c413bda061be53 /src/client/views/StyleProvider.tsx
parent4ecac6f070759e79c254f4a356d02a871ac6abb5 (diff)
cleaned up highlighting styles a bit. fixed stackedTimeline screen to local xf.
Diffstat (limited to 'src/client/views/StyleProvider.tsx')
-rw-r--r--src/client/views/StyleProvider.tsx15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx
index ce764c7bf..dba5d703f 100644
--- a/src/client/views/StyleProvider.tsx
+++ b/src/client/views/StyleProvider.tsx
@@ -112,16 +112,15 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<DocumentViewProps
allSorts[TreeSort.None] = { color: 'darkgray', label: '\u00A0\u00A0\u00A0' };
return allSorts;
case StyleProp.Highlighting:
- if (doc && !doc.noHighlighting) {
- const highlightIndex = Doc.isBrushedHighlightedDegree(doc);
- const highlightColor = ['transparent', 'rgb(68, 118, 247)', 'rgb(68, 118, 247)', 'orange', 'lightBlue'][highlightIndex];
+ if (doc && !doc.disableDocBrushing && !props?.disableDocBrushing) {
+ const selected = SelectionManager.Views().some(dv => dv.rootDoc === doc);
+ const highlightIndex = Doc.isBrushedHighlightedDegree(doc) || (selected ? Doc.DocBrushStatus.selfBrushed : 0);
+ const highlightColor = ['transparent', 'rgb(68, 118, 247)', selected ? 'black' : 'rgb(68, 118, 247)', 'orange', 'lightBlue'][highlightIndex];
const highlightStyle = ['solid', 'dashed', 'solid', 'solid', 'solid'][highlightIndex];
- const excludeTypes = [DocumentType.FONTICON];
- let highlighting = !props?.disableDocBrushing && highlightIndex && !excludeTypes.includes(doc.type as any) && doc._viewType !== CollectionViewType.Linear; // bcz: hack to turn off highlighting onsidebar panel documents. need to flag a document as not highlightable in a more direct way
- if (highlighting && props?.focus !== emptyFunction && StrCast(doc.title) !== '[pres element template]') {
+ if (highlightIndex) {
return {
highlightStyle,
- highlightColor: highlightIndex !== Doc.DocBrushStatus.highlighted && SelectionManager.Views().some(dv => dv.rootDoc === doc) ? 'black' : highlightColor,
+ highlightColor,
highlightIndex,
highlightStroke: doc.type === DocumentType.INK,
};
@@ -218,7 +217,7 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<DocumentViewProps
docColor = docColor || 'transparent';
break;
case DocumentType.LABEL:
- docColor = docColor || (doc.annotationOn !== undefined ? 'rgba(128, 128, 128, 0.18)' : undefined) || (darkScheme() ? Colors.DARK_GRAY : Colors.LIGHT_GRAY);
+ docColor = docColor || (darkScheme() ? Colors.DARK_GRAY : Colors.LIGHT_GRAY);
break;
case DocumentType.BUTTON:
docColor = docColor || (darkScheme() ? Colors.DARK_GRAY : Colors.LIGHT_GRAY);