Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
2f5e355b
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,发现更多精彩内容 >>
未验证
提交
2f5e355b
编写于
4月 28, 2021
作者:
M
Megan Rogge
提交者:
GitHub
4月 28, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #122329 (#122576)
上级
968d6702
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
61 addition
and
10 deletion
+61
-10
src/vs/base/browser/ui/dropdown/dropdown.css
src/vs/base/browser/ui/dropdown/dropdown.css
+3
-3
src/vs/base/browser/ui/dropdown/dropdownWithPrimaryActionViewItem.ts
.../browser/ui/dropdown/dropdownWithPrimaryActionViewItem.ts
+57
-6
src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts
.../workbench/contrib/terminal/browser/terminalTabbedView.ts
+1
-1
未找到文件。
src/vs/base/browser/ui/dropdown/dropdown.css
浏览文件 @
2f5e355b
...
...
@@ -21,16 +21,16 @@
}
.monaco-dropdown-with-primary
{
display
:
flex
;
display
:
flex
!important
;
flex-direction
:
row
;
border-radius
:
5px
;
}
.monaco-dropdown-with-primary
>
.action-label
{
.monaco-dropdown-with-primary
>
.action-
container
>
.action-
label
{
margin-right
:
0
;
}
.monaco-dropdown-with-primary
>
.monaco-dropdown
>
.dropdown-label
.codicon
[
class
*=
'codicon-'
]
{
.monaco-dropdown-with-primary
>
.
dropdown-action-container
>
.
monaco-dropdown
>
.dropdown-label
.codicon
[
class
*=
'codicon-'
]
{
font-size
:
12px
;
padding-left
:
0px
;
padding-right
:
0px
;
...
...
src/vs/base/browser/ui/dropdown/dropdownWithPrimaryActionViewItem.ts
浏览文件 @
2f5e355b
...
...
@@ -8,17 +8,21 @@ import { ActionViewItem, BaseActionViewItem } from 'vs/base/browser/ui/actionbar
import
{
DropdownMenuActionViewItem
}
from
'
vs/base/browser/ui/dropdown/dropdownActionViewItem
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
export
class
DropdownWithPrimaryActionViewItem
extends
BaseActionViewItem
{
private
_primaryAction
:
ActionViewItem
;
private
_dropdown
:
DropdownMenuActionViewItem
;
private
_container
:
HTMLElement
|
null
=
null
;
private
toDispose
:
IDisposable
[];
constructor
(
primaryAction
:
IAction
,
dropdownAction
:
IAction
,
dropdownMenuActions
:
IAction
[],
private
readonly
_className
:
string
,
_className
:
string
,
private
readonly
_contextMenuProvider
:
IContextMenuProvider
,
dropdownIcon
?:
string
)
{
...
...
@@ -30,16 +34,63 @@ export class DropdownWithPrimaryActionViewItem extends BaseActionViewItem {
this
.
_dropdown
=
new
DropdownMenuActionViewItem
(
dropdownAction
,
dropdownMenuActions
,
this
.
_contextMenuProvider
,
{
menuAsChild
:
true
});
this
.
toDispose
=
[];
}
override
render
(
container
:
HTMLElement
):
void
{
this
.
_container
=
container
;
super
.
render
(
this
.
_container
);
this
.
element
=
DOM
.
append
(
this
.
_container
,
DOM
.
$
(
''
));
this
.
element
.
className
=
this
.
_className
;
this
.
element
.
classList
.
add
(
'
monaco-dropdown-with-primary
'
);
this
.
_primaryAction
.
render
(
this
.
element
);
this
.
_dropdown
.
render
(
this
.
element
);
this
.
_container
.
classList
.
add
(
'
monaco-dropdown-with-primary
'
);
const
primaryContainer
=
DOM
.
$
(
'
.action-container
'
);
this
.
_primaryAction
.
render
(
DOM
.
append
(
this
.
_container
,
primaryContainer
));
const
dropdownContainer
=
DOM
.
$
(
'
.dropdown-action-container
'
);
this
.
_dropdown
.
render
(
DOM
.
append
(
this
.
_container
,
dropdownContainer
));
this
.
toDispose
.
push
(
DOM
.
addDisposableListener
(
primaryContainer
,
DOM
.
EventType
.
KEY_DOWN
,
(
e
:
KeyboardEvent
)
=>
{
const
event
=
new
StandardKeyboardEvent
(
e
);
if
(
event
.
equals
(
KeyCode
.
RightArrow
))
{
this
.
_primaryAction
.
element
!
.
tabIndex
=
-
1
;
this
.
_dropdown
.
focus
();
event
.
stopPropagation
();
}
}));
this
.
toDispose
.
push
(
DOM
.
addDisposableListener
(
dropdownContainer
,
DOM
.
EventType
.
KEY_DOWN
,
(
e
:
KeyboardEvent
)
=>
{
const
event
=
new
StandardKeyboardEvent
(
e
);
if
(
event
.
equals
(
KeyCode
.
LeftArrow
))
{
this
.
_primaryAction
.
element
!
.
tabIndex
=
0
;
this
.
_dropdown
.
setFocusable
(
false
);
this
.
_primaryAction
.
element
?.
focus
();
event
.
stopPropagation
();
}
}));
}
override
focus
(
fromRight
?:
boolean
):
void
{
if
(
fromRight
)
{
this
.
_dropdown
.
focus
();
}
else
{
this
.
_primaryAction
.
element
!
.
tabIndex
=
0
;
this
.
_primaryAction
.
element
!
.
focus
();
}
}
override
blur
():
void
{
this
.
_primaryAction
.
element
!
.
tabIndex
=
-
1
;
this
.
_dropdown
.
blur
();
this
.
_container
!
.
blur
();
}
override
setFocusable
(
focusable
:
boolean
):
void
{
if
(
focusable
)
{
this
.
_primaryAction
.
element
!
.
tabIndex
=
0
;
}
else
{
this
.
_primaryAction
.
element
!
.
tabIndex
=
-
1
;
this
.
_dropdown
.
setFocusable
(
false
);
}
}
override
dispose
():
void
{
this
.
toDispose
=
dispose
(
this
.
toDispose
);
}
update
(
dropdownAction
:
IAction
,
dropdownMenuActions
:
IAction
[],
dropdownIcon
?:
string
):
void
{
...
...
src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts
浏览文件 @
2f5e355b
...
...
@@ -150,7 +150,7 @@ export class TerminalTabbedView extends Disposable {
private
_shouldShowTabs
():
boolean
{
const
enable
=
this
.
_terminalService
.
configHelper
.
config
.
tabs
.
enabled
;
const
hideForSingle
=
this
.
_terminalService
.
configHelper
.
config
.
tabs
.
hideCondition
===
'
singleTerminal
'
;
const
hideForSingle
=
this
.
_terminalService
.
configHelper
.
config
.
tabs
.
showActiveTerminal
===
'
singleTerminal
'
;
return
enable
&&
(
!
hideForSingle
||
(
hideForSingle
&&
this
.
_terminalService
.
terminalInstances
.
length
>
1
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录