From a1ed9ab79140f44e80c421b69f942a973ca8e0ba Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Mon, 6 Jan 2020 13:18:15 -0800 Subject: [PATCH] Update component names (#3549) --- core/flyout_base.js | 2 +- core/flyout_button.js | 3 ++- core/inject.js | 3 ++- core/scrollbar.js | 2 +- core/theme/dark.js | 12 ++++++------ core/toolbox.js | 5 +++-- core/workspace_svg.js | 3 ++- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/core/flyout_base.js b/core/flyout_base.js index 395421873..471c4d558 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -228,7 +228,7 @@ Blockly.Flyout.prototype.createDom = function(tagName) { {'class': 'blocklyFlyoutBackground'}, this.svgGroup_); this.svgGroup_.appendChild(this.workspace_.createDom()); this.workspace_.getThemeManager().subscribe( - this.svgBackground_, 'flyout', 'fill'); + this.svgBackground_, 'flyoutBackgroundColour', 'fill'); this.workspace_.getThemeManager().subscribe( this.svgBackground_, 'flyoutOpacity', 'fill-opacity'); this.workspace_.getMarkerManager().setCursor(new Blockly.FlyoutCursor()); diff --git a/core/flyout_button.js b/core/flyout_button.js index a8cd5360d..f400f0fb6 100644 --- a/core/flyout_button.js +++ b/core/flyout_button.js @@ -160,7 +160,8 @@ Blockly.FlyoutButton.prototype.createDom = function() { svgText.textContent = text; if (this.isLabel_) { this.svgText_ = svgText; - this.workspace_.getThemeManager().subscribe(this.svgText_, 'flyoutText', 'fill'); + this.workspace_.getThemeManager().subscribe(this.svgText_, + 'flyoutForegroundColour', 'fill'); } this.width = Blockly.utils.dom.getTextWidth(svgText); diff --git a/core/inject.js b/core/inject.js index f284dd571..3f371dafb 100644 --- a/core/inject.js +++ b/core/inject.js @@ -182,7 +182,8 @@ Blockly.createMainWorkspace_ = function(svg, options, blockDragSurface, mainWorkspace.addZoomControls(); } // Register the workspace svg as a UI component. - mainWorkspace.getThemeManager().subscribe(svg, 'workspace', 'background-color'); + mainWorkspace.getThemeManager().subscribe(svg, 'workspaceBackgroundColour', + 'background-color'); // A null translation will also apply the correct initial scale. mainWorkspace.translate(0, 0); diff --git a/core/scrollbar.js b/core/scrollbar.js index 538cbb394..9d20f89dc 100644 --- a/core/scrollbar.js +++ b/core/scrollbar.js @@ -628,7 +628,7 @@ Blockly.Scrollbar.prototype.createDom_ = function(opt_class) { }, this.svgGroup_); this.workspace_.getThemeManager().subscribe( - this.svgHandle_, 'scrollbar', 'fill'); + this.svgHandle_, 'scrollbarColour', 'fill'); this.workspace_.getThemeManager().subscribe( this.svgHandle_, 'scrollbarOpacity', 'fill-opacity'); Blockly.utils.dom.insertAfter(this.outerSvg_, diff --git a/core/theme/dark.js b/core/theme/dark.js index c8a5fd783..e9b7697b2 100644 --- a/core/theme/dark.js +++ b/core/theme/dark.js @@ -119,13 +119,13 @@ Blockly.Themes.Dark = new Blockly.Theme('dark', Blockly.Themes.Dark.defaultBlockStyles, Blockly.Themes.Dark.categoryStyles); -Blockly.Themes.Dark.setComponentStyle('workspace', '#1e1e1e'); -Blockly.Themes.Dark.setComponentStyle('toolbox', '#333'); -Blockly.Themes.Dark.setComponentStyle('toolboxText', '#fff'); -Blockly.Themes.Dark.setComponentStyle('flyout', '#252526'); -Blockly.Themes.Dark.setComponentStyle('flyoutText', '#ccc'); +Blockly.Themes.Dark.setComponentStyle('workspaceBackgroundColour', '#1e1e1e'); +Blockly.Themes.Dark.setComponentStyle('toolboxBackgroundColour', '#333'); +Blockly.Themes.Dark.setComponentStyle('toolboxForegroundColour', '#fff'); +Blockly.Themes.Dark.setComponentStyle('flyoutBackgroundColour', '#252526'); +Blockly.Themes.Dark.setComponentStyle('flyoutForegroundColour', '#ccc'); Blockly.Themes.Dark.setComponentStyle('flyoutOpacity', 1); -Blockly.Themes.Dark.setComponentStyle('scrollbar', '#797979'); +Blockly.Themes.Dark.setComponentStyle('scrollbarColour', '#797979'); Blockly.Themes.Dark.setComponentStyle('scrollbarOpacity', 0.4); /** diff --git a/core/toolbox.js b/core/toolbox.js index d029fd390..646a138e0 100644 --- a/core/toolbox.js +++ b/core/toolbox.js @@ -163,8 +163,9 @@ Blockly.Toolbox.prototype.init = function() { this.HtmlDiv.setAttribute('dir', workspace.RTL ? 'RTL' : 'LTR'); svg.parentNode.insertBefore(this.HtmlDiv, svg); var themeManager = workspace.getThemeManager(); - themeManager.subscribe(this.HtmlDiv, 'toolbox', 'background-color'); - themeManager.subscribe(this.HtmlDiv, 'toolboxText', 'color'); + themeManager.subscribe(this.HtmlDiv, 'toolboxBackgroundColour', + 'background-color'); + themeManager.subscribe(this.HtmlDiv, 'toolboxForegroundColour', 'color'); // Clicking on toolbox closes popups. Blockly.bindEventWithChecks_(this.HtmlDiv, 'mousedown', this, diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 461e86836..2b62fb62f 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -717,7 +717,8 @@ Blockly.WorkspaceSvg.prototype.createDom = function(opt_backgroundClass) { this.svgBackground_.style.fill = 'url(#' + this.grid_.getPatternId() + ')'; } else { - this.themeManager_.subscribe(this.svgBackground_, 'workspace', 'fill'); + this.themeManager_.subscribe(this.svgBackground_, + 'workspaceBackgroundColour', 'fill'); } } /** @type {SVGElement} */