提交 04bfb983 编写于 作者: J Joao Moreno

scm tree: proper icon theme alignment

上级 3a7ac688
...@@ -52,9 +52,9 @@ ...@@ -52,9 +52,9 @@
/* File icons in trees */ /* File icons in trees */
.file-icon-themable-tree.align-icons-and-twisties .monaco-tl-twistie:not(.collapsible), .file-icon-themable-tree.align-icons-and-twisties .monaco-tl-twistie:not(.force-twistie):not(.collapsible),
.file-icon-themable-tree .align-icon-with-twisty .monaco-tl-twistie:not(.collapsible), .file-icon-themable-tree .align-icon-with-twisty .monaco-tl-twistie:not(.force-twistie):not(.collapsible),
.file-icon-themable-tree.hide-arrows .monaco-tl-twistie { .file-icon-themable-tree.hide-arrows .monaco-tl-twistie:not(.force-twistie) {
background-image: none !important; background-image: none !important;
width: 0 !important; width: 0 !important;
margin-right: 0 !important; margin-right: 0 !important;
......
...@@ -192,3 +192,9 @@ ...@@ -192,3 +192,9 @@
.scm-viewlet .scm-editor.scroll > .monaco-inputbox > .wrapper > textarea.input { .scm-viewlet .scm-editor.scroll > .monaco-inputbox > .wrapper > textarea.input {
overflow-y: scroll; overflow-y: scroll;
} }
.scm-viewlet .list-view-mode .monaco-tl-twistie:not(.force-twistie):not(.collapsible) {
background-image: none !important;
width: 8px !important;
margin-right: 0 !important;
}
...@@ -49,6 +49,7 @@ import { IViewDescriptor } from 'vs/workbench/common/views'; ...@@ -49,6 +49,7 @@ import { IViewDescriptor } from 'vs/workbench/common/views';
import { localize } from 'vs/nls'; import { localize } from 'vs/nls';
import { flatten } from 'vs/base/common/arrays'; import { flatten } from 'vs/base/common/arrays';
import { memoize } from 'vs/base/common/decorators'; import { memoize } from 'vs/base/common/decorators';
import { IWorkbenchThemeService, IFileIconTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
type TreeElement = ISCMResourceGroup | IBranchNode<ISCMResource, ISCMResourceGroup> | ISCMResource; type TreeElement = ISCMResourceGroup | IBranchNode<ISCMResource, ISCMResourceGroup> | ISCMResource;
...@@ -72,6 +73,9 @@ class ResourceGroupRenderer implements ICompressibleTreeRenderer<ISCMResourceGro ...@@ -72,6 +73,9 @@ class ResourceGroupRenderer implements ICompressibleTreeRenderer<ISCMResourceGro
) { } ) { }
renderTemplate(container: HTMLElement): ResourceGroupTemplate { renderTemplate(container: HTMLElement): ResourceGroupTemplate {
// hack
addClass(container.parentElement!.parentElement!.querySelector('.monaco-tl-twistie')! as HTMLElement, 'force-twistie');
const element = append(container, $('.resource-group')); const element = append(container, $('.resource-group'));
const name = append(element, $('.name')); const name = append(element, $('.name'));
const actionsContainer = append(element, $('.actions')); const actionsContainer = append(element, $('.actions'));
...@@ -527,7 +531,7 @@ export class RepositoryPanel extends ViewletPanel { ...@@ -527,7 +531,7 @@ export class RepositoryPanel extends ViewletPanel {
readonly repository: ISCMRepository, readonly repository: ISCMRepository,
options: IViewletPanelOptions, options: IViewletPanelOptions,
@IKeybindingService protected keybindingService: IKeybindingService, @IKeybindingService protected keybindingService: IKeybindingService,
@IThemeService protected themeService: IThemeService, @IWorkbenchThemeService protected themeService: IWorkbenchThemeService,
@IContextMenuService protected contextMenuService: IContextMenuService, @IContextMenuService protected contextMenuService: IContextMenuService,
@IContextViewService protected contextViewService: IContextViewService, @IContextViewService protected contextViewService: IContextViewService,
@ICommandService protected commandService: ICommandService, @ICommandService protected commandService: ICommandService,
...@@ -686,6 +690,19 @@ export class RepositoryPanel extends ViewletPanel { ...@@ -686,6 +690,19 @@ export class RepositoryPanel extends ViewletPanel {
this.viewModel = new ViewModel(this.repository.provider.groups, this.tree); this.viewModel = new ViewModel(this.repository.provider.groups, this.tree);
this._register(this.viewModel); this._register(this.viewModel);
addClass(this.listContainer, 'file-icon-themable-tree');
addClass(this.listContainer, 'show-file-icons');
const updateIndentStyles = (theme: IFileIconTheme) => {
toggleClass(this.listContainer, 'list-view-mode', this.viewModel.mode === ViewModelMode.List);
toggleClass(this.listContainer, 'align-icons-and-twisties', this.viewModel.mode === ViewModelMode.Tree && theme.hasFileIcons && !theme.hasFolderIcons);
toggleClass(this.listContainer, 'hide-arrows', this.viewModel.mode === ViewModelMode.Tree && theme.hidesExplorerArrows === true);
};
updateIndentStyles(this.themeService.getFileIconTheme());
this._register(this.themeService.onDidFileIconThemeChange(updateIndentStyles));
this._register(this.viewModel.onDidChangeMode(() => updateIndentStyles(this.themeService.getFileIconTheme())));
this.toggleViewModelModeAction = new ToggleViewModeAction(this.viewModel); this.toggleViewModelModeAction = new ToggleViewModeAction(this.viewModel);
this._register(this.toggleViewModelModeAction); this._register(this.toggleViewModelModeAction);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册