aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PropertiesButtons.tsx
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2021-03-02 23:35:15 -0500
committerusodhi <61431818+usodhi@users.noreply.github.com>2021-03-02 23:35:15 -0500
commit067377e138254c72ad4cf3609b05d5aab2b71a26 (patch)
tree9ce9b22e585a0e1472eb3216630c2404e8517144 /src/client/views/PropertiesButtons.tsx
parent95451a2eb0871856b946fff8a14ca0c385af5f1b (diff)
parent1b481cd441cc8bb200906b246b43e4bc5dc53b4e (diff)
agh stop merging
Diffstat (limited to 'src/client/views/PropertiesButtons.tsx')
-rw-r--r--src/client/views/PropertiesButtons.tsx38
1 files changed, 33 insertions, 5 deletions
diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx
index 8ad5f3f2b..e418a6f3c 100644
--- a/src/client/views/PropertiesButtons.tsx
+++ b/src/client/views/PropertiesButtons.tsx
@@ -194,12 +194,12 @@ export class PropertiesButtons extends React.Component<{}, {}> {
get lockButton() {
const targetDoc = this.selectedDoc;
return !targetDoc ? (null) : <Tooltip
- title={<div className="dash-tooltip">{`${this.selectedDoc?.lockedPosition ? "Unlock" : "Lock"} Position`}</div>} placement="top">
+ title={<div className="dash-tooltip">{`${this.selectedDoc?._lockedPosition ? "Unlock" : "Lock"} Position`}</div>} placement="top">
<div>
- <div className={`propertiesButtons-linkButton-empty toggle-${targetDoc.lockedPosition ? "on" : "off"}`} onPointerDown={this.onLock} >
+ <div className={`propertiesButtons-linkButton-empty toggle-${targetDoc._lockedPosition ? "on" : "off"}`} onPointerDown={this.onLock} >
<FontAwesomeIcon className="documentdecorations-icon" size="lg"
- color={this.selectedDoc?.lockedPosition ? "black" : "white"}
- icon={this.selectedDoc?.lockedPosition ? "unlock" : "lock"} />
+ color={this.selectedDoc?._lockedPosition ? "black" : "white"}
+ icon={this.selectedDoc?._lockedPosition ? "unlock" : "lock"} />
</div>
<div className="propertiesButtons-title"
>Position </div>
@@ -260,7 +260,10 @@ export class PropertiesButtons extends React.Component<{}, {}> {
@undoBatch
@action
setCaption = () => {
- SelectionManager.Views().forEach(dv => dv.rootDoc._showCaption = dv.rootDoc._showCaption === undefined ? "caption" : undefined);
+ SelectionManager.Views().forEach(dv => {
+ dv.rootDoc._showCaption = dv.rootDoc._showCaption === undefined ? "caption" : undefined;
+ console.log("caption = " + dv.rootDoc._showCaption);
+ });
}
@computed
@@ -427,6 +430,14 @@ export class PropertiesButtons extends React.Component<{}, {}> {
}
@action @undoBatch
+ changeFitWidth = () => {
+ if (this.selectedDoc) {
+ if (SelectionManager.Views().length) SelectionManager.Views().forEach(dv => dv.rootDoc._fitWidth = !dv.rootDoc._fitWidth);
+ else this.selectedDoc._fitWidth = !this.selectedDoc._fitWidth;
+ }
+ }
+
+ @action @undoBatch
changeClusters = () => {
if (this.selectedDoc) {
if (SelectionManager.Views().length) SelectionManager.Views().forEach(dv => dv.rootDoc._useClusters = !dv.rootDoc._useClusters);
@@ -448,6 +459,20 @@ export class PropertiesButtons extends React.Component<{}, {}> {
</Tooltip>;
}
+ @computed
+ get fitWidthButton() {
+ const targetDoc = this.selectedDoc;
+ return !targetDoc ? (null) : <Tooltip
+ title={<><div className="dash-tooltip">{this.selectedDoc?._fitWidth ? "Stop Fitting Width" : "Fit Width"}</div></>} placement="top">
+ <div>
+ <div className={`propertiesButtons-linkButton-empty toggle-${targetDoc._fitWidth ? "on" : "off"}`} onPointerDown={this.changeFitWidth}>
+ <FontAwesomeIcon className="documentdecorations-icon" icon="arrows-alt-h" size="lg" />
+ </div>
+ <div className="propertiesButtons-title"> {this.selectedDoc?._fitWidth ? "unfit" : "fit"} </div>
+ </div>
+ </Tooltip>;
+ }
+
@undoBatch
@action
private makeMask = () => {
@@ -521,6 +546,9 @@ export class PropertiesButtons extends React.Component<{}, {}> {
<div className="propertiesButtons-button" style={{ display: !isFreeForm && !isText ? "none" : "" }}>
{this.fitContentButton}
</div>
+ <div className="propertiesButtons-button">
+ {this.fitWidthButton}
+ </div>
<div className="propertiesButtons-button" style={{ display: !isInk ? "none" : "" }}>
{this.maskButton}
</div>