提交 24e8857c 编写于 作者: M Martin Aeschlimann

theme watching: support icon themes (for #66115)

上级 afee6f24
......@@ -23,6 +23,7 @@ export class FileIconThemeData implements IFileIconTheme {
isLoaded: boolean;
location?: URI;
extensionData?: ExtensionData;
watch: boolean;
styleSheetContent?: string;
......@@ -59,6 +60,7 @@ export class FileIconThemeData implements IFileIconTheme {
themeData.description = iconTheme.description;
themeData.location = iconThemeLocation;
themeData.extensionData = extensionData;
themeData.watch = iconTheme._watch;
themeData.isLoaded = false;
return themeData;
}
......@@ -77,6 +79,7 @@ export class FileIconThemeData implements IFileIconTheme {
themeData.hidesExplorerArrows = false;
themeData.isLoaded = true;
themeData.extensionData = undefined;
themeData.watch = false;
}
return themeData;
}
......@@ -91,6 +94,7 @@ export class FileIconThemeData implements IFileIconTheme {
themeData.hasFolderIcons = false;
themeData.hidesExplorerArrows = false;
themeData.extensionData = undefined;
themeData.watch = false;
return themeData;
}
......@@ -109,6 +113,7 @@ export class FileIconThemeData implements IFileIconTheme {
case 'hasFileIcons':
case 'hidesExplorerArrows':
case 'hasFolderIcons':
case 'watch':
theme[key] = data[key];
break;
case 'location':
......@@ -132,7 +137,8 @@ export class FileIconThemeData implements IFileIconTheme {
styleSheetContent: this.styleSheetContent,
hasFileIcons: this.hasFileIcons,
hasFolderIcons: this.hasFolderIcons,
hidesExplorerArrows: this.hidesExplorerArrows
hidesExplorerArrows: this.hidesExplorerArrows,
watch: this.watch
});
}
}
......
......@@ -355,6 +355,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
if (this.fileService && !resources.isEqual(newTheme.location, this.watchedColorThemeLocation)) {
if (this.watchedColorThemeLocation) {
this.fileService.unwatchFileChanges(this.watchedColorThemeLocation);
this.watchedColorThemeLocation = null;
}
if (newTheme.location && (newTheme.watch || !!this.environmentService.extensionDevelopmentLocationURI)) {
this.watchedColorThemeLocation = newTheme.location;
......@@ -459,9 +460,10 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
if (this.fileService && !resources.isEqual(iconThemeData.location, this.watchedIconThemeLocation)) {
if (this.watchedIconThemeLocation) {
this.fileService.unwatchFileChanges(this.watchedIconThemeLocation);
this.watchedIconThemeLocation = null;
}
this.watchedIconThemeLocation = iconThemeData.location;
if (this.watchedIconThemeLocation) {
if (iconThemeData.location && (iconThemeData.watch || !!this.environmentService.extensionDevelopmentLocationURI)) {
this.watchedIconThemeLocation = iconThemeData.location;
this.fileService.watchFileChanges(this.watchedIconThemeLocation);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册