aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/TabDocView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-11-09 15:46:33 -0500
committerbobzel <zzzman@gmail.com>2022-11-09 15:46:33 -0500
commit51e8786c33a1af207081212802e6da03476edf4a (patch)
tree986c24e6f6f41bf7448c6f9368661a6c4c6cdd0b /src/client/views/collections/TabDocView.tsx
parent13002bb819e54f3e2f2d25c4b043abf1c15386bb (diff)
added tab highlighting when tab doc is target of hyperlink. made region annotations on images be transparent. don't show lock icon for lockedPosition documents that still get pointer events.
Diffstat (limited to 'src/client/views/collections/TabDocView.tsx')
-rw-r--r--src/client/views/collections/TabDocView.tsx17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx
index 31ed5a83b..e0c422f94 100644
--- a/src/client/views/collections/TabDocView.tsx
+++ b/src/client/views/collections/TabDocView.tsx
@@ -55,6 +55,11 @@ export class TabDocView extends React.Component<TabDocViewProps> {
@computed get layoutDoc() {
return this._document && Doc.Layout(this._document);
}
+ @computed get tabBorderColor() {
+ const highlight = DefaultStyleProvider(this._document, undefined, StyleProp.Highlighting);
+ if (highlight?.highlightIndex >= Doc.DocBrushStatus.highlighted) return highlight.highlightColor;
+ return 'transparent';
+ }
@computed get tabColor() {
let tabColor = StrCast(this._document?._backgroundColor, StrCast(this._document?.backgroundColor, DefaultStyleProvider(this._document, undefined, StyleProp.BackgroundColor)));
if (tabColor === 'transparent') return 'black';
@@ -147,17 +152,15 @@ export class TabDocView extends React.Component<TabDocViewProps> {
ReactDOM.createRoot(closeWrap).render(closeIcon);
tab.reactComponents = [iconWrap, closeWrap];
tab.element[0].prepend(iconWrap);
- tab._disposers.layerDisposer = reaction(
- () => ({ layer: tab.DashDoc.activeLayer, color: this.tabColor }),
- ({ layer, color }) => {
- // console.log("TabDocView: " + this.tabColor);
- // console.log("lightOrDark: " + lightOrDark(this.tabColor));
+ tab._disposers.color = reaction(
+ () => ({ color: this.tabColor, borderColor: this.tabBorderColor }),
+ coloring => {
const textColor = lightOrDark(this.tabColor); //not working with StyleProp.Color
titleEle.style.color = textColor;
- titleEle.style.backgroundColor = 'transparent';
+ titleEle.style.backgroundColor = coloring.borderColor;
iconWrap.style.color = textColor;
closeWrap.style.color = textColor;
- tab.element[0].style.background = !layer ? color : 'dimgrey';
+ tab.element[0].style.background = coloring.color;
},
{ fireImmediately: true }
);