提交 ef499350 编写于 作者: C Christof Marti

Check if new SCM integration is enabled (fixes #18857 and #19337)

上级 cc8df730
...@@ -157,7 +157,7 @@ ul>li.item$*5 ...@@ -157,7 +157,7 @@ ul>li.item$*5
## Thanks! ## Thanks!
Well if you have got this far then you will have touched on some of the editing features in Visual Studio Code. But don't stop now :) We have lots of additional [documentation](https://code.visualstudio.com/docs) and [introductory videos](https://code.visualstudio.com/docs/introvideos/overview) for the product that will help you learn how to use it. And while you are here, here are a few additional things you can try: Well if you have got this far then you will have touched on some of the editing features in Visual Studio Code. But don't stop now :) We have lots of additional [documentation](https://code.visualstudio.com/docs) and [introductory videos](https://code.visualstudio.com/docs/introvideos/overview) for the product that will help you learn how to use it. And while you are here, here are a few additional things you can try:
- Open the Integrated Terminal by pressing kb(workbench.action.terminal.toggleTerminal) then see what's possible by [reviewing the terminal documentation](https://code.visualstudio.com/docs/editor/integrated-terminal) - Open the Integrated Terminal by pressing kb(workbench.action.terminal.toggleTerminal) then see what's possible by [reviewing the terminal documentation](https://code.visualstudio.com/docs/editor/integrated-terminal)
- Work with version control by pressing kb(workbench.view.git) understand how to stage, commit, change branches, and view diffs and more by reviewing the [version control documentation](https://code.visualstudio.com/docs/editor/versioncontrol) - Work with version control by pressing <span class="git-only">kb(workbench.view.git)</span><span class="scm-only">kb(workbench.view.scm)</span> understand how to stage, commit, change branches, and view diffs and more by reviewing the [version control documentation](https://code.visualstudio.com/docs/editor/versioncontrol)
- Browse thousands of extensions in our integrated gallery by pressing with kb(workbench.view.extensions) the [documentation](https://code.visualstudio.com/docs/editor/extension-gallery) will show you how to see the most popular extensions, disable installed ones and more. - Browse thousands of extensions in our integrated gallery by pressing with kb(workbench.view.extensions) the [documentation](https://code.visualstudio.com/docs/editor/extension-gallery) will show you how to see the most popular extensions, disable installed ones and more.
OK that's all for now, OK that's all for now,
......
...@@ -159,6 +159,16 @@ ...@@ -159,6 +159,16 @@
display: initial; display: initial;
} }
.monaco-workbench > .part.editor > .content .walkThroughContent .scm-only {
display: none;
}
.monaco-workbench > .part.editor > .content .walkThroughContent.scmEnabled .scm-only {
display: initial;
}
.monaco-workbench > .part.editor > .content .walkThroughContent.scmEnabled .git-only {
display: none;
}
.vs .monaco-workbench > .part.editor > .content .walkThroughContent .monaco-editor-background, .vs .monaco-workbench > .part.editor > .content .walkThroughContent .monaco-editor-background,
.vs .monaco-workbench > .part.editor > .content .walkThroughContent .glyph-margin { .vs .monaco-workbench > .part.editor > .content .walkThroughContent .glyph-margin {
background-color: #eee; background-color: #eee;
......
...@@ -34,6 +34,7 @@ import { Scope } from 'vs/workbench/common/memento'; ...@@ -34,6 +34,7 @@ import { Scope } from 'vs/workbench/common/memento';
import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { once } from 'vs/base/common/event'; import { once } from 'vs/base/common/event';
import SCMPreview from 'vs/workbench/parts/scm/browser/scmPreview';
export const WALK_THROUGH_FOCUS = new RawContextKey<boolean>('interactivePlaygroundFocus', false); export const WALK_THROUGH_FOCUS = new RawContextKey<boolean>('interactivePlaygroundFocus', false);
...@@ -247,6 +248,7 @@ export class WalkThroughPart extends BaseEditor { ...@@ -247,6 +248,7 @@ export class WalkThroughPart extends BaseEditor {
if (strings.endsWith(input.getResource().path, '.html')) { if (strings.endsWith(input.getResource().path, '.html')) {
this.content.innerHTML = content; this.content.innerHTML = content;
this.updateSizeClasses(); this.updateSizeClasses();
this.updateMarkerClasses();
this.decorateContent(); this.decorateContent();
if (input.onReady) { if (input.onReady) {
input.onReady(this.content.firstElementChild as HTMLElement); input.onReady(this.content.firstElementChild as HTMLElement);
...@@ -324,6 +326,7 @@ export class WalkThroughPart extends BaseEditor { ...@@ -324,6 +326,7 @@ export class WalkThroughPart extends BaseEditor {
})); }));
}); });
this.updateSizeClasses(); this.updateSizeClasses();
this.updateMarkerClasses();
if (input.onReady) { if (input.onReady) {
input.onReady(innerContent); input.onReady(innerContent);
} }
...@@ -332,6 +335,13 @@ export class WalkThroughPart extends BaseEditor { ...@@ -332,6 +335,13 @@ export class WalkThroughPart extends BaseEditor {
}); });
} }
private updateMarkerClasses() {
const innerContent = this.content.firstElementChild;
if (SCMPreview.enabled && innerContent) {
innerContent.classList.add('scmEnabled');
}
}
private style(div: HTMLElement) { private style(div: HTMLElement) {
const styleElement = document.querySelector('.monaco-editor-background'); const styleElement = document.querySelector('.monaco-editor-background');
const {color, backgroundColor, fontFamily, fontWeight, fontSize} = window.getComputedStyle(styleElement); const {color, backgroundColor, fontFamily, fontWeight, fontSize} = window.getComputedStyle(styleElement);
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<ul> <ul>
<li class="mac-only"><a href="command:workbench.action.files.openFileFolder">Open folder...</a></li> <li class="mac-only"><a href="command:workbench.action.files.openFileFolder">Open folder...</a></li>
<li class="windows-only linux-only"><a href="command:workbench.action.files.openFolder">Open folder...</a></li> <li class="windows-only linux-only"><a href="command:workbench.action.files.openFolder">Open folder...</a></li>
<li><a href="command:workbench.action.git.clone">Clone Git repository...</a></li> <li class="git-only"><a href="command:workbench.action.git.clone">Clone Git repository...</a></li>
</ul> </ul>
</div> </div>
<div class="section recent"> <div class="section recent">
......
...@@ -276,4 +276,14 @@ ...@@ -276,4 +276,14 @@
} }
.monaco-workbench.linux > .part.editor > .content .welcomePage .linux-only { .monaco-workbench.linux > .part.editor > .content .welcomePage .linux-only {
display: initial; display: initial;
}
.monaco-workbench > .part.editor > .content .welcomePageContainer .scm-only {
display: none;
}
.monaco-workbench > .part.editor > .content .welcomePageContainer.scmEnabled .scm-only {
display: initial;
}
.monaco-workbench > .part.editor > .content .welcomePageContainer.scmEnabled .git-only {
display: none;
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册