aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PropertiesButtons.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/PropertiesButtons.tsx')
-rw-r--r--src/client/views/PropertiesButtons.tsx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx
index dd737dc9d..e3da7ce2a 100644
--- a/src/client/views/PropertiesButtons.tsx
+++ b/src/client/views/PropertiesButtons.tsx
@@ -16,6 +16,8 @@ import { DocumentView } from './nodes/DocumentView';
import './PropertiesButtons.scss';
import React = require("react");
import { Colors } from "./global/globalEnums";
+import { CollectionFreeFormView } from "./collections/collectionFreeForm";
+import { DocumentManager } from "../util/DocumentManager";
const higflyout = require("@hig/flyout");
export const { anchorPoints } = higflyout;
export const Flyout = higflyout.default;
@@ -86,6 +88,14 @@ export class PropertiesButtons extends React.Component<{}, {}> {
@computed get gridButton() {
return this.propertyToggleBtn("Grid", "_backgroundGridShow", on => `Display background grid in collection`, on => "border-all");
}
+ @computed get groupButton() {
+ return this.propertyToggleBtn("Group", "isGroup", on => `Display collection as a Group`, on => "object-group", (dv, doc) => {
+ doc.isGroup = !doc.isGroup;
+ doc.forceActive = doc.isGroup;
+ const dview = dv || DocumentManager.Instance.getFirstDocumentView(doc);
+ (dview?.ComponentView as CollectionFreeFormView)?.updateGroupBounds?.()
+ });
+ }
@computed get snapButton() {
return this.propertyToggleBtn("Snap\xA0Lines", "showSnapLines", on => `Display snapping lines when objects are dragged`, on => "border-all", undefined, true);
}
@@ -219,6 +229,7 @@ export class PropertiesButtons extends React.Component<{}, {}> {
{toggle(this.maskButton, { display: !isInk ? "none" : "" })}
{toggle(this.chromeButton, { display: !isCollection || isNovice ? "none" : "" })}
{toggle(this.gridButton, { display: !isCollection ? "none" : "" })}
+ {toggle(this.groupButton, { display: !isCollection ? "none" : "" })}
{toggle(this.snapButton, { display: !isCollection ? "none" : "" })}
{toggle(this.clustersButton, { display: !isFreeForm ? "none" : "" })}
{toggle(this.panButton, { display: !isFreeForm ? "none" : "" })}