Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
140c7116
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
140c7116
编写于
1月 17, 2020
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
repo pane: input placeholder
上级
20ccfb07
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
6 deletion
+32
-6
src/vs/workbench/contrib/scm/browser/media/scmViewlet.css
src/vs/workbench/contrib/scm/browser/media/scmViewlet.css
+12
-0
src/vs/workbench/contrib/scm/browser/repositoryPane.ts
src/vs/workbench/contrib/scm/browser/repositoryPane.ts
+20
-6
未找到文件。
src/vs/workbench/contrib/scm/browser/media/scmViewlet.css
浏览文件 @
140c7116
...
...
@@ -177,6 +177,18 @@
padding
:
1px
;
}
.scm-viewlet
.scm-editor-placeholder
{
position
:
absolute
;
pointer-events
:
none
;
z-index
:
1
;
margin
:
1px
;
padding
:
3px
4px
;
}
.scm-viewlet
.scm-editor-placeholder.hidden
{
display
:
none
;
}
.scm-viewlet
.scm-editor.scroll
>
.monaco-inputbox
>
.wrapper
>
textarea
.input
{
overflow-y
:
scroll
;
}
...
...
src/vs/workbench/contrib/scm/browser/repositoryPane.ts
浏览文件 @
140c7116
...
...
@@ -24,7 +24,7 @@ import { IAction, IActionViewItem, ActionRunner, Action } from 'vs/base/common/a
import
{
ContextAwareMenuEntryActionViewItem
}
from
'
vs/platform/actions/browser/menuEntryActionViewItem
'
;
import
{
SCMMenus
}
from
'
./menus
'
;
import
{
ActionBar
,
IActionViewItemProvider
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IThemeService
,
LIGHT
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IThemeService
,
LIGHT
,
registerThemingParticipant
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
isSCMResource
,
isSCMResourceGroup
,
connectPrimaryMenuToInlineActionBar
}
from
'
./util
'
;
import
{
attachBadgeStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
WorkbenchCompressibleObjectTree
}
from
'
vs/platform/list/browser/listService
'
;
...
...
@@ -60,6 +60,9 @@ import { MenuPreventer } from 'vs/workbench/contrib/codeEditor/browser/menuPreve
import
{
SelectionClipboardContributionID
}
from
'
vs/workbench/contrib/codeEditor/browser/selectionClipboard
'
;
import
{
ContextMenuController
}
from
'
vs/editor/contrib/contextmenu/contextmenu
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
format
}
from
'
vs/base/common/strings
'
;
import
{
inputPlaceholderForeground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
type
TreeElement
=
ISCMResourceGroup
|
IResourceNode
<
ISCMResource
,
ISCMResourceGroup
>
|
ISCMResource
;
...
...
@@ -666,13 +669,13 @@ export class RepositoryPane extends ViewPane {
this
.
inputContainer
=
append
(
container
,
$
(
'
.scm-editor
'
));
const
editorContainer
=
append
(
this
.
inputContainer
,
$
(
'
.scm-editor-container
'
));
// TODO@joao
const
placeholderTextContainer
=
append
(
editorContainer
,
$
(
'
.scm-editor-placeholder
'
));
const
updatePlaceholder
=
()
=>
{
//
const binding = this.keybindingService.lookupKeybinding('scm.acceptInput');
//
const label = binding ? binding.getLabel() : (platform.isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter');
// const placeholder
= format(this.repository.input.placeholder, label);
const
binding
=
this
.
keybindingService
.
lookupKeybinding
(
'
scm.acceptInput
'
);
const
label
=
binding
?
binding
.
getLabel
()
:
(
platform
.
isMacintosh
?
'
Cmd+Enter
'
:
'
Ctrl+Enter
'
);
const
placeholderText
=
format
(
this
.
repository
.
input
.
placeholder
,
label
);
// this.inputBox.setPlaceHolder(placeholder)
;
placeholderTextContainer
.
textContent
=
placeholderText
;
};
// const validationDelayer = new ThrottledDelayer<any>(200);
...
...
@@ -746,6 +749,10 @@ export class RepositoryPane extends ViewPane {
// this._register(this.inputBox.onDidChange(value => this.repository.input.value = value, null));
// this._register(this.repository.input.onDidChange(value => this.inputBox.value = value, null));
this
.
inputModel
.
onDidChangeContent
(()
=>
{
toggleClass
(
placeholderTextContainer
,
'
hidden
'
,
this
.
inputModel
.
getValueLength
()
>
0
);
});
updatePlaceholder
();
this
.
_register
(
this
.
repository
.
input
.
onDidChangePlaceholder
(
updatePlaceholder
,
null
));
this
.
_register
(
this
.
keybindingService
.
onDidUpdateKeybindings
(
updatePlaceholder
,
null
));
...
...
@@ -1030,3 +1037,10 @@ export class RepositoryViewDescriptor implements IViewDescriptor {
this
.
ctorDescriptor
=
new
SyncDescriptor
(
RepositoryPane
,
[
repository
]);
}
}
registerThemingParticipant
((
theme
,
collector
)
=>
{
let
inputPlaceholderForegroundColor
=
theme
.
getColor
(
inputPlaceholderForeground
);
if
(
inputPlaceholderForegroundColor
)
{
collector
.
addRule
(
`.scm-viewlet .scm-editor-placeholder { color:
${
inputPlaceholderForegroundColor
}
; }`
);
}
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录