From 075d4deecb0cb791c7ae3ebe1b292623eae835ca Mon Sep 17 00:00:00 2001 From: Charles Hacskaylo Date: Fri, 25 Jan 2019 12:50:16 -0800 Subject: [PATCH] R&I Misc UI 4b (#2271) * Styling for selects - New cleaner styling approach; - New cSelect and appearanceNone mixins; - Converted selects in Notebook, plot-options-edit; * List View fixes - Ellipsizing now works; - Better icon and text alignment; * Remove updateDrilledIn function and calls * Telemetry Table editing styles - Headers now have hover effects; * Change 'toggle'-style toolbar buttons to reflect current state, rather than what will be the setting once clicked - When frame is hidden, button displays the frame-hidden icon, and tooltip says 'Frame hidden'; * Enable all sub-object views in Display Layout to use numeric inputs for x, y, width and height * Toolbar sanding and polishing - Button order tweaked to place stack order near X, Y, etc. inputs; - Improved spacing between items themselves and separators; * Fix indentation * Fix indentation part deux --- .../displayLayout/DisplayLayoutToolbar.js | 259 +++++++++--------- .../components/DisplayLayout.vue | 11 - src/plugins/flexibleLayout/toolbarProvider.js | 16 +- .../folderView/components/ListItem.vue | 17 +- .../folderView/components/ListView.vue | 5 +- .../notebook/res/templates/notebook.html | 26 +- .../plot/res/templates/plot-options-edit.html | 60 ++-- .../telemetryTable/components/table.vue | 20 +- src/styles-new/_constants-espresso.scss | 17 +- src/styles-new/_constants-maelstrom.scss | 4 + src/styles-new/_constants-snow.scss | 16 +- src/styles-new/_controls.scss | 17 +- src/styles-new/_mixins.scss | 31 ++- 13 files changed, 263 insertions(+), 236 deletions(-) diff --git a/src/plugins/displayLayout/DisplayLayoutToolbar.js b/src/plugins/displayLayout/DisplayLayoutToolbar.js index c7f3759c35..ded2cf91ee 100644 --- a/src/plugins/displayLayout/DisplayLayoutToolbar.js +++ b/src/plugins/displayLayout/DisplayLayoutToolbar.js @@ -32,7 +32,7 @@ define([], function () { // is inside a layout, or the main layout is selected. return (openmct.editor.isEditing() && selection && ((selection[1] && selection[1].context.item && selection[1].context.item.type === 'layout') || - (selection[0].context.item && selection[0].context.item.type === 'layout'))); + (selection[0].context.item && selection[0].context.item.type === 'layout'))); }, toolbar: function (selection) { const DIALOG_FORM = { @@ -196,24 +196,62 @@ define([], function () { options: [ { value: false, - icon: "icon-grid-snap-no", - title: "Do not snap to grid" + icon: "icon-grid-snap-to", + title: "Grid snapping enabled" }, { value: true, - icon: "icon-grid-snap-to", - title: "Snap to grid" + icon: "icon-grid-snap-no", + title: "Grid snapping disabled" } ] }; + let x = { + control: "input", + type: "number", + domainObject: selectedParent, + property: function () { + return getPath() + ".x"; + }, + label: "X:", + title: "X position" + }, + y = { + control: "input", + type: "number", + domainObject: selectedParent, + property: function () { + return getPath() + ".y"; + }, + label: "Y:", + title: "Y position", + }, + width = { + control: 'input', + type: 'number', + domainObject: selectedParent, + property: function () { + return getPath() + ".width"; + }, + label: 'W:', + title: 'Resize object width' + }, + height = { + control: 'input', + type: 'number', + domainObject: selectedParent, + property: function () { + return getPath() + ".height"; + }, + label: 'H:', + title: 'Resize object height' + }; if (layoutItem.type === 'subobject-view') { if (toolbar.length > 0) { toolbar.push(separator); } - toolbar.push(stackOrder); - toolbar.push(separator); toolbar.push({ control: "toggle-button", domainObject: selectedParent, @@ -223,154 +261,119 @@ define([], function () { options: [ { value: false, - icon: 'icon-frame-hide', - title: "Hide frame" + icon: 'icon-frame-show', + title: "Frame visible" }, { value: true, - icon: 'icon-frame-show', - title: "Show frame" + icon: 'icon-frame-hide', + title: "Frame hidden" } ] }); toolbar.push(separator); + toolbar.push(stackOrder); + toolbar.push(x); + toolbar.push(y); + toolbar.push(width); + toolbar.push(height); toolbar.push(useGrid); toolbar.push(separator); toolbar.push(remove); } else { - const TEXT_SIZE = [9, 10, 11, 12, 13, 14, 15, 16, 20, 24, 30, 36, 48, 72, 96]; + const TEXT_SIZE = [8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 24, 30, 36, 48, 72, 96, 128]; let fill = { - control: "color-picker", - domainObject: selectedParent, - property: function () { - return getPath() + ".fill"; - }, - icon: "icon-paint-bucket", - title: "Set fill color" + control: "color-picker", + domainObject: selectedParent, + property: function () { + return getPath() + ".fill"; }, - stroke = { - control: "color-picker", - domainObject: selectedParent, - property: function () { - return getPath() + ".stroke"; - }, - icon: "icon-line-horz", - title: "Set border color" + icon: "icon-paint-bucket", + title: "Set fill color" + }, + stroke = { + control: "color-picker", + domainObject: selectedParent, + property: function () { + return getPath() + ".stroke"; }, - color = { - control: "color-picker", - domainObject: selectedParent, - property: function () { - return getPath() + ".color"; - }, - icon: "icon-font", - mandatory: true, - title: "Set text color", - preventNone: true + icon: "icon-line-horz", + title: "Set border color" + }, + color = { + control: "color-picker", + domainObject: selectedParent, + property: function () { + return getPath() + ".color"; }, - size = { - control: "select-menu", - domainObject: selectedParent, - property: function () { - return getPath() + ".size"; - }, - title: "Set text size", - options: TEXT_SIZE.map(size => { - return { - value: size + "px" - }; - }) + icon: "icon-font", + mandatory: true, + title: "Set text color", + preventNone: true + }, + size = { + control: "select-menu", + domainObject: selectedParent, + property: function () { + return getPath() + ".size"; }, - x = { - control: "input", - type: "number", - domainObject: selectedParent, - property: function () { - return getPath() + ".x"; - }, - label: "X:", - title: "X position" - }, - y = { - control: "input", - type: "number", - domainObject: selectedParent, - property: function () { - return getPath() + ".y"; - }, - label: "Y:", - title: "Y position", - }, - width = { - control: 'input', - type: 'number', - domainObject: selectedParent, - property: function () { - return getPath() + ".width"; - }, - label: 'W:', - title: 'Resize object width' - }, - height = { - control: 'input', - type: 'number', - domainObject: selectedParent, - property: function () { - return getPath() + ".height"; - }, - label: 'H:', - title: 'Resize object height' - }; + title: "Set text size", + options: TEXT_SIZE.map(size => { + return { + value: size + "px" + }; + }) + }; if (layoutItem.type === 'telemetry-view') { let displayMode = { - control: "select-menu", - domainObject: selectedParent, - property: function () { - return getPath() + ".displayMode"; - }, - title: "Set display mode", - options: [ - { - name: 'Label + Value', - value: 'all' - }, - { - name: "Label only", - value: "label" - }, - { - name: "Value only", - value: "value" - } - ] + control: "select-menu", + domainObject: selectedParent, + property: function () { + return getPath() + ".displayMode"; }, - value = { - control: "select-menu", - domainObject: selectedParent, - property: function () { - return getPath() + ".value"; + title: "Set display mode", + options: [ + { + name: 'Label + Value', + value: 'all' }, - title: "Set value", - options: openmct.telemetry.getMetadata(selectedObject).values().map(value => { - return { - name: value.name, - value: value.key - } - }) - }; + { + name: "Label only", + value: "label" + }, + { + name: "Value only", + value: "value" + } + ] + }, + value = { + control: "select-menu", + domainObject: selectedParent, + property: function () { + return getPath() + ".value"; + }, + title: "Set value", + options: openmct.telemetry.getMetadata(selectedObject).values().map(value => { + return { + name: value.name, + value: value.key + } + }) + }; toolbar = [ displayMode, separator, value, separator, - stackOrder, fill, stroke, color, separator, size, separator, + stackOrder, x, y, height, @@ -379,7 +382,7 @@ define([], function () { separator, remove ]; - } else if (layoutItem.type === 'text-view' ) { + } else if (layoutItem.type === 'text-view') { let text = { control: "button", domainObject: selectedParent, @@ -391,13 +394,13 @@ define([], function () { dialog: DIALOG_FORM['text'] }; toolbar = [ - stackOrder, fill, stroke, separator, color, size, separator, + stackOrder, x, y, height, @@ -410,10 +413,10 @@ define([], function () { ]; } else if (layoutItem.type === 'box-view') { toolbar = [ - stackOrder, fill, stroke, separator, + stackOrder, x, y, height, @@ -434,9 +437,9 @@ define([], function () { dialog: DIALOG_FORM['image'] }; toolbar = [ - stackOrder, stroke, separator, + stackOrder, x, y, height, @@ -469,9 +472,9 @@ define([], function () { title: "Y2 position", }; toolbar = [ - stackOrder, stroke, separator, + stackOrder, x, y, x2, diff --git a/src/plugins/displayLayout/components/DisplayLayout.vue b/src/plugins/displayLayout/components/DisplayLayout.vue index ac1e1aa875..0305464d83 100644 --- a/src/plugins/displayLayout/components/DisplayLayout.vue +++ b/src/plugins/displayLayout/components/DisplayLayout.vue @@ -171,8 +171,6 @@ if (itemIndex !== undefined) { this.attachSelectionListener(itemIndex); } - - this.updateDrilledIn(); }, attachSelectionListener(index) { let path = `configuration.items[${index}].useGrid`; @@ -208,15 +206,6 @@ this.mutate(`configuration.items[${index}]`, item); }.bind(this)); }, - updateDrilledIn(drilledInItem) { - let identifier = drilledInItem && this.openmct.objects.makeKeyString(drilledInItem.identifier); - this.drilledIn = identifier; - this.layoutItems.forEach(item => { - if (item.type === 'subobject-view') { - item.drilledIn = this.openmct.objects.makeKeyString(item.identifier) === identifier; - } - }); - }, bypassSelection($event) { if (this.dragInProgress) { if ($event) { diff --git a/src/plugins/flexibleLayout/toolbarProvider.js b/src/plugins/flexibleLayout/toolbarProvider.js index 29176c156a..eacc3ebc6e 100644 --- a/src/plugins/flexibleLayout/toolbarProvider.js +++ b/src/plugins/flexibleLayout/toolbarProvider.js @@ -57,14 +57,14 @@ function ToolbarProvider(openmct) { property: 'configuration.rowsLayout', options: [ { - value: false, + value: true, icon: 'icon-columns', - title: 'Columns' + title: 'Columns layout' }, { - value: true, + value: false, icon: 'icon-rows', - title: 'Rows' + title: 'Rows layout' } ] }; @@ -120,14 +120,14 @@ function ToolbarProvider(openmct) { property: `configuration.containers[${containerIndex}].frames[${frameIndex}].noFrame`, options: [ { - value: true, + value: false, icon: 'icon-frame-hide', - title: "Hide frame" + title: "Frame hidden" }, { - value: false, + value: true, icon: 'icon-frame-show', - title: "Show frame" + title: "Frame visible" } ] }; diff --git a/src/plugins/folderView/components/ListItem.vue b/src/plugins/folderView/components/ListItem.vue index 0b678fa813..7cd3ef7c1a 100644 --- a/src/plugins/folderView/components/ListItem.vue +++ b/src/plugins/folderView/components/ListItem.vue @@ -4,9 +4,8 @@ @click="navigate"> -
- {{item.model.name}} +
+
{{item.model.name}}
{{ item.type.name }} @@ -20,17 +19,24 @@ /******************************* LIST ITEM */ .c-list-item { - &__name { - @include ellipsize(); + &__name a { + display: flex; + + > * + * { margin-left: $interiorMarginSm; } } &__type-icon { + // Have to do it this way instead of using icon-* class, due to need to apply alias to the icon color: $colorKey; display: inline-block; width: 1em; margin-right:$interiorMarginSm; } + &__name-value { + @include ellipsize(); + } + &.is-alias { // Object is an alias to an original. [class*='__type-icon'] { @@ -48,7 +54,6 @@ } } } -