aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/StyleProvider.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-03-22 14:55:45 -0400
committerbobzel <zzzman@gmail.com>2021-03-22 14:55:45 -0400
commitd8445ef3b2402530b5139b94eeb0f333c1fed661 (patch)
tree3eca8b61462fb4b60e020329c932bf516c256886 /src/client/views/StyleProvider.tsx
parent3c8325a99c4cec82148039d381df8377dcd4ee3a (diff)
adjusted playLink in videos to start 1/4 sec early to trigger following link to anchor. changed text sidebars to show titles. fixed title autoHeight computations in formattedTextBox. fixed styleprovider to compute headerMargin correctly by inquiring style for ShowTitle.
Diffstat (limited to 'src/client/views/StyleProvider.tsx')
-rw-r--r--src/client/views/StyleProvider.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx
index 1ee99817c..617652ab7 100644
--- a/src/client/views/StyleProvider.tsx
+++ b/src/client/views/StyleProvider.tsx
@@ -69,6 +69,7 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<FieldViewProps |
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.DocContents: return undefined;
@@ -88,7 +89,8 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<FieldViewProps |
case StyleProp.Hidden: return BoolCast(doc?._hidden);
case StyleProp.BorderRounding: return StrCast(doc?._borderRounding);
case StyleProp.TitleHeight: return 15;
- case StyleProp.HeaderMargin: return ([CollectionViewType.Stacking, CollectionViewType.Masonry].includes(doc?._viewType as any) || doc?.type === DocumentType.RTF) && doc?._showTitle && !StrCast(doc?.showTitle).includes(":hover") ? 15 : 0;
+ case StyleProp.HeaderMargin: return ([CollectionViewType.Stacking, CollectionViewType.Masonry].includes(doc?._viewType as any) ||
+ doc?.type === DocumentType.RTF) && showTitle() && !StrCast(doc?.showTitle).includes(":hover") ? 15 : 0;
case StyleProp.BackgroundColor: {
if (isAnchor && docProps) return "transparent";
if (isCaption) return "rgba(0,0,0 ,0.4)";