Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
d519182a
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
d519182a
编写于
3月 18, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
quick access - clean up actions for anything picker
上级
67432bb1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
28 addition
and
29 deletion
+28
-29
src/vs/base/parts/quickinput/browser/media/quickInput.css
src/vs/base/parts/quickinput/browser/media/quickInput.css
+13
-4
src/vs/base/parts/quickinput/browser/quickInputList.ts
src/vs/base/parts/quickinput/browser/quickInputList.ts
+5
-7
src/vs/base/parts/quickinput/common/quickInput.ts
src/vs/base/parts/quickinput/common/quickInput.ts
+5
-5
src/vs/workbench/browser/parts/editor/editorQuickAccess.ts
src/vs/workbench/browser/parts/editor/editorQuickAccess.ts
+2
-2
src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts
...s/workbench/contrib/search/browser/anythingQuickAccess.ts
+3
-11
未找到文件。
src/vs/base/parts/quickinput/browser/media/quickInput.css
浏览文件 @
d519182a
...
...
@@ -220,11 +220,20 @@
.quick-input-list
.quick-input-list-entry-action-bar
{
display
:
flex
;
visibility
:
hidden
;
/* not using display: none here to not flicker too much */
flex
:
0
;
overflow
:
visible
;
}
.quick-input-list
.quick-input-list-entry-action-bar
.action-label
{
/*
* By default, actions in the quick input action bar are hidden
* until hovered over them or selected. We do not use display:none
* so that the amount of visual flickering is little by reserving the
* space the button needs still.
*/
visibility
:
hidden
;
}
.quick-input-list
.quick-input-list-entry-action-bar
.action-label.codicon
{
margin
:
0
;
width
:
19px
;
...
...
@@ -244,8 +253,8 @@
margin-right
:
4px
;
/* separate actions */
}
.quick-input-list
.quick-input-list-entry
.always-visible-actions
.quick-input-list-entry-action-bar
,
.quick-input-list
.quick-input-list-entry
:hover
.quick-input-list-entry-action-bar
,
.quick-input-list
.monaco-list-row.focused
.quick-input-list-entry-action-bar
{
.quick-input-list
.quick-input-list-entry
.quick-input-list-entry-action-bar
.action-label.always-visible
,
.quick-input-list
.quick-input-list-entry
:hover
.quick-input-list-entry-action-bar
.action-label
,
.quick-input-list
.monaco-list-row.focused
.quick-input-list-entry-action-bar
.action-label
{
visibility
:
visible
;
}
src/vs/base/parts/quickinput/browser/quickInputList.ts
浏览文件 @
d519182a
...
...
@@ -181,7 +181,11 @@ class ListElementRenderer implements IListRenderer<ListElement, IListElementTemp
const
buttons
=
element
.
item
.
buttons
;
if
(
buttons
&&
buttons
.
length
)
{
data
.
actionBar
.
push
(
buttons
.
map
((
button
,
index
)
=>
{
const
action
=
new
Action
(
`id-
${
index
}
`
,
''
,
button
.
iconClass
||
(
button
.
iconPath
?
getIconClass
(
button
.
iconPath
)
:
undefined
),
true
,
()
=>
{
let
cssClasses
=
button
.
iconClass
||
(
button
.
iconPath
?
getIconClass
(
button
.
iconPath
)
:
undefined
);
if
(
button
.
alwaysVisible
)
{
cssClasses
=
cssClasses
?
`
${
cssClasses
}
always-visible`
:
'
always-visible
'
;
}
const
action
=
new
Action
(
`id-
${
index
}
`
,
''
,
cssClasses
,
true
,
()
=>
{
element
.
fireButtonTriggered
({
button
,
item
:
element
.
item
...
...
@@ -195,12 +199,6 @@ class ListElementRenderer implements IListRenderer<ListElement, IListElementTemp
}
else
{
dom
.
removeClass
(
data
.
entry
,
'
has-actions
'
);
}
if
(
element
.
item
.
buttonsAlwaysVisible
)
{
dom
.
addClass
(
data
.
entry
,
'
always-visible-actions
'
);
}
else
{
dom
.
removeClass
(
data
.
entry
,
'
always-visible-actions
'
);
}
}
disposeElement
(
element
:
ListElement
,
index
:
number
,
data
:
IListElementTemplateData
):
void
{
...
...
src/vs/base/parts/quickinput/common/quickInput.ts
浏览文件 @
d519182a
...
...
@@ -35,11 +35,6 @@ export interface IQuickPickItem {
strikethrough
?:
boolean
;
highlights
?:
IQuickPickItemHighlights
;
buttons
?:
IQuickInputButton
[];
/**
* Wether to always show the buttons. By default buttons
* are only visible when hovering over them with the mouse
*/
buttonsAlwaysVisible
?:
boolean
;
picked
?:
boolean
;
alwaysShow
?:
boolean
;
}
...
...
@@ -290,6 +285,11 @@ export interface IQuickInputButton {
/** iconPath or iconClass required */
iconClass
?:
string
;
tooltip
?:
string
;
/**
* Wether to always show the button. By default buttons
* are only visible when hovering over them with the mouse
*/
alwaysVisible
?:
boolean
;
}
export
interface
IQuickPickItemButtonEvent
<
T
extends
IQuickPickItem
>
{
...
...
src/vs/workbench/browser/parts/editor/editorQuickAccess.ts
浏览文件 @
d519182a
...
...
@@ -99,11 +99,11 @@ export abstract class BaseEditorQuickAccessProvider extends PickerQuickAccessPro
description
:
editor
.
getDescription
(),
iconClasses
:
getIconClasses
(
this
.
modelService
,
this
.
modeService
,
resource
),
italic
:
!
this
.
editorGroupService
.
getGroup
(
groupId
)?.
isPinned
(
editor
),
buttonsAlwaysVisible
:
isDirty
,
buttons
:
[
{
iconClass
:
isDirty
?
'
dirty-editor codicon-circle-filled
'
:
'
codicon-close
'
,
tooltip
:
localize
(
'
closeEditor
'
,
"
Close Editor
"
)
tooltip
:
localize
(
'
closeEditor
'
,
"
Close Editor
"
),
alwaysVisible
:
isDirty
}
],
trigger
:
async
()
=>
{
...
...
src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts
浏览文件 @
d519182a
...
...
@@ -404,7 +404,6 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
localize
(
'
filePickAriaLabel
'
,
"
{0}, file picker
"
,
label
),
description
,
iconClasses
:
getIconClasses
(
this
.
modelService
,
this
.
modeService
,
resource
),
buttonsAlwaysVisible
:
isDirty
,
buttons
:
(()
=>
{
const
openSideBySideDirection
=
this
.
configuration
.
openSideBySideDirection
;
const
buttons
:
IQuickInputButton
[]
=
[];
...
...
@@ -419,15 +418,8 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
if
(
isEditorHistoryEntry
)
{
buttons
.
push
({
iconClass
:
isDirty
?
'
dirty-anything codicon-circle-filled
'
:
'
codicon-close
'
,
tooltip
:
localize
(
'
closeEditor
'
,
"
Remove from Recently Opened
"
)
});
}
// Dirty indicator
else
if
(
isDirty
)
{
buttons
.
push
({
iconClass
:
'
codicon-circle-filled
'
,
tooltip
:
localize
(
'
dirtyFile
'
,
"
Dirty File
"
)
tooltip
:
localize
(
'
closeEditor
'
,
"
Remove from Recently Opened
"
),
alwaysVisible
:
isDirty
});
}
...
...
@@ -441,7 +433,7 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
this
.
openAnything
(
resourceOrEditor
,
{
keyMods
,
range
,
forceOpenSideBySide
:
true
});
return
TriggerAction
.
CLOSE_PICKER
;
// Remove from History
/ Dirty Indicator
// Remove from History
case
1
:
if
(
!
URI
.
isUri
(
resourceOrEditor
))
{
this
.
historyService
.
remove
(
resourceOrEditor
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录