Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
73937721
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,发现更多精彩内容 >>
提交
73937721
编写于
1月 16, 2020
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add description property to quick pick
上级
4f7f8587
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
2 deletion
+33
-2
src/vs/platform/quickinput/common/quickInput.ts
src/vs/platform/quickinput/common/quickInput.ts
+2
-0
src/vs/workbench/browser/parts/quickinput/media/quickInput.css
...s/workbench/browser/parts/quickinput/media/quickInput.css
+4
-0
src/vs/workbench/browser/parts/quickinput/quickInput.ts
src/vs/workbench/browser/parts/quickinput/quickInput.ts
+27
-2
未找到文件。
src/vs/platform/quickinput/common/quickInput.ts
浏览文件 @
73937721
...
...
@@ -131,6 +131,8 @@ export interface IQuickInput {
title
:
string
|
undefined
;
description
:
string
|
undefined
;
step
:
number
|
undefined
;
totalSteps
:
number
|
undefined
;
...
...
src/vs/workbench/browser/parts/quickinput/media/quickInput.css
浏览文件 @
73937721
...
...
@@ -45,6 +45,10 @@
background-repeat
:
no-repeat
;
}
.quick-input-description
{
margin
:
6px
;
}
.quick-input-header
{
display
:
flex
;
padding
:
6px
6px
0px
6px
;
...
...
src/vs/workbench/browser/parts/quickinput/quickInput.ts
浏览文件 @
73937721
...
...
@@ -64,6 +64,7 @@ interface QuickInputUI {
leftActionBar
:
ActionBar
;
titleBar
:
HTMLElement
;
title
:
HTMLElement
;
description
:
HTMLElement
;
rightActionBar
:
ActionBar
;
checkAll
:
HTMLInputElement
;
filterContainer
:
HTMLElement
;
...
...
@@ -95,6 +96,7 @@ interface QuickInputUI {
type
Visibilities
=
{
title
?:
boolean
;
description
?:
boolean
;
checkAll
?:
boolean
;
inputBox
?:
boolean
;
visibleCount
?:
boolean
;
...
...
@@ -108,6 +110,7 @@ type Visibilities = {
class
QuickInput
extends
Disposable
implements
IQuickInput
{
private
_title
:
string
|
undefined
;
private
_description
:
string
|
undefined
;
private
_steps
:
number
|
undefined
;
private
_totalSteps
:
number
|
undefined
;
protected
visible
=
false
;
...
...
@@ -139,6 +142,15 @@ class QuickInput extends Disposable implements IQuickInput {
this
.
update
();
}
get
description
()
{
return
this
.
_description
;
}
set
description
(
description
:
string
|
undefined
)
{
this
.
_description
=
description
;
this
.
update
();
}
get
step
()
{
return
this
.
_steps
;
}
...
...
@@ -244,6 +256,10 @@ class QuickInput extends Disposable implements IQuickInput {
if
(
this
.
ui
.
title
.
textContent
!==
title
)
{
this
.
ui
.
title
.
textContent
=
title
;
}
const
description
=
this
.
getDescription
();
if
(
this
.
ui
.
description
.
textContent
!==
description
)
{
this
.
ui
.
description
.
textContent
=
description
;
}
if
(
this
.
busy
&&
!
this
.
busyDelay
)
{
this
.
busyDelay
=
new
TimeoutTimer
();
this
.
busyDelay
.
setIfNotSet
(()
=>
{
...
...
@@ -298,6 +314,10 @@ class QuickInput extends Disposable implements IQuickInput {
return
''
;
}
private
getDescription
()
{
return
this
.
description
||
''
;
}
private
getSteps
()
{
if
(
this
.
step
&&
this
.
totalSteps
)
{
return
localize
(
'
quickInput.steps
'
,
"
{0}/{1}
"
,
this
.
step
,
this
.
totalSteps
);
...
...
@@ -713,7 +733,7 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
if
(
!
this
.
visible
)
{
return
;
}
this
.
ui
.
setVisibilities
(
this
.
canSelectMany
?
{
title
:
!!
this
.
title
||
!!
this
.
step
,
checkAll
:
true
,
inputBox
:
true
,
visibleCount
:
true
,
count
:
true
,
ok
:
true
,
list
:
true
,
message
:
!!
this
.
validationMessage
,
customButton
:
this
.
customButton
}
:
{
title
:
!!
this
.
title
||
!!
this
.
step
,
inputBox
:
true
,
visibleCount
:
true
,
list
:
true
,
message
:
!!
this
.
validationMessage
,
customButton
:
this
.
customButton
,
ok
:
this
.
ok
});
this
.
ui
.
setVisibilities
(
this
.
canSelectMany
?
{
title
:
!!
this
.
title
||
!!
this
.
step
,
description
:
!!
this
.
description
,
checkAll
:
true
,
inputBox
:
true
,
visibleCount
:
true
,
count
:
true
,
ok
:
this
.
ok
,
list
:
true
,
message
:
!!
this
.
validationMessage
,
customButton
:
this
.
customButton
}
:
{
title
:
!!
this
.
title
||
!!
this
.
step
,
description
:
!!
this
.
description
,
inputBox
:
true
,
visibleCount
:
true
,
list
:
true
,
message
:
!!
this
.
validationMessage
,
customButton
:
this
.
customButton
,
ok
:
this
.
ok
});
super
.
update
();
if
(
this
.
ui
.
inputBox
.
value
!==
this
.
value
)
{
this
.
ui
.
inputBox
.
value
=
this
.
value
;
...
...
@@ -872,7 +892,7 @@ class InputBox extends QuickInput implements IInputBox {
if
(
!
this
.
visible
)
{
return
;
}
this
.
ui
.
setVisibilities
({
title
:
!!
this
.
title
||
!!
this
.
step
,
inputBox
:
true
,
message
:
true
});
this
.
ui
.
setVisibilities
({
title
:
!!
this
.
title
||
!!
this
.
step
,
description
:
!!
this
.
description
||
!!
this
.
step
,
inputBox
:
true
,
message
:
true
});
super
.
update
();
if
(
this
.
ui
.
inputBox
.
value
!==
this
.
value
)
{
this
.
ui
.
inputBox
.
value
=
this
.
value
;
...
...
@@ -1037,6 +1057,8 @@ export class QuickInputService extends Component implements IQuickInputService {
const
rightActionBar
=
this
.
_register
(
new
ActionBar
(
titleBar
));
rightActionBar
.
domNode
.
classList
.
add
(
'
quick-input-right-action-bar
'
);
const
description
=
dom
.
append
(
container
,
$
(
'
.quick-input-description
'
));
const
headerContainer
=
dom
.
append
(
container
,
$
(
'
.quick-input-header
'
));
const
checkAll
=
<
HTMLInputElement
>
dom
.
append
(
headerContainer
,
$
(
'
input.quick-input-check-all
'
));
...
...
@@ -1166,6 +1188,7 @@ export class QuickInputService extends Component implements IQuickInputService {
leftActionBar
,
titleBar
,
title
,
description
,
rightActionBar
,
checkAll
,
filterContainer
,
...
...
@@ -1377,6 +1400,7 @@ export class QuickInputService extends Component implements IQuickInputService {
this
.
setEnabled
(
true
);
ui
.
leftActionBar
.
clear
();
ui
.
title
.
textContent
=
''
;
ui
.
description
.
textContent
=
''
;
ui
.
rightActionBar
.
clear
();
ui
.
checkAll
.
checked
=
false
;
// ui.inputBox.value = ''; Avoid triggering an event.
...
...
@@ -1410,6 +1434,7 @@ export class QuickInputService extends Component implements IQuickInputService {
private
setVisibilities
(
visibilities
:
Visibilities
)
{
const
ui
=
this
.
getUI
();
ui
.
title
.
style
.
display
=
visibilities
.
title
?
''
:
'
none
'
;
ui
.
description
.
style
.
display
=
visibilities
.
description
?
''
:
'
none
'
;
ui
.
checkAll
.
style
.
display
=
visibilities
.
checkAll
?
''
:
'
none
'
;
ui
.
filterContainer
.
style
.
display
=
visibilities
.
inputBox
?
''
:
'
none
'
;
ui
.
visibleCountContainer
.
style
.
display
=
visibilities
.
visibleCount
?
''
:
'
none
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录