提交 8c00c0da 编写于 作者: M Martin Aeschlimann

treeview: option to hide twisties

上级 e753f869
......@@ -64,7 +64,7 @@
/* Expansion */
.monaco-tree .monaco-tree-rows > .monaco-tree-row.has-children > .content:before {
.monaco-tree .monaco-tree-rows.show-twisties > .monaco-tree-row.has-children > .content:before {
content: ' ';
position: absolute;
display: block;
......@@ -75,7 +75,7 @@
left: -16px;
}
.monaco-tree .monaco-tree-rows > .monaco-tree-row.expanded > .content:before {
.monaco-tree .monaco-tree-rows.show-twisties > .monaco-tree-row.expanded > .content:before {
background-image: url('expanded.svg');
}
......@@ -109,11 +109,11 @@
.vs-dark .monaco-tree-wrapper.drop-target,
.vs-dark .monaco-tree .monaco-tree-row.drop-target { background-color: #383B3D !important; color: inherit !important; }
.vs-dark .monaco-tree .monaco-tree-rows > .monaco-tree-row.has-children > .content:before {
.vs-dark .monaco-tree .monaco-tree-rows.show-twisties > .monaco-tree-row.has-children > .content:before {
background-image: url('collapsed-dark.svg');
}
.vs-dark .monaco-tree .monaco-tree-rows > .monaco-tree-row.expanded > .content:before {
.vs-dark .monaco-tree .monaco-tree-rows.show-twisties > .monaco-tree-row.expanded > .content:before {
background-image: url('expanded-dark.svg');
}
......@@ -131,11 +131,11 @@
.hc-black .monaco-tree .monaco-tree-wrapper.drop-target,
.hc-black .monaco-tree .monaco-tree-rows > .monaco-tree-row.drop-target { background: none !important; border: 1px dashed #f38518; }
.hc-black .monaco-tree .monaco-tree-rows > .monaco-tree-row.has-children > .content:before {
.hc-black .monaco-tree .monaco-tree-rows.show-twisties > .monaco-tree-row.has-children > .content:before {
background-image: url('collapsed-hc.svg');
}
.hc-black .monaco-tree .monaco-tree-rows > .monaco-tree-row.expanded > .content:before {
.hc-black .monaco-tree .monaco-tree-rows.show-twisties > .monaco-tree-row.expanded > .content:before {
background-image: url('expanded-hc.svg');
}
......
......@@ -634,6 +634,7 @@ export interface ITreeConfiguration {
export interface ITreeOptions {
twistiePixels?: number;
showTwistie?: boolean;
indentPixels?: number;
verticalScrollMode?: ScrollbarVisibility;
alwaysFocused?: boolean;
......
......@@ -64,6 +64,7 @@ export class Tree extends Events.EventEmitter implements _.ITree {
this.options = options;
this.options.twistiePixels = typeof this.options.twistiePixels === 'number' ? this.options.twistiePixels : 32;
this.options.showTwistie = this.options.showTwistie === false ? false : true;
this.options.indentPixels = typeof this.options.indentPixels === 'number' ? this.options.indentPixels : 12;
this.options.alwaysFocused = this.options.alwaysFocused === true ? true : false;
this.options.useShadows = this.options.useShadows === false ? false : true;
......
......@@ -504,6 +504,9 @@ export class TreeView extends HeightMap {
this.rowsContainer = document.createElement('div');
this.rowsContainer.className = 'monaco-tree-rows';
if (context.options.showTwistie) {
this.rowsContainer.className += ' show-twisties';
}
var focusTracker = DOM.trackFocus(this.domNode);
focusTracker.addFocusListener(() => this.onFocus());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册