From f6a14196401cfa39f55c5844f8fe4b63d9985274 Mon Sep 17 00:00:00 2001 From: vijay Date: Fri, 29 Nov 2024 15:36:57 +0530 Subject: [PATCH 1/2] updated the instance list icons --- .../InstancesEditor/InstancesList/index.js | 100 ++++++++++-------- 1 file changed, 53 insertions(+), 47 deletions(-) diff --git a/newIDE/app/src/InstancesEditor/InstancesList/index.js b/newIDE/app/src/InstancesEditor/InstancesList/index.js index 1111072aa6f8..c1bbc2243aa3 100644 --- a/newIDE/app/src/InstancesEditor/InstancesList/index.js +++ b/newIDE/app/src/InstancesEditor/InstancesList/index.js @@ -18,6 +18,8 @@ import { toFixedWithoutTrailingZeros } from '../../Utils/Mathematics'; import ErrorBoundary from '../../UI/ErrorBoundary'; import useForceUpdate from '../../Utils/UseForceUpdate'; import { Column, Line } from '../../UI/Grid'; +import LayersIcon from '../../UI/CustomSvgIcons/Layers'; +import RotateZ from '../../UI/CustomSvgIcons/RotateZ'; const gd = global.gd; const minimumWidths = { @@ -149,36 +151,39 @@ class InstancesList extends Component { } }; - _renderLockCell = ({ - rowData: { instance }, - }: { - rowData: RenderedRowInfo, - }) => { - return ( - { - if (instance.isSealed()) { - instance.setSealed(false); - instance.setLocked(false); - return; - } - if (instance.isLocked()) { - instance.setSealed(true); - return; - } - instance.setLocked(true); - }} - > - {instance.isLocked() && instance.isSealed() ? ( - - ) : instance.isLocked() ? ( - - ) : ( - - )} - - ); +_renderLockCell = ({ + rowData: { instance }, +}: { + rowData: RenderedRowInfo, +}) => { + return ( + { + if (instance.isSealed()) { + instance.setSealed(false); + instance.setLocked(false); + return; + } + if (instance.isLocked()) { + instance.setSealed(true); + return; + } + instance.setLocked(true); + }} + > + {instance.isLocked() && instance.isSealed() ? ( + + ) : instance.isLocked() ? ( + + ) : ( + + )} + + ); }; _selectFirstInstance = () => { @@ -291,19 +296,19 @@ class InstancesList extends Component { width={Math.max(width * 0.35, minimumWidths.objectName)} className={'tableColumn'} /> + X} + dataKey="x" width={Math.max( - width * 0.05, + width * 0.1, minimumWidths.numberProperty )} className={'tableColumn'} - cellRenderer={this._renderLockCell} /> X} - dataKey="x" + label={Y} + dataKey="y" width={Math.max( width * 0.1, minimumWidths.numberProperty @@ -311,16 +316,16 @@ class InstancesList extends Component { className={'tableColumn'} /> Y} - dataKey="y" + label={Z Order} + dataKey="zOrder" width={Math.max( width * 0.1, minimumWidths.numberProperty )} className={'tableColumn'} /> - Angle} + } dataKey="angle" width={Math.max( width * 0.1, @@ -329,21 +334,22 @@ class InstancesList extends Component { className={'tableColumn'} /> Layer} + label={} dataKey="layer" - width={Math.max(width * 0.2, minimumWidths.layerName)} + width={Math.max(width * 0.1, minimumWidths.layerName)} className={'tableColumn'} /> - Z Order} - dataKey="zOrder" + - + )} From 9ca8fb45db272998fca5ad68b088f4746bd6fef9 Mon Sep 17 00:00:00 2001 From: vijay Date: Fri, 20 Dec 2024 22:14:05 +0530 Subject: [PATCH 2/2] Added secondary color for the not-locked icon --- .../InstancesEditor/InstancesList/index.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/newIDE/app/src/InstancesEditor/InstancesList/index.js b/newIDE/app/src/InstancesEditor/InstancesList/index.js index c1bbc2243aa3..9b5597dfd674 100644 --- a/newIDE/app/src/InstancesEditor/InstancesList/index.js +++ b/newIDE/app/src/InstancesEditor/InstancesList/index.js @@ -160,7 +160,7 @@ _renderLockCell = ({ { if (instance.isSealed()) { @@ -314,15 +314,6 @@ _renderLockCell = ({ minimumWidths.numberProperty )} className={'tableColumn'} - /> - Z Order} - dataKey="zOrder" - width={Math.max( - width * 0.1, - minimumWidths.numberProperty - )} - className={'tableColumn'} /> } @@ -338,6 +329,15 @@ _renderLockCell = ({ dataKey="layer" width={Math.max(width * 0.1, minimumWidths.layerName)} className={'tableColumn'} + /> + Z Order} + dataKey="zOrder" + width={Math.max( + width * 0.1, + minimumWidths.numberProperty + )} + className={'tableColumn'} />