Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a0515f04
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,体验更适合开发者的 AI 搜索 >>
提交
a0515f04
编写于
2月 18, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
notifications - animate toasts
上级
37b0eb1a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
9 deletion
+22
-9
src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css
...browser/parts/notifications/media/notificationsToasts.css
+8
-0
src/vs/workbench/browser/parts/notifications/notificationsCenter.ts
...kbench/browser/parts/notifications/notificationsCenter.ts
+1
-1
src/vs/workbench/browser/parts/notifications/notificationsToasts.ts
...kbench/browser/parts/notifications/notificationsToasts.ts
+13
-8
未找到文件。
src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css
浏览文件 @
a0515f04
...
...
@@ -24,4 +24,12 @@
.monaco-workbench
>
.notifications-toasts
.notification-toast
{
margin
:
5px
;
/* enables separation and drop shadows around toasts */
position
:
relative
;
-webkit-transition
:
left
200ms
linear
;
-ms-transition
:
left
200ms
linear
;
-moz-transition
:
left
200ms
linear
;
-khtml-transition
:
left
200ms
linear
;
-o-transition
:
left
200ms
linear
;
transition
:
left
200ms
linear
;
}
\ No newline at end of file
src/vs/workbench/browser/parts/notifications/notificationsCenter.ts
浏览文件 @
a0515f04
...
...
@@ -178,7 +178,7 @@ export class NotificationsCenter extends Themable {
// Make sure notifications are not exceding available width
availableWidth
=
this
.
workbenchDimensions
.
width
;
availableWidth
-=
(
2
*
12
);
// adjust for paddings left and right
availableWidth
-=
(
2
*
8
);
// adjust for paddings left and right
// Make sure notifications are not exceeding available height
availableHeight
=
this
.
workbenchDimensions
.
height
;
...
...
src/vs/workbench/browser/parts/notifications/notificationsToasts.ts
浏览文件 @
a0515f04
...
...
@@ -135,17 +135,15 @@ export class NotificationsToasts extends Themable {
this
.
removeToast
(
item
);
});
// Automatically hide
notifications without buttons after a timeout
if
(
item
.
actions
.
primary
.
length
===
0
)
{
// Automatically hide
collapsed notifications
if
(
!
item
.
expanded
)
{
let
timeoutHandle
:
number
;
const
hideAfterTimeout
=
()
=>
{
timeoutHandle
=
setTimeout
(()
=>
{
if
(
!
notificationList
.
hasFocus
())
{
if
(
item
.
actions
.
primary
.
length
===
0
)
{
this
.
removeToast
(
item
);
// only remove if actions are still not there (they can change after the fact)
}
if
(
!
notificationList
.
hasFocus
()
&&
!
item
.
expanded
)
{
this
.
removeToast
(
item
);
}
else
{
hideAfterTimeout
();
// push out disposal if item has focus
hideAfterTimeout
();
// push out disposal if item has focus
or is expanded
}
},
NotificationsToasts
.
PURGE_TIMEOUT
[
item
.
severity
]);
};
...
...
@@ -160,6 +158,13 @@ export class NotificationsToasts extends Themable {
// Context Key
this
.
notificationsToastsVisibleContextKey
.
set
(
true
);
// Animate In
notificationToastContainer
.
style
.
left
=
`
${
NotificationsToasts
.
MAX_DIMENSIONS
.
width
}
px`
;
const
animationHandle
=
setTimeout
(()
=>
{
notificationToastContainer
.
style
.
left
=
'
0px
'
;
});
itemDisposeables
.
push
(
toDisposable
(()
=>
clearTimeout
(
animationHandle
)));
}
private
removeToast
(
item
:
INotificationViewItem
):
void
{
...
...
@@ -313,7 +318,7 @@ export class NotificationsToasts extends Themable {
// Make sure notifications are not exceding available width
availableWidth
=
this
.
workbenchDimensions
.
width
;
availableWidth
-=
(
2
*
12
);
// adjust for paddings left and right
availableWidth
-=
(
2
*
8
);
// adjust for paddings left and right
// Make sure notifications are not exceeding available height
availableHeight
=
this
.
workbenchDimensions
.
height
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录