diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/sidebar.js b/packages/node_modules/@node-red/editor-client/src/js/ui/sidebar.js index eb87a9f6a..8e5f99bb6 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/sidebar.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/sidebar.js @@ -45,6 +45,7 @@ RED.sidebar = (function() { primary: [], secondary: [] } + // TODO: move to tabBars sidebars.primary.tabBar.children('button').each(function() { const tabId = $(this).attr('data-tab-id'); state.primary.push(tabId); @@ -139,12 +140,17 @@ RED.sidebar = (function() { knownTabs[options.id] = options; options.tabButton = $('') // Insert the tab button at the correct index - if (targetTabButtonIndex === -1 || targetTabButtonIndex >= targetSidebar.tabBar.children().length) { + if (targetTabButtonIndex === -1 || targetTabButtonIndex >= targetSidebar.tabBars[targetSection].children().length) { // Append to end - options.tabButton = $('').insertBefore(targetSidebar.tabOverflowButton); + // TODO: quick hack + if (targetSection === 'top') { + options.tabButton = $('').insertBefore(targetSidebar.tabOverflowButton); + } else { + options.tabButton = $('').appendTo(targetSidebar.tabBars[targetSection]); + } } else { // Insert before the item at targetTabButtonIndex - options.tabButton = $('').insertBefore(targetSidebar.tabBar.children().eq(targetTabButtonIndex)); + options.tabButton = $('').insertBefore(targetSidebar.tabBars[targetSection].children().eq(targetTabButtonIndex)); } options.tabButton.attr('data-tab-id', options.id) @@ -217,12 +223,17 @@ RED.sidebar = (function() { } function setupSidebarTabs(sidebar) { + const tabBar = $('
').addClass('red-ui-sidebar-' + sidebar.direction); const tabBarButtonsContainer = $('
').appendTo(tabBar); const tabBarButtonsContainerBottom = $('
').appendTo(tabBar); - const dummyButton = $('').appendTo(tabBarButtonsContainerBottom); - const dummyButton2 = $('').appendTo(tabBarButtonsContainerBottom); + // TODO: make this an API object, not just a jQuery object + sidebar.tabBar = tabBarButtonsContainer; + sidebar.tabBars = { + top: tabBarButtonsContainer, + bottom: tabBarButtonsContainerBottom + } const tabOverflowButton = $('').appendTo(tabBarButtonsContainer); sidebar.tabOverflowButton = tabOverflowButton @@ -460,7 +471,8 @@ RED.sidebar = (function() { if (!state) { sidebar.container.hide() sidebar.separator.hide() - sidebar.tabBar.find('button').removeClass('selected') + sidebar.tabBars.top.find('button').removeClass('selected') + sidebar.tabBars.bottom.find('button').removeClass('selected') } else { sidebar.container.show() sidebar.separator.show() @@ -475,7 +487,7 @@ RED.sidebar = (function() { const sidebar = sidebars[sidebarKey]; let lastTabId = lastSessionSelectedTabs[sidebarKey]; if (!lastTabId) { - lastTabId = sidebar.tabBar.children('button').first().attr('data-tab-id'); + lastTabId = sidebar.tabBars.top.children('button').first().attr('data-tab-id'); } showSidebar(lastTabId, true) }) @@ -496,6 +508,7 @@ RED.sidebar = (function() { $(tabOptions.toolbar).show(); } RED.settings.setLocal("last-sidebar-tab-" + targetSidebar.id, tabOptions.id) + // TODO: find which tabBar the button is in targetSidebar.tabBar.find('button').removeClass('selected') targetSidebar.tabBar.find('button[data-tab-id="'+id+'"]').addClass('selected') targetSidebar.activeTab = id @@ -530,6 +543,9 @@ RED.sidebar = (function() { invisibleSeparator: true, resize: function(size1, size2) { console.log('resize', size1, size2) + // sidebar.tabBarTop.outerHeight(size1); + // sidebar.tabBarBottom.outerHeight(size2); + // RED.events.emit("sidebar:resize"); } }) // sidebar.panels.ratio(1) @@ -537,7 +553,7 @@ RED.sidebar = (function() { sidebar.separator = setupSidebarSeparator(sidebar); - sidebar.tabBar = setupSidebarTabs(sidebar) + setupSidebarTabs(sidebar) } function init () { diff --git a/packages/node_modules/@node-red/editor-client/src/sass/colors.scss b/packages/node_modules/@node-red/editor-client/src/sass/colors.scss index 8e03b7f0d..a3a52f69f 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/colors.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/colors.scss @@ -253,14 +253,14 @@ $deploy-button-color-disabled: #999; $deploy-button-background: #8C101C; $deploy-button-background-hover: #6E0A1E; $deploy-button-background-active: #4C0A17; -$deploy-button-background-disabled: #444; +$deploy-button-background-disabled: $workspace-button-background; $deploy-button-background-disabled-hover: #555; -$header-background: #000; +$header-background: $primary-background; $header-button-background-active: #121212; $header-accent: #C02020; -$header-menu-color: #eee; +$header-menu-color: $primary-text-color; $header-menu-color-disabled: #666; $header-menu-heading-color: #fff; $header-menu-sublabel-color: #aeaeae; diff --git a/packages/node_modules/@node-red/editor-client/src/sass/header.scss b/packages/node_modules/@node-red/editor-client/src/sass/header.scss index ed8de3165..58147c448 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/header.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/header.scss @@ -34,7 +34,7 @@ display: flex; justify-content: space-between; align-items: center; - border-bottom: 2px solid var(--red-ui-header-accent); + // border-bottom: 2px solid var(--red-ui-header-accent); padding-top: 2px; span.red-ui-header-logo { diff --git a/packages/node_modules/@node-red/editor-client/src/sass/sidebar.scss b/packages/node_modules/@node-red/editor-client/src/sass/sidebar.scss index 783629809..a86e9d399 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/sidebar.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/sidebar.scss @@ -21,7 +21,11 @@ flex-grow: 0; flex-shrink: 0; width: 315px; - background: var(--red-ui-primary-background); + margin: 4px 0; + @include mixins.component-border; + border-left: none; + border-right: none; + background: var(--red-ui-secondary-background); box-sizing: border-box; z-index: 10; display: flex; @@ -29,12 +33,12 @@ overflow: hidden; } .red-ui-sidebar-left { - border-left: none; - border-right: none; + background: var(--red-ui-primary-background); + margin: 0; + border: none; } .red-ui-sidebar-right { - border-left: none; - border-right: none; + margin-left: 0; } .red-ui-sidebar-footer { @@ -51,12 +55,12 @@ min-height: 40px; background: rgba(0,0,255,0.2); flex-grow: 1; - border-radius: 8px; + border-radius: 6px; border: 1px solid var(--red-ui-primary-border-color); // overflow: hidden; } .red-ui-sidebar-left .red-ui-sidebar-section { - margin-left: 0 + margin-left: 0; } .red-ui-sidebar-right .red-ui-sidebar-section { margin-right: 0 @@ -101,15 +105,23 @@ display: flex; flex-direction: column; align-items: center; + margin: 4px; + @include mixins.component-border; z-index: 10; + overflow: hidden; // border: 1px solid var(--red-ui-primary-border-color); // height: 100%; &.red-ui-sidebar-left { - border-left: none; + border: none; + margin-right: 0; + background: var(--red-ui-primary-background); } &.red-ui-sidebar-right { - border-right: none; + border-top-right-radius: 8px; + border-bottom-right-radius: 8px; + margin-left: 0; + border-left: none; } button { @@ -136,7 +148,7 @@ .red-ui-sidebar-tab-bar-buttons { display: flex; width: 100%; - background-color: var(--red-ui-primary-background); + // background-color: var(--red-ui-primary-background); // background: rgba(255, 0, 0, 0.1); padding: 6px; box-sizing: border-box; diff --git a/packages/node_modules/@node-red/editor-client/src/sass/workspace.scss b/packages/node_modules/@node-red/editor-client/src/sass/workspace.scss index 6f5b1202c..1f3ee6868 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/workspace.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/workspace.scss @@ -20,8 +20,10 @@ margin: 0; overflow: hidden; @include mixins.component-border; - border-radius: 8px; - margin: 4px; + border-top-left-radius: 8px; + border-bottom-left-radius: 8px; + border-right: none; + margin: 4px 0 4px; transition: left 0.1s ease-in-out; position: relative; flex-grow: 1; @@ -30,7 +32,7 @@ #red-ui-workspace-chart { overflow: auto; position: absolute; - bottom:26px; + bottom:0; top: 35px; left:0px; right:0px; @@ -39,14 +41,16 @@ touch-action: none; padding: 0; margin: 0; + border-right: 1px solid var(--red-ui-primary-border-color); +// border-top-right-radius: px; - // Hide scrollbars - to be done in a future iteration - // scrollbar-width: none; /* Firefox */ - // -ms-overflow-style: none; /* Internet Explorer 10+ */ - // &::-webkit-scrollbar { /* WebKit */ - // width: 0; - // height: 0; - // } +// Hide scrollbars + scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; /* Internet Explorer 10+ */ + &::-webkit-scrollbar { /* WebKit */ + width: 0; + height: 0; + } // Reset SVG default margins > svg { @@ -169,6 +173,12 @@ fill: var(--red-ui-view-background); } +#red-ui-workspace-footer { + border: none; + background: none; + bottom: 4px; + padding: 0; +} .red-ui-component-footer { @include mixins.component-footer; @@ -211,13 +221,13 @@ button.red-ui-footer-button-toggle { bottom: 0; } .red-ui-statusbar-bucket-left { - left: 10px; + left: 6px; .red-ui-statusbar-widget:first-child { margin-left: 0; } } .red-ui-statusbar-bucket-right { - right: 10px; + right: 6px; .red-ui-statusbar-widget:last-child { margin-right: 0; }