Update component names (#3549)

This commit is contained in:
alschmiedt
2020-01-06 13:18:15 -08:00
committed by GitHub
parent 8d6ff39e64
commit a1ed9ab791
7 changed files with 17 additions and 13 deletions

View File

@@ -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());

View File

@@ -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);

View File

@@ -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);

View File

@@ -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_,

View File

@@ -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);
/**

View File

@@ -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,

View File

@@ -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} */