Skip to content

Commit

Permalink
Update folding icon to use icon font
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Solorio committed Sep 19, 2019
1 parent 6de911e commit 8b6e0ef
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 55 deletions.
44 changes: 10 additions & 34 deletions src/vs/editor/contrib/folding/folding.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,28 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

.monaco-editor .margin-view-overlays .folding {
.monaco-editor .margin-view-overlays .codicon {
cursor: pointer;
background-repeat: no-repeat;
background-origin: border-box;
background-position: calc(50% + 2px) center;
background-size: auto calc(100% - 3px);
opacity: 0;
transition: opacity 0.5s;
display: flex;
align-items: center;
justify-content: center;
font-size: 140%;
margin-left: 2px;
}

.monaco-editor .margin-view-overlays .folding {
background-image: url('tree-expanded-light.svg');
}

.monaco-editor.hc-black .margin-view-overlays .folding,
.monaco-editor.vs-dark .margin-view-overlays .folding {
background-image: url('tree-expanded-dark.svg');
}

.monaco-editor.hc-black .margin-view-overlays .folding {
background-image: url('tree-expanded-hc.svg');
}

.monaco-editor .margin-view-overlays:hover .folding,
.monaco-editor .margin-view-overlays .folding.alwaysShowFoldIcons {
opacity: 1;
}

.monaco-editor .margin-view-overlays .folding.collapsed {
background-image: url('tree-collapsed-light.svg');
.monaco-editor .margin-view-overlays:hover .codicon,
.monaco-editor .margin-view-overlays .codicon.codicon-chevron-right,
.monaco-editor .margin-view-overlays .codicon.alwaysShowFoldIcons {
opacity: 1;
}

.monaco-editor.vs-dark .margin-view-overlays .folding.collapsed {
background-image: url('tree-collapsed-dark.svg');
}

.monaco-editor.hc-black .margin-view-overlays .folding.collapsed {
background-image: url('tree-collapsed-hc.svg');
}

.monaco-editor .inline-folded:after {
color: grey;
margin: 0.1em 0.2em 0 0.2em;
content: "⋯";
display: inline;
line-height: 1em;
cursor: pointer;
}
}
6 changes: 3 additions & 3 deletions src/vs/editor/contrib/folding/foldingDecorations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ export class FoldingDecorationProvider implements IDecorationProvider {
private static COLLAPSED_VISUAL_DECORATION = ModelDecorationOptions.register({
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
afterContentClassName: 'inline-folded',
linesDecorationsClassName: 'folding collapsed'
linesDecorationsClassName: 'codicon codicon-chevron-right'
});

private static EXPANDED_AUTO_HIDE_VISUAL_DECORATION = ModelDecorationOptions.register({
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
linesDecorationsClassName: 'folding'
linesDecorationsClassName: 'codicon codicon-chevron-down'
});

private static EXPANDED_VISUAL_DECORATION = ModelDecorationOptions.register({
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
linesDecorationsClassName: 'folding alwaysShowFoldIcons'
linesDecorationsClassName: 'codicon codicon-chevron-down alwaysShowFoldIcons'
});

public autoHideFoldingControls: boolean = true;
Expand Down
3 changes: 0 additions & 3 deletions src/vs/editor/contrib/folding/tree-collapsed-dark.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/vs/editor/contrib/folding/tree-collapsed-hc.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/vs/editor/contrib/folding/tree-collapsed-light.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/vs/editor/contrib/folding/tree-expanded-dark.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/vs/editor/contrib/folding/tree-expanded-hc.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/vs/editor/contrib/folding/tree-expanded-light.svg

This file was deleted.

0 comments on commit 8b6e0ef

Please sign in to comment.