Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
98d826a2
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
98d826a2
编写于
3月 16, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
workbench.tips.enabled
fixes #16595
上级
c0587ff1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
49 addition
and
7 deletion
+49
-7
src/vs/workbench/parts/watermark/electron-browser/watermark.css
.../workbench/parts/watermark/electron-browser/watermark.css
+1
-1
src/vs/workbench/parts/watermark/electron-browser/watermark.ts
...s/workbench/parts/watermark/electron-browser/watermark.ts
+48
-6
未找到文件。
src/vs/workbench/parts/watermark/electron-browser/watermark.css
浏览文件 @
98d826a2
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
.monaco-workbench
.part.editor.empty
{
.monaco-workbench
.part.editor.empty
.has-watermark
{
background-position-y
:
calc
(
50%
-
100px
);
background-position-y
:
calc
(
50%
-
100px
);
}
}
...
...
src/vs/workbench/parts/watermark/electron-browser/watermark.ts
浏览文件 @
98d826a2
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
'
use strict
'
;
'
use strict
'
;
import
'
vs/css!./watermark
'
;
import
'
vs/css!./watermark
'
;
import
{
$
}
from
'
vs/base/browser/builder
'
;
import
{
$
,
Builder
}
from
'
vs/base/browser/builder
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
...
@@ -13,9 +13,11 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
...
@@ -13,9 +13,11 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkbenchContribution
,
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
IWorkbenchContribution
,
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
GlobalQuickOpenAction
}
from
'
vs/workbench/browser/parts/quickopen/quickopen.contribution
'
;
import
{
GlobalQuickOpenAction
}
from
'
vs/workbench/browser/parts/quickopen/quickopen.contribution
'
;
import
{
KeybindingsReferenceAction
,
OpenRecentAction
}
from
'
vs/workbench/electron-browser/actions
'
;
import
{
KeybindingsReferenceAction
,
OpenRecentAction
}
from
'
vs/workbench/electron-browser/actions
'
;
import
{
ShowRecommendedKeymapExtensionsAction
}
from
'
vs/workbench/parts/extensions/browser/extensionsActions
'
;
import
{
ShowRecommendedKeymapExtensionsAction
}
from
'
vs/workbench/parts/extensions/browser/extensionsActions
'
;
...
@@ -130,17 +132,34 @@ const UNBOUND = nls.localize('watermark.unboundCommand', "unbound");
...
@@ -130,17 +132,34 @@ const UNBOUND = nls.localize('watermark.unboundCommand', "unbound");
export
class
WatermarkContribution
implements
IWorkbenchContribution
{
export
class
WatermarkContribution
implements
IWorkbenchContribution
{
private
toDispose
:
IDisposable
[]
=
[];
private
toDispose
:
IDisposable
[]
=
[];
private
watermark
:
Builder
;
private
enabled
:
boolean
;
constructor
(
constructor
(
@
ILifecycleService
lifecycleService
:
ILifecycleService
,
@
ILifecycleService
lifecycleService
:
ILifecycleService
,
@
IPartService
private
partService
:
IPartService
,
@
IPartService
private
partService
:
IPartService
,
@
IKeybindingService
private
keybindingService
:
IKeybindingService
,
@
IKeybindingService
private
keybindingService
:
IKeybindingService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
ITelemetryService
private
telemetryService
:
ITelemetryService
@
ITelemetryService
private
telemetryService
:
ITelemetryService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
)
{
)
{
lifecycleService
.
onShutdown
(
this
.
dispose
,
this
);
lifecycleService
.
onShutdown
(
this
.
dispose
,
this
);
this
.
partService
.
joinCreation
().
then
(()
=>
{
this
.
partService
.
joinCreation
().
then
(()
=>
{
this
.
create
();
this
.
enabled
=
this
.
configurationService
.
lookup
<
boolean
>
(
'
workbench.tips.enabled
'
).
value
;
if
(
this
.
enabled
)
{
this
.
create
();
}
});
this
.
configurationService
.
onDidUpdateConfiguration
(
e
=>
{
const
enabled
=
this
.
configurationService
.
lookup
<
boolean
>
(
'
workbench.tips.enabled
'
).
value
;
if
(
enabled
!==
this
.
enabled
)
{
this
.
enabled
=
enabled
;
if
(
this
.
enabled
)
{
this
.
create
();
}
else
{
this
.
destroy
();
}
}
});
});
}
}
...
@@ -150,10 +169,11 @@ export class WatermarkContribution implements IWorkbenchContribution {
...
@@ -150,10 +169,11 @@ export class WatermarkContribution implements IWorkbenchContribution {
private
create
():
void
{
private
create
():
void
{
const
container
=
this
.
partService
.
getContainer
(
Parts
.
EDITOR_PART
);
const
container
=
this
.
partService
.
getContainer
(
Parts
.
EDITOR_PART
);
container
.
classList
.
add
(
'
has-watermark
'
);
const
watermark
=
$
()
this
.
watermark
=
$
()
.
div
({
'
class
'
:
'
watermark
'
});
.
div
({
'
class
'
:
'
watermark
'
});
const
box
=
$
(
watermark
)
const
box
=
$
(
this
.
watermark
)
.
div
({
'
class
'
:
'
watermark-box
'
});
.
div
({
'
class
'
:
'
watermark-box
'
});
const
folder
=
this
.
contextService
.
hasWorkspace
();
const
folder
=
this
.
contextService
.
hasWorkspace
();
const
newUser
=
this
.
telemetryService
.
getExperiments
().
showNewUserWatermark
;
const
newUser
=
this
.
telemetryService
.
getExperiments
().
showNewUserWatermark
;
...
@@ -184,12 +204,20 @@ export class WatermarkContribution implements IWorkbenchContribution {
...
@@ -184,12 +204,20 @@ export class WatermarkContribution implements IWorkbenchContribution {
container
.
classList
[
height
<=
478
?
'
add
'
:
'
remove
'
](
'
max-height-478px
'
);
container
.
classList
[
height
<=
478
?
'
add
'
:
'
remove
'
](
'
max-height-478px
'
);
};
};
update
();
update
();
watermark
.
build
(
container
.
firstElementChild
as
HTMLElement
,
0
);
this
.
watermark
.
build
(
container
.
firstElementChild
as
HTMLElement
,
0
);
layout
();
layout
();
this
.
toDispose
.
push
(
this
.
keybindingService
.
onDidUpdateKeybindings
(
update
));
this
.
toDispose
.
push
(
this
.
keybindingService
.
onDidUpdateKeybindings
(
update
));
this
.
toDispose
.
push
(
this
.
partService
.
onEditorLayout
(
layout
));
this
.
toDispose
.
push
(
this
.
partService
.
onEditorLayout
(
layout
));
}
}
private
destroy
():
void
{
if
(
this
.
watermark
)
{
this
.
watermark
.
destroy
();
this
.
partService
.
getContainer
(
Parts
.
EDITOR_PART
).
classList
.
remove
(
'
has-watermark
'
);
this
.
dispose
();
}
}
public
dispose
():
void
{
public
dispose
():
void
{
this
.
toDispose
=
dispose
(
this
.
toDispose
);
this
.
toDispose
=
dispose
(
this
.
toDispose
);
}
}
...
@@ -197,3 +225,17 @@ export class WatermarkContribution implements IWorkbenchContribution {
...
@@ -197,3 +225,17 @@ export class WatermarkContribution implements IWorkbenchContribution {
Registry
.
as
<
IWorkbenchContributionsRegistry
>
(
WorkbenchExtensions
.
Workbench
)
Registry
.
as
<
IWorkbenchContributionsRegistry
>
(
WorkbenchExtensions
.
Workbench
)
.
registerWorkbenchContribution
(
WatermarkContribution
);
.
registerWorkbenchContribution
(
WatermarkContribution
);
Registry
.
as
<
IConfigurationRegistry
>
(
ConfigurationExtensions
.
Configuration
)
.
registerConfiguration
({
'
id
'
:
'
workbench
'
,
'
order
'
:
7
,
'
title
'
:
nls
.
localize
(
'
workbenchConfigurationTitle
'
,
"
Workbench
"
),
'
properties
'
:
{
'
workbench.tips.enabled
'
:
{
'
type
'
:
'
boolean
'
,
'
default
'
:
true
,
'
description
'
:
nls
.
localize
(
'
tips.enabled
'
,
"
When enabled, will show the watermark tips when no editor is open.
"
)
},
}
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录