Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c9b875a3
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,发现更多精彩内容 >>
提交
c9b875a3
编写于
3月 14, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow to open notifications center if there are no notifications (fixes #44509)
上级
ec3c0834
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
9 deletion
+19
-9
src/vs/workbench/browser/parts/notifications/notificationsCenter.ts
...kbench/browser/parts/notifications/notificationsCenter.ts
+18
-8
src/vs/workbench/browser/parts/notifications/notificationsStatus.ts
...kbench/browser/parts/notifications/notificationsStatus.ts
+1
-1
未找到文件。
src/vs/workbench/browser/parts/notifications/notificationsCenter.ts
浏览文件 @
c9b875a3
...
@@ -32,6 +32,7 @@ export class NotificationsCenter extends Themable {
...
@@ -32,6 +32,7 @@ export class NotificationsCenter extends Themable {
private
notificationsCenterContainer
:
HTMLElement
;
private
notificationsCenterContainer
:
HTMLElement
;
private
notificationsCenterHeader
:
HTMLElement
;
private
notificationsCenterHeader
:
HTMLElement
;
private
notificationsCenterTitle
:
HTMLSpanElement
;
private
notificationsList
:
NotificationsList
;
private
notificationsList
:
NotificationsList
;
private
_isVisible
:
boolean
;
private
_isVisible
:
boolean
;
private
workbenchDimensions
:
Dimension
;
private
workbenchDimensions
:
Dimension
;
...
@@ -71,10 +72,6 @@ export class NotificationsCenter extends Themable {
...
@@ -71,10 +72,6 @@ export class NotificationsCenter extends Themable {
}
}
public
show
():
void
{
public
show
():
void
{
if
(
this
.
model
.
notifications
.
length
===
0
)
{
return
;
// currently not supporting to show empty (https://github.com/Microsoft/vscode/issues/44509)
}
if
(
this
.
_isVisible
)
{
if
(
this
.
_isVisible
)
{
this
.
notificationsList
.
show
(
true
/* focus */
);
this
.
notificationsList
.
show
(
true
/* focus */
);
...
@@ -86,6 +83,9 @@ export class NotificationsCenter extends Themable {
...
@@ -86,6 +83,9 @@ export class NotificationsCenter extends Themable {
this
.
create
();
this
.
create
();
}
}
// Title
this
.
updateTitle
();
// Make visible
// Make visible
this
.
_isVisible
=
true
;
this
.
_isVisible
=
true
;
addClass
(
this
.
notificationsCenterContainer
,
'
visible
'
);
addClass
(
this
.
notificationsCenterContainer
,
'
visible
'
);
...
@@ -110,6 +110,14 @@ export class NotificationsCenter extends Themable {
...
@@ -110,6 +110,14 @@ export class NotificationsCenter extends Themable {
this
.
_onDidChangeVisibility
.
fire
();
this
.
_onDidChangeVisibility
.
fire
();
}
}
private
updateTitle
():
void
{
if
(
this
.
model
.
notifications
.
length
===
0
)
{
this
.
notificationsCenterTitle
.
innerText
=
localize
(
'
notificationsEmpty
'
,
"
No new notifications
"
);
}
else
{
this
.
notificationsCenterTitle
.
innerText
=
localize
(
'
notifications
'
,
"
Notifications
"
);
}
}
private
create
():
void
{
private
create
():
void
{
// Container
// Container
...
@@ -122,10 +130,9 @@ export class NotificationsCenter extends Themable {
...
@@ -122,10 +130,9 @@ export class NotificationsCenter extends Themable {
this
.
notificationsCenterContainer
.
appendChild
(
this
.
notificationsCenterHeader
);
this
.
notificationsCenterContainer
.
appendChild
(
this
.
notificationsCenterHeader
);
// Header Title
// Header Title
const
title
=
document
.
createElement
(
'
span
'
);
this
.
notificationsCenterTitle
=
document
.
createElement
(
'
span
'
);
addClass
(
title
,
'
notifications-center-header-title
'
);
addClass
(
this
.
notificationsCenterTitle
,
'
notifications-center-header-title
'
);
title
.
innerText
=
localize
(
'
notifications
'
,
"
Notifications
"
);
this
.
notificationsCenterHeader
.
appendChild
(
this
.
notificationsCenterTitle
);
this
.
notificationsCenterHeader
.
appendChild
(
title
);
// Header Toolbar
// Header Toolbar
const
toolbarContainer
=
document
.
createElement
(
'
div
'
);
const
toolbarContainer
=
document
.
createElement
(
'
div
'
);
...
@@ -184,6 +191,9 @@ export class NotificationsCenter extends Themable {
...
@@ -184,6 +191,9 @@ export class NotificationsCenter extends Themable {
break
;
break
;
}
}
// Update title
this
.
updateTitle
();
// Hide if no more notifications to show
// Hide if no more notifications to show
if
(
this
.
model
.
notifications
.
length
===
0
)
{
if
(
this
.
model
.
notifications
.
length
===
0
)
{
this
.
hide
();
this
.
hide
();
...
...
src/vs/workbench/browser/parts/notifications/notificationsStatus.ts
浏览文件 @
c9b875a3
...
@@ -75,7 +75,7 @@ export class NotificationsStatus {
...
@@ -75,7 +75,7 @@ export class NotificationsStatus {
// Create new
// Create new
this
.
statusItem
=
this
.
statusbarService
.
addEntry
({
this
.
statusItem
=
this
.
statusbarService
.
addEntry
({
text
:
this
.
count
===
0
?
'
$(bell)
'
:
`$(bell)
${
this
.
count
}
`
,
text
:
this
.
count
===
0
?
'
$(bell)
'
:
`$(bell)
${
this
.
count
}
`
,
command
:
this
.
isNotificationsCenterVisible
?
HIDE_NOTIFICATIONS_CENTER
:
this
.
model
.
notifications
.
length
>
0
?
SHOW_NOTIFICATIONS_CENTER
:
void
0
,
command
:
this
.
isNotificationsCenterVisible
?
HIDE_NOTIFICATIONS_CENTER
:
SHOW_NOTIFICATIONS_CENTER
,
tooltip
:
this
.
getTooltip
(),
tooltip
:
this
.
getTooltip
(),
showBeak
:
this
.
isNotificationsCenterVisible
showBeak
:
this
.
isNotificationsCenterVisible
},
StatusbarAlignment
.
RIGHT
,
-
1000
/* towards the far end of the right hand side */
);
},
StatusbarAlignment
.
RIGHT
,
-
1000
/* towards the far end of the right hand side */
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录