Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
f5a2f271
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f5a2f271
编写于
3月 26, 2018
作者:
C
Christof Marti
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Progress bar (#45589)
上级
cad45237
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
44 addition
and
7 deletion
+44
-7
src/vs/workbench/browser/parts/quickinput/quickInput.css
src/vs/workbench/browser/parts/quickinput/quickInput.css
+6
-1
src/vs/workbench/browser/parts/quickinput/quickInput.ts
src/vs/workbench/browser/parts/quickinput/quickInput.ts
+33
-5
src/vs/workbench/browser/parts/quickinput/quickInputBox.ts
src/vs/workbench/browser/parts/quickinput/quickInputBox.ts
+5
-1
未找到文件。
src/vs/workbench/browser/parts/quickinput/quickInput.css
浏览文件 @
f5a2f271
...
...
@@ -14,7 +14,7 @@
.quick-input-header
{
display
:
flex
;
padding
:
6px
;
padding
:
6px
6px
4px
6px
;
}
.quick-input-select-all
{
...
...
@@ -53,6 +53,11 @@
outline
:
0
;
}
.quick-input-progress.monaco-progress-container
,
.quick-input-progress.monaco-progress-container
.progress-bit
{
height
:
2px
;
}
.quick-input-checkbox-list
{
line-height
:
22px
;
}
...
...
src/vs/workbench/browser/parts/quickinput/quickInput.ts
浏览文件 @
f5a2f271
...
...
@@ -28,6 +28,7 @@ import { CLOSE_ON_FOCUS_LOST_CONFIG } from 'vs/workbench/browser/quickopen';
import
{
CountBadge
}
from
'
vs/base/browser/ui/countBadge/countBadge
'
;
import
{
attachBadgeStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
ProgressBar
}
from
'
vs/base/browser/ui/progressbar/progressbar
'
;
const
$
=
dom
.
$
;
...
...
@@ -43,6 +44,8 @@ export class QuickInputService extends Component implements IQuickInputService {
private
selectAll
:
HTMLInputElement
;
private
inputBox
:
QuickInputBox
;
private
count
:
CountBadge
;
private
ready
=
false
;
private
progressBar
:
ProgressBar
;
private
checkboxList
:
QuickInputCheckboxList
;
private
ignoreFocusLost
=
false
;
...
...
@@ -99,7 +102,14 @@ export class QuickInputService extends Component implements IQuickInputService {
const
ok
=
dom
.
append
(
headerContainer
,
$
(
'
button.quick-input-action
'
));
ok
.
textContent
=
localize
(
'
ok
'
,
"
OK
"
);
this
.
toUnbind
.
push
(
dom
.
addDisposableListener
(
ok
,
dom
.
EventType
.
CLICK
,
e
=>
this
.
close
(
this
.
checkboxList
.
getSelectedElements
())));
this
.
toUnbind
.
push
(
dom
.
addDisposableListener
(
ok
,
dom
.
EventType
.
CLICK
,
e
=>
{
if
(
this
.
ready
)
{
this
.
close
(
this
.
checkboxList
.
getSelectedElements
());
}
}));
this
.
progressBar
=
new
ProgressBar
(
this
.
container
);
// TODO theme
this
.
progressBar
.
getContainer
().
addClass
(
'
quick-input-progress
'
);
this
.
checkboxList
=
this
.
instantiationService
.
createInstance
(
QuickInputCheckboxList
,
this
.
container
);
this
.
toUnbind
.
push
(
this
.
checkboxList
);
...
...
@@ -130,8 +140,10 @@ export class QuickInputService extends Component implements IQuickInputService {
const
event
=
new
StandardKeyboardEvent
(
e
);
switch
(
event
.
keyCode
)
{
case
KeyCode
.
Enter
:
dom
.
EventHelper
.
stop
(
e
,
true
);
this
.
close
(
this
.
checkboxList
.
getSelectedElements
());
if
(
this
.
ready
)
{
dom
.
EventHelper
.
stop
(
e
,
true
);
this
.
close
(
this
.
checkboxList
.
getSelectedElements
());
}
break
;
case
KeyCode
.
Escape
:
dom
.
EventHelper
.
stop
(
e
,
true
);
...
...
@@ -157,12 +169,15 @@ export class QuickInputService extends Component implements IQuickInputService {
this
.
resolve
();
}
this
.
inputBox
.
setValue
(
''
)
;
this
.
inputBox
.
value
=
''
;
this
.
inputBox
.
setPlaceholder
(
options
.
placeHolder
||
''
);
this
.
checkboxList
.
matchOnDescription
=
options
.
matchOnDescription
;
this
.
checkboxList
.
matchOnDetail
=
options
.
matchOnDetail
;
this
.
ignoreFocusLost
=
options
.
ignoreFocusLost
;
this
.
progressBar
.
stop
();
this
.
ready
=
false
;
this
.
checkboxList
.
setElements
([]);
this
.
selectAll
.
checked
=
this
.
checkboxList
.
getAllVisibleSelected
();
this
.
count
.
setCount
(
this
.
checkboxList
.
getSelectedCount
());
...
...
@@ -175,11 +190,24 @@ export class QuickInputService extends Component implements IQuickInputService {
const
d
=
token
.
onCancellationRequested
(()
=>
this
.
close
());
result
.
then
(()
=>
d
.
dispose
(),
()
=>
d
.
dispose
());
// TODO: Progress indication.
const
delay
=
TPromise
.
timeout
(
800
);
delay
.
then
(()
=>
this
.
progressBar
.
infinite
(),
()
=>
{
/* ignore */
});
const
wasResolve
=
this
.
resolve
;
picks
.
then
(
elements
=>
{
delay
.
cancel
();
if
(
this
.
resolve
!==
wasResolve
)
{
return
;
}
this
.
progressBar
.
stop
();
this
.
ready
=
true
;
this
.
checkboxList
.
setElements
(
elements
);
this
.
checkboxList
.
filter
(
this
.
inputBox
.
value
);
this
.
selectAll
.
checked
=
this
.
checkboxList
.
getAllVisibleSelected
();
this
.
count
.
setCount
(
this
.
checkboxList
.
getSelectedCount
());
this
.
updateLayout
();
}).
then
(
null
,
reason
=>
this
.
close
(
TPromise
.
wrapError
(
reason
)));
...
...
src/vs/workbench/browser/parts/quickinput/quickInputBox.ts
浏览文件 @
f5a2f271
...
...
@@ -50,7 +50,11 @@ export class QuickInputBox {
return
this
.
inputBox
.
onDidChange
(
handler
);
}
setValue
(
value
:
string
)
{
get
value
()
{
return
this
.
inputBox
.
value
;
}
set
value
(
value
:
string
)
{
this
.
inputBox
.
value
=
value
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录