From 7f49a7bc990e8a79d1684593d6529e9d19bbe7fd Mon Sep 17 00:00:00 2001 From: charlesh88 Date: Wed, 25 Mar 2020 11:12:54 -0700 Subject: [PATCH] Conditionals fixes and tweaks - Fixes #2772; - Remove styling toolbar icons in Display Layouts; - Fix regression error in tree items that was only allowing clicks on the name to navigate; --- .../displayLayout/DisplayLayoutToolbar.js | 92 +------------------ src/ui/layout/mct-tree.scss | 17 ---- 2 files changed, 3 insertions(+), 106 deletions(-) diff --git a/src/plugins/displayLayout/DisplayLayoutToolbar.js b/src/plugins/displayLayout/DisplayLayoutToolbar.js index ff03d23fe3..c23a34386f 100644 --- a/src/plugins/displayLayout/DisplayLayoutToolbar.js +++ b/src/plugins/displayLayout/DisplayLayoutToolbar.js @@ -347,62 +347,6 @@ define(['lodash'], function (_) { }; } - function getFillMenu(selectedParent, selection) { - return { - control: "color-picker", - domainObject: selectedParent, - applicableSelectedItems: selection.filter(selectionPath => { - let type = selectionPath[0].context.layoutItem.type; - return type === 'text-view' || - type === 'telemetry-view' || - type === 'box-view'; - }), - property: function (selectionPath) { - return getPath(selectionPath) + ".fill"; - }, - icon: "icon-paint-bucket", - title: "Set fill color" - }; - } - - function getStrokeMenu(selectedParent, selection) { - return { - control: "color-picker", - domainObject: selectedParent, - applicableSelectedItems: selection.filter(selectionPath => { - let type = selectionPath[0].context.layoutItem.type; - return type === 'text-view' || - type === 'telemetry-view' || - type === 'box-view' || - type === 'image-view' || - type === 'line-view'; - }), - property: function (selectionPath) { - return getPath(selectionPath) + ".stroke"; - }, - icon: "icon-line-horz", - title: "Set border color" - }; - } - - function getTextColorMenu(selectedParent, selection) { - return { - control: "color-picker", - domainObject: selectedParent, - applicableSelectedItems: selection.filter(selectionPath => { - let type = selectionPath[0].context.layoutItem.type; - return type === 'text-view' || type === 'telemetry-view'; - }), - property: function (selectionPath) { - return getPath(selectionPath) + ".color"; - }, - icon: "icon-font", - mandatory: true, - title: "Set text color", - preventNone: true - }; - } - function getURLButton(selectedParent, selection) { return { control: "button", @@ -429,7 +373,7 @@ define(['lodash'], function (_) { property: function (selectionPath) { return getPath(selectionPath); }, - icon: "icon-gear", + icon: "icon-font", title: "Edit text properties", dialog: DIALOG_FORM.text }; @@ -505,14 +449,14 @@ define(['lodash'], function (_) { let toolbar = { 'add-menu': [], + 'text': [], + 'url': [], 'toggle-frame': [], 'display-mode': [], 'telemetry-value': [], 'style': [], 'text-style': [], 'position': [], - 'text': [], - 'url': [], 'remove': [] }; @@ -546,15 +490,8 @@ define(['lodash'], function (_) { if (toolbar['telemetry-value'].length === 0) { toolbar['telemetry-value'] = [getTelemetryValueMenu(selectionPath, selectedObjects)]; } - if (toolbar.style.length < 2) { - toolbar.style = [ - getFillMenu(selectedParent, selectedObjects), - getStrokeMenu(selectedParent, selectedObjects) - ]; - } if (toolbar['text-style'].length === 0) { toolbar['text-style'] = [ - getTextColorMenu(selectedParent, selectedObjects), getTextSizeMenu(selectedParent, selectedObjects) ]; } @@ -571,15 +508,8 @@ define(['lodash'], function (_) { toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selectedObjects)]; } } else if (layoutItem.type === 'text-view') { - if (toolbar.style.length < 2) { - toolbar.style = [ - getFillMenu(selectedParent, selectedObjects), - getStrokeMenu(selectedParent, selectedObjects) - ]; - } if (toolbar['text-style'].length === 0) { toolbar['text-style'] = [ - getTextColorMenu(selectedParent, selectedObjects), getTextSizeMenu(selectedParent, selectedObjects) ]; } @@ -599,12 +529,6 @@ define(['lodash'], function (_) { toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selectedObjects)]; } } else if (layoutItem.type === 'box-view') { - if (toolbar.style.length < 2) { - toolbar.style = [ - getFillMenu(selectedParent, selectedObjects), - getStrokeMenu(selectedParent, selectedObjects) - ]; - } if (toolbar.position.length === 0) { toolbar.position = [ getStackOrder(selectedParent, selectionPath), @@ -618,11 +542,6 @@ define(['lodash'], function (_) { toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selectedObjects)]; } } else if (layoutItem.type === 'image-view') { - if (toolbar.style.length === 0) { - toolbar.style = [ - getStrokeMenu(selectedParent, selectedObjects) - ]; - } if (toolbar.position.length === 0) { toolbar.position = [ getStackOrder(selectedParent, selectionPath), @@ -639,11 +558,6 @@ define(['lodash'], function (_) { toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selectedObjects)]; } } else if (layoutItem.type === 'line-view') { - if (toolbar.style.length === 0) { - toolbar.style = [ - getStrokeMenu(selectedParent, selectedObjects) - ]; - } if (toolbar.position.length === 0) { toolbar.position = [ getStackOrder(selectedParent, selectionPath), diff --git a/src/ui/layout/mct-tree.scss b/src/ui/layout/mct-tree.scss index cc10905c69..13ddd25617 100644 --- a/src/ui/layout/mct-tree.scss +++ b/src/ui/layout/mct-tree.scss @@ -92,32 +92,15 @@ // Object labels in trees &__label { - // tag that holds type icon and name. - // Draggable element. - /*border-radius: $controlCr; - display: flex; - align-items: center; flex: 1 1 auto; - overflow: hidden; - padding: $aPad; - white-space: nowrap;*/ } &__name { - // @include ellipsize(); - // display: inline; color: $colorItemTreeFg; - // width: 100%; } &__type-icon { - // Type icon. Must be an HTML entity to allow inclusion of alias indicator. - // display: block; - // flex: 0 0 auto; - // font-size: 1.3em; - // margin-right: $interiorMarginSm; color: $colorItemTreeIcon; - // width: $treeTypeIconW; } &.is-alias {