aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/LightboxView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-09-20 13:20:53 -0400
committerbobzel <zzzman@gmail.com>2023-09-20 13:20:53 -0400
commit34f3bab0f4d55b2f55f38e451bfd024994ecff42 (patch)
tree8ff20e76983bfd9150e6fca5619c27b21aa0d1ba /src/client/views/LightboxView.tsx
parentb6920e6ffc50eb46f3ac3657c9d5b4fe45e1dd0a (diff)
added carousel3D to novice and fixed it's button positions and its focus so that it works with trails. added dragging documents within single collection for rearranging order of docs in a tab collection. fixed freeform views set to fitWidth to show decorations properly. turned off scaling of tree views. updated lightbox buttons. fixed tooltips on properties toggles.
Diffstat (limited to 'src/client/views/LightboxView.tsx')
-rw-r--r--src/client/views/LightboxView.tsx106
1 files changed, 66 insertions, 40 deletions
diff --git a/src/client/views/LightboxView.tsx b/src/client/views/LightboxView.tsx
index 8f081b321..93eaec959 100644
--- a/src/client/views/LightboxView.tsx
+++ b/src/client/views/LightboxView.tsx
@@ -1,15 +1,17 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { Toggle, ToggleType, Type } from 'browndash-components';
import { action, computed, observable } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
import { Doc, DocListCast, Opt } from '../../fields/Doc';
import { InkTool } from '../../fields/InkField';
-import { Cast, NumCast, StrCast } from '../../fields/Types';
+import { BoolCast, Cast, NumCast, StrCast } from '../../fields/Types';
import { emptyFunction, returnEmptyDoclist, returnEmptyFilter, returnTrue } from '../../Utils';
import { DocUtils } from '../documents/Documents';
import { DocumentManager } from '../util/DocumentManager';
import { LinkManager } from '../util/LinkManager';
import { SelectionManager } from '../util/SelectionManager';
+import { SettingsManager } from '../util/SettingsManager';
import { Transform } from '../util/Transform';
import { CollectionDockingView } from './collections/CollectionDockingView';
import { CollectionStackedTimeline } from './collections/CollectionStackedTimeline';
@@ -118,7 +120,7 @@ export class LightboxView extends React.Component<LightboxViewProps> {
width: bottom !== undefined ? undefined : Math.min(this.props.PanelWidth / 4, this.props.maxBorder[0]),
bottom,
}}>
- <div className="lightboxView-navBtn" title={color} style={{ top, color: color ? 'red' : 'white', background: color ? 'white' : undefined }} onClick={click}>
+ <div className="lightboxView-navBtn" title={color} style={{ top, color: SettingsManager.userColor, background: undefined }} onClick={click}>
<div style={{ height: 10 }}>{color}</div>
<FontAwesomeIcon icon={icon as any} size="3x" />
</div>
@@ -229,6 +231,7 @@ export class LightboxView extends React.Component<LightboxViewProps> {
downx = e.clientX;
downy = e.clientY;
}}
+ style={{ background: SettingsManager.userBackgroundColor }}
onClick={e => {
if (Math.abs(downx - e.clientX) < 4 && Math.abs(downy - e.clientY) < 4) {
LightboxView.SetLightboxDoc(undefined);
@@ -242,6 +245,8 @@ export class LightboxView extends React.Component<LightboxViewProps> {
width: this.lightboxWidth(),
height: this.lightboxHeight(),
clipPath: `path('${Doc.UserDoc().renderStyle === 'comic' ? wavyBorderPath(this.lightboxWidth(), this.lightboxHeight()) : undefined}')`,
+ background: SettingsManager.userBackgroundColor,
+ color: SettingsManager.userColor,
}}>
{/* <CollectionMenu /> TODO:glr This is where it would go*/}
@@ -299,47 +304,68 @@ export class LightboxView extends React.Component<LightboxViewProps> {
this.future()?.length.toString()
)}
<LightboxTourBtn navBtn={this.navBtn} future={this.future} stepInto={this.stepInto} />
- <div
- className="lightboxView-navBtn"
- title="toggle fit width"
- onClick={e => {
- e.stopPropagation();
- LightboxView.LightboxDoc!._layout_fitWidth = !LightboxView.LightboxDoc!._layout_fitWidth;
- }}>
- <FontAwesomeIcon icon={LightboxView.LightboxDoc?._layout_fitWidth ? 'arrows-alt-h' : 'arrows-alt-v'} size="2x" />
+ <div className="lightboxView-navBtn">
+ <Toggle
+ tooltip="toggle reading view"
+ color={SettingsManager.userColor}
+ background={BoolCast(LightboxView.LightboxDoc!._layout_fitWidth) ? SettingsManager.userVariantColor : SettingsManager.userBackgroundColor}
+ toggleType={ToggleType.BUTTON}
+ type={Type.TERT}
+ toggleStatus={BoolCast(LightboxView.LightboxDoc!._layout_fitWidth)}
+ onClick={e => {
+ e.stopPropagation();
+ LightboxView.LightboxDoc!._layout_fitWidth = !LightboxView.LightboxDoc!._layout_fitWidth;
+ }}
+ icon={<FontAwesomeIcon icon={LightboxView.LightboxDoc?._layout_fitWidth ? 'book-open' : 'book'} size="sm" />}
+ />
</div>
- <div
- className="lightboxView-tabBtn"
- title="open in tab"
- onClick={e => {
- const lightdoc = LightboxView._docTarget || LightboxView._doc!;
- e.stopPropagation();
- Doc.RemoveDocFromList(Doc.MyRecentlyClosed, 'data', lightdoc);
- CollectionDockingView.AddSplit(lightdoc, OpenWhereMod.none);
- SelectionManager.DeselectAll();
- LightboxView.SetLightboxDoc(undefined);
- }}>
- <FontAwesomeIcon icon={'file-download'} size="2x" />
+ <div className="lightboxView-tabBtn">
+ <Toggle
+ tooltip="open document in a tab"
+ color={SettingsManager.userColor}
+ background={SettingsManager.userBackgroundColor}
+ toggleType={ToggleType.BUTTON}
+ type={Type.TERT}
+ icon={<FontAwesomeIcon icon="file-download" size="sm" />}
+ onClick={e => {
+ const lightdoc = LightboxView._docTarget || LightboxView._doc!;
+ e.stopPropagation();
+ Doc.RemoveDocFromList(Doc.MyRecentlyClosed, 'data', lightdoc);
+ CollectionDockingView.AddSplit(lightdoc, OpenWhereMod.none);
+ SelectionManager.DeselectAll();
+ LightboxView.SetLightboxDoc(undefined);
+ }}
+ />
</div>
- <div
- className="lightboxView-penBtn"
- title="toggle pen annotation"
- style={{ background: Doc.ActiveTool === InkTool.Pen ? 'white' : undefined }}
- onClick={e => {
- e.stopPropagation();
- Doc.ActiveTool = Doc.ActiveTool === InkTool.Pen ? InkTool.None : InkTool.Pen;
- }}>
- <FontAwesomeIcon color={Doc.ActiveTool === InkTool.Pen ? 'black' : 'white'} icon={'pen'} size="2x" />
+ <div className="lightboxView-penBtn">
+ <Toggle
+ tooltip="toggle pen annotation"
+ color={SettingsManager.userColor}
+ background={Doc.ActiveTool === InkTool.Pen ? SettingsManager.userVariantColor : SettingsManager.userBackgroundColor}
+ toggleType={ToggleType.BUTTON}
+ toggleStatus={Doc.ActiveTool === InkTool.Pen}
+ type={Type.TERT}
+ icon={<FontAwesomeIcon icon="pen" size="sm" />}
+ onClick={e => {
+ e.stopPropagation();
+ Doc.ActiveTool = Doc.ActiveTool === InkTool.Pen ? InkTool.None : InkTool.Pen;
+ }}
+ />
</div>
- <div
- className="lightboxView-exploreBtn"
- title="toggle explore mode to navigate among documents only"
- style={{ background: DocumentView.ExploreMode ? 'white' : undefined }}
- onClick={action(e => {
- e.stopPropagation();
- DocumentView.ExploreMode = !DocumentView.ExploreMode;
- })}>
- <FontAwesomeIcon color={DocumentView.ExploreMode ? 'black' : 'white'} icon={'globe-americas'} size="2x" />
+ <div className="lightboxView-exploreBtn">
+ <Toggle
+ tooltip="toggle explore mode to navigate among documents only"
+ color={SettingsManager.userColor}
+ background={DocumentView.ExploreMode ? SettingsManager.userVariantColor : SettingsManager.userBackgroundColor}
+ toggleType={ToggleType.BUTTON}
+ type={Type.TERT}
+ toggleStatus={DocumentView.ExploreMode}
+ icon={<FontAwesomeIcon icon="globe-americas" size="sm" />}
+ onClick={action(e => {
+ e.stopPropagation();
+ DocumentView.ExploreMode = !DocumentView.ExploreMode;
+ })}
+ />
</div>
</div>
);