Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b308dfe0
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,发现更多精彩内容 >>
提交
b308dfe0
编写于
6月 15, 2018
作者:
C
Christof Marti
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enablement flag (#49340)
上级
8f2369ee
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
35 addition
and
8 deletion
+35
-8
src/vs/workbench/browser/parts/quickinput/quickInput.ts
src/vs/workbench/browser/parts/quickinput/quickInput.ts
+27
-8
src/vs/workbench/browser/parts/quickinput/quickInputBox.ts
src/vs/workbench/browser/parts/quickinput/quickInputBox.ts
+4
-0
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
+4
-0
未找到文件。
src/vs/workbench/browser/parts/quickinput/quickInput.ts
浏览文件 @
b308dfe0
...
...
@@ -36,7 +36,7 @@ import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorG
import
{
IContextKeyService
,
RawContextKey
,
IContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ICommandAndKeybindingRule
,
KeybindingsRegistry
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
inQuickOpenContext
}
from
'
vs/workbench/browser/parts/quickopen/quickopen
'
;
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionBar
,
ActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
IdGenerator
}
from
'
vs/base/common/idGenerator
'
;
...
...
@@ -56,6 +56,7 @@ interface QuickInputUI {
ignoreFocusOut
:
boolean
;
show
(
controller
:
QuickInput
):
void
;
setVisibilities
(
visibilities
:
Visibilities
):
void
;
setEnabled
(
enabled
:
boolean
):
void
;
hide
():
void
;
}
...
...
@@ -96,7 +97,7 @@ class QuickInput implements IQuickInput {
set
enabled
(
enabled
:
boolean
)
{
this
.
_enabled
=
enabled
;
this
.
update
();
// TODO
this
.
update
();
}
get
busy
()
{
...
...
@@ -177,6 +178,7 @@ class QuickInput implements IQuickInput {
return
action
;
}),
{
icon
:
true
,
label
:
false
});
}
this
.
ui
.
setEnabled
(
this
.
enabled
);
}
public
dispose
():
void
{
...
...
@@ -574,7 +576,9 @@ export class QuickInputService extends Component implements IQuickInputService {
private
filterContainer
:
HTMLElement
;
private
countContainer
:
HTMLElement
;
private
okContainer
:
HTMLElement
;
private
ok
:
Button
;
private
ui
:
QuickInputUI
;
private
enabled
=
true
;
private
inQuickOpenWidgets
:
Record
<
string
,
boolean
>
=
{};
private
inQuickOpenContext
:
IContextKey
<
boolean
>
;
private
onDidAcceptEmitter
=
new
Emitter
<
void
>
();
...
...
@@ -651,11 +655,11 @@ export class QuickInputService extends Component implements IQuickInputService {
this
.
toUnbind
.
push
(
attachBadgeStyler
(
count
,
this
.
themeService
));
this
.
okContainer
=
dom
.
append
(
headerContainer
,
$
(
'
.quick-input-action
'
));
const
ok
=
new
Button
(
this
.
okContainer
);
attachButtonStyler
(
ok
,
this
.
themeService
);
ok
.
label
=
localize
(
'
ok
'
,
"
OK
"
);
this
.
toUnbind
.
push
(
ok
.
onDidClick
(
e
=>
{
this
.
onDidAcceptEmitter
.
fire
();
// TODO: make single-select QuickPick exclusively use Accept?
this
.
ok
=
new
Button
(
this
.
okContainer
);
attachButtonStyler
(
this
.
ok
,
this
.
themeService
);
this
.
ok
.
label
=
localize
(
'
ok
'
,
"
OK
"
);
this
.
toUnbind
.
push
(
this
.
ok
.
onDidClick
(
e
=>
{
this
.
onDidAcceptEmitter
.
fire
();
}));
const
actionBar
=
new
ActionBar
(
headerContainer
);
...
...
@@ -740,7 +744,8 @@ export class QuickInputService extends Component implements IQuickInputService {
ignoreFocusOut
:
false
,
show
:
controller
=>
this
.
show
(
controller
),
hide
:
()
=>
this
.
hide
(),
setVisibilities
:
visibilities
=>
this
.
setVisibilities
(
visibilities
)
setVisibilities
:
visibilities
=>
this
.
setVisibilities
(
visibilities
),
setEnabled
:
enabled
=>
this
.
setEnabled
(
enabled
),
};
this
.
updateStyles
();
}
...
...
@@ -877,6 +882,7 @@ export class QuickInputService extends Component implements IQuickInputService {
oldController
.
didHide
();
}
this
.
setEnabled
(
true
);
this
.
ui
.
checkAll
.
checked
=
false
;
// this.ui.inputBox.value = ''; Avoid triggering an event.
this
.
ui
.
inputBox
.
placeholder
=
''
;
...
...
@@ -909,6 +915,19 @@ export class QuickInputService extends Component implements IQuickInputService {
this
.
updateLayout
();
// TODO
}
private
setEnabled
(
enabled
:
boolean
)
{
if
(
enabled
!==
this
.
enabled
)
{
this
.
enabled
=
enabled
;
this
.
ui
.
checkAll
.
disabled
=
!
enabled
;
this
.
ui
.
inputBox
.
enabled
=
enabled
;
for
(
const
item
of
this
.
ui
.
actionBar
.
items
)
{
(
item
as
ActionItem
).
getAction
().
enabled
=
enabled
;
}
this
.
ok
.
enabled
=
enabled
;
this
.
ui
.
list
.
enabled
=
enabled
;
}
}
private
hide
(
focusLost
?:
boolean
)
{
const
controller
=
this
.
controller
;
if
(
controller
)
{
...
...
src/vs/workbench/browser/parts/quickinput/quickInputBox.ts
浏览文件 @
b308dfe0
...
...
@@ -83,6 +83,10 @@ export class QuickInputBox {
this
.
inputBox
.
inputElement
.
type
=
password
?
'
password
'
:
'
text
'
;
}
set
enabled
(
enabled
:
boolean
)
{
this
.
inputBox
.
setEnabled
(
enabled
);
}
showDecoration
(
decoration
:
Severity
):
void
{
if
(
decoration
===
Severity
.
Ignore
)
{
this
.
inputBox
.
hideMessage
();
...
...
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
浏览文件 @
b308dfe0
...
...
@@ -291,6 +291,10 @@ export class QuickInputList {
.
map
(
e
=>
e
.
item
);
}
set
enabled
(
value
:
boolean
)
{
this
.
list
.
getHTMLElement
().
style
.
pointerEvents
=
value
?
null
:
'
none
'
;
}
focus
(
what
:
'
First
'
|
'
Last
'
|
'
Next
'
|
'
Previous
'
|
'
NextPage
'
|
'
PreviousPage
'
):
void
{
if
(
!
this
.
list
.
length
)
{
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录