提交 014e6d96 编写于 作者: M Martin Aeschlimann

mini map background color not using background color. Fixes #22030

上级 6effc333
......@@ -17,7 +17,7 @@ import * as objects from 'vs/base/common/objects';
import * as plist from 'fast-plist';
import pfs = require('vs/base/node/pfs');
import { Extensions, IColorRegistry, ColorIdentifier } from 'vs/platform/theme/common/colorRegistry';
import { Extensions, IColorRegistry, ColorIdentifier, editorBackground, editorForeground } from 'vs/platform/theme/common/colorRegistry';
import { ThemeType } from 'vs/platform/theme/common/themeService';
import { Registry } from 'vs/platform/platform';
......@@ -73,6 +73,7 @@ export class ColorThemeData implements IColorTheme {
this.colorMap = colorMap;
this.defaultColorMap = {};
this.isLoaded = true;
completeTokenColors(this);
});
}
return TPromise.as(null);
......@@ -223,3 +224,19 @@ function _loadThemeDocument(baseTheme: string, themePath: string, resultRules: I
return TPromise.wrapError(new Error(nls.localize('error.cannotload', "Problems loading theme file {0}: {1}", themePath, error.message)));
});
}
/**
* Make sure that the token colors contain the default fore and background
*/
function completeTokenColors(theme: ColorThemeData) {
theme.tokenColors.forEach(rule => {
if (!rule.scope) {
if (!rule.settings.background) {
rule.settings.background = theme.getColor(editorBackground).toRGBAHex();
}
if (!rule.settings.foreground) {
rule.settings.foreground = theme.getColor(editorForeground).toRGBAHex();
}
}
});
}
\ No newline at end of file
......@@ -26,16 +26,20 @@ export function convertSettings(oldSettings: ITokenColorizationRule[], resultRul
resultRules.push(rule);
if (!rule.scope) {
let settings = rule.settings;
for (let key in settings) {
let mappings = settingToColorIdMapping[key];
if (mappings) {
let color = Color.fromHex(settings[key]);
for (let colorId of mappings) {
resultColors[colorId] = color;
if (!settings) {
rule.settings = {};
} else {
for (let key in settings) {
let mappings = settingToColorIdMapping[key];
if (mappings) {
let color = Color.fromHex(settings[key]);
for (let colorId of mappings) {
resultColors[colorId] = color;
}
}
if (key !== 'foreground' && key !== 'background') {
delete settings[key];
}
}
if (key !== 'foreground' && key !== 'background') {
delete settings[key];
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册