Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
ea343d42
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,发现更多精彩内容 >>
提交
ea343d42
编写于
9月 20, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
icons: show when tabs are enabled
上级
3ccbc4a9
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
23 addition
and
37 deletion
+23
-37
src/vs/workbench/browser/parts/editor/media/notabstitle.css
src/vs/workbench/browser/parts/editor/media/notabstitle.css
+5
-0
src/vs/workbench/browser/parts/editor/media/titlecontrol.css
src/vs/workbench/browser/parts/editor/media/titlecontrol.css
+3
-4
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+15
-33
未找到文件。
src/vs/workbench/browser/parts/editor/media/notabstitle.css
浏览文件 @
ea343d42
...
...
@@ -38,6 +38,11 @@
text-overflow
:
ellipsis
;
position
:
relative
;
padding-left
:
2px
;
font-style
:
italic
;
}
.monaco-workbench
>
.part.editor
>
.content
>
.one-editor-silo
>
.container
>
.title.pinned
.title-label
{
font-style
:
normal
;
}
/* Title Actions */
...
...
src/vs/workbench/browser/parts/editor/media/titlecontrol.css
浏览文件 @
ea343d42
...
...
@@ -9,12 +9,11 @@
.monaco-workbench
>
.part.editor
>
.content
>
.one-editor-silo
>
.container
>
.title
.tabs-container
>
.tab
.tab-label
{
white-space
:
nowrap
;
flex
:
1
;
font-style
:
italic
;
}
.monaco-workbench
>
.part.editor
>
.content
>
.one-editor-silo
>
.container
>
.title
.pinned
.title-label
,
.monaco-workbench
>
.part.editor
>
.content
>
.one-editor-silo
>
.container
>
.title
.tabs-container
>
.tab
.pinned
.tab-label
{
font-style
:
normal
;
.monaco-workbench
>
.part.editor
>
.content
>
.one-editor-silo
>
.container
>
.title
.monaco-icon-label
::before
,
.monaco-workbench
>
.part.editor
>
.content
>
.one-editor-silo
>
.container
>
.title
.tabs-container
>
.tab
.monaco-icon-label
::before
{
height
:
16px
;
/* tweak the icon size of the editor labels when icons are enabled */
}
.monaco-workbench
>
.part.editor
>
.content
>
.one-editor-silo
>
.container
>
.title
.title-label
a
,
...
...
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
浏览文件 @
ea343d42
...
...
@@ -12,9 +12,10 @@ import DOM = require('vs/base/browser/dom');
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
MIME_BINARY
}
from
'
vs/base/common/mime
'
;
import
{
Position
,
IEditorInput
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEditorGroup
,
IEditorIdentifier
,
asFileEditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorGroup
,
IEditorIdentifier
,
asFileEditorInput
,
getResource
}
from
'
vs/workbench/common/editor
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
EditorLabel
}
from
'
vs/workbench/browser/parts/editor/editorLabel
'
;
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
...
...
@@ -48,6 +49,7 @@ export class TabsTitleControl extends TitleControl {
private
titleContainer
:
HTMLElement
;
private
tabsContainer
:
HTMLElement
;
private
activeTab
:
HTMLElement
;
private
editorLabels
:
EditorLabel
[];
private
scrollbar
:
ScrollableElement
;
private
tabDisposeables
:
IDisposable
[]
=
[];
...
...
@@ -68,6 +70,7 @@ export class TabsTitleControl extends TitleControl {
super
(
contextMenuService
,
instantiationService
,
configurationService
,
editorService
,
editorGroupService
,
contextKeyService
,
keybindingService
,
telemetryService
,
messageService
,
menuService
,
quickOpenService
);
this
.
tabDisposeables
=
[];
this
.
editorLabels
=
[];
}
public
setContext
(
group
:
IEditorGroup
):
void
{
...
...
@@ -85,6 +88,7 @@ export class TabsTitleControl extends TitleControl {
this
.
tabsContainer
=
document
.
createElement
(
'
div
'
);
this
.
tabsContainer
.
setAttribute
(
'
role
'
,
'
tablist
'
);
DOM
.
addClass
(
this
.
tabsContainer
,
'
tabs-container
'
);
DOM
.
addClass
(
this
.
tabsContainer
,
'
show-file-icons
'
);
// Forward scrolling inside the container to our custom scrollbar
this
.
toDispose
.
push
(
DOM
.
addDisposableListener
(
this
.
tabsContainer
,
DOM
.
EventType
.
SCROLL
,
e
=>
{
...
...
@@ -198,10 +202,6 @@ export class TabsTitleControl extends TitleControl {
editorsOfGroup
.
forEach
((
editor
,
index
)
=>
{
const
tabContainer
=
this
.
tabsContainer
.
children
[
index
];
if
(
tabContainer
instanceof
HTMLElement
)
{
const
tabLabelsContainer
=
<
HTMLElement
>
tabContainer
.
children
[
0
];
const
tabLabel
=
<
HTMLAnchorElement
>
tabLabelsContainer
.
children
[
0
];
const
tabDescription
=
<
HTMLSpanElement
>
tabLabelsContainer
.
children
[
1
];
const
isPinned
=
group
.
isPinned
(
editor
);
const
isActive
=
group
.
isActive
(
editor
);
const
isDirty
=
editor
.
isDirty
();
...
...
@@ -211,23 +211,13 @@ export class TabsTitleControl extends TitleControl {
const
description
=
label
.
hasAmbiguousName
&&
label
.
description
?
label
.
description
:
''
;
const
verboseDescription
=
label
.
verboseDescription
||
''
;
//
Label & Description
//
Container
tabContainer
.
setAttribute
(
'
aria-label
'
,
`tab,
${
name
}
`
);
tabContainer
.
title
=
verboseDescription
;
tabLabel
.
innerText
=
name
;
tabDescription
.
innerText
=
description
;
if
(
description
)
{
DOM
.
show
(
tabDescription
);
}
else
{
DOM
.
hide
(
tabDescription
);
}
// Pinned state
if
(
isPinned
)
{
DOM
.
addClass
(
tabContainer
,
'
pinned
'
);
}
else
{
DOM
.
removeClass
(
tabContainer
,
'
pinned
'
);
}
// Label
const
tabLabel
=
this
.
editorLabels
[
index
];
tabLabel
.
setLabel
({
name
,
description
,
resource
:
getResource
(
editor
)
},
{
extraClasses
:
[
'
tab-label
'
],
italic
:
!
isPinned
});
// Active state
if
(
isActive
)
{
...
...
@@ -325,8 +315,9 @@ export class TabsTitleControl extends TitleControl {
private
clearTabs
():
void
{
DOM
.
clearNode
(
this
.
tabsContainer
);
dispose
(
this
.
tabDisposeables
);
this
.
tabDisposeables
=
[];
this
.
tabDisposeables
=
dispose
(
this
.
tabDisposeables
);
this
.
editorLabels
=
dispose
(
this
.
editorLabels
);
}
private
refreshTabs
(
group
:
IEditorGroup
):
void
{
...
...
@@ -347,18 +338,9 @@ export class TabsTitleControl extends TitleControl {
DOM
.
addClass
(
tabContainer
,
'
tab monaco-editor-background
'
);
tabContainers
.
push
(
tabContainer
);
// Tab Label Container
const
tabLabelContainer
=
document
.
createElement
(
'
div
'
);
tabContainer
.
appendChild
(
tabLabelContainer
);
DOM
.
addClass
(
tabLabelContainer
,
'
tab-label
'
);
// Tab Label
const
tabLabel
=
document
.
createElement
(
'
a
'
);
tabLabelContainer
.
appendChild
(
tabLabel
);
// Tab Description
const
tabDescription
=
document
.
createElement
(
'
span
'
);
tabLabelContainer
.
appendChild
(
tabDescription
);
// Tab Editor Label
const
editorLabel
=
this
.
instantiationService
.
createInstance
(
EditorLabel
,
tabContainer
);
this
.
editorLabels
.
push
(
editorLabel
);
// Tab Close
const
tabCloseContainer
=
document
.
createElement
(
'
div
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录