diff --git a/src/actions/actionZindex.tsx b/src/actions/actionZindex.tsx index 93064e5a..cbbd26ef 100644 --- a/src/actions/actionZindex.tsx +++ b/src/actions/actionZindex.tsx @@ -1,3 +1,4 @@ +import React from "react"; import { Action } from "./types"; import { moveOneLeft, @@ -7,6 +8,98 @@ import { } from "../zindex"; import { getSelectedIndices } from "../scene"; import { KEYS } from "../keys"; +import { t } from "../i18n"; + +const ICONS = { + bringForward: ( + + ), + sendBackward: ( + + ), + bringToFront: ( + + ), + sendToBack: ( + + ), +}; export const actionSendBackward: Action = { name: "sendBackward", @@ -20,6 +113,16 @@ export const actionSendBackward: Action = { keyPriority: 40, commitToHistory: () => true, keyTest: event => event[KEYS.META] && event.altKey && event.key === "B", + PanelComponent: ({ updateData }) => ( + + ), }; export const actionBringForward: Action = { @@ -34,6 +137,16 @@ export const actionBringForward: Action = { keyPriority: 40, commitToHistory: () => true, keyTest: event => event[KEYS.META] && event.altKey && event.key === "F", + PanelComponent: ({ updateData }) => ( + + ), }; export const actionSendToBack: Action = { @@ -47,6 +160,16 @@ export const actionSendToBack: Action = { contextItemLabel: "labels.sendToBack", commitToHistory: () => true, keyTest: event => event[KEYS.META] && event.shiftKey && event.key === "B", + PanelComponent: ({ updateData }) => ( + + ), }; export const actionBringToFront: Action = { @@ -60,4 +183,14 @@ export const actionBringToFront: Action = { commitToHistory: () => true, contextItemLabel: "labels.bringToFront", keyTest: event => event[KEYS.META] && event.shiftKey && event.key === "F", + PanelComponent: ({ updateData }) => ( + + ), }; diff --git a/src/index.tsx b/src/index.tsx index 96e46046..a3f78756 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -275,6 +275,16 @@ const LayerUI = React.memo( {actionManager.renderAction("changeOpacity")} +
+ {actionManager.renderAction("deleteSelectedElements")} diff --git a/src/locales/en.json b/src/locales/en.json index e684bbb8..47c0e94b 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -39,7 +39,8 @@ "fileTitle": "File title", "colorPicker": "Color picker", "canvasBackground": "Canvas background", - "drawingCanvas": "Drawing Canvas" + "drawingCanvas": "Drawing Canvas", + "layers": "Layers" }, "buttons": { "clearReset": "Clear the canvas & reset background color", diff --git a/src/styles.scss b/src/styles.scss index d1f50c12..3e46dc84 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -87,6 +87,7 @@ button, border-radius: 4px; margin: 0.125rem 0; padding: 0.25rem; + white-space: nowrap; cursor: pointer; @@ -248,6 +249,11 @@ button, white-space: nowrap; /* added line */ } +.zIndexButton { + width: 26px; + margin: 0 5px; +} + .scroll-back-to-content { position: fixed; left: 50%;