Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4f724cbf
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,发现更多精彩内容 >>
提交
4f724cbf
编写于
2月 21, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
notifications - proper center rooting
上级
83dd7fcc
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
64 addition
and
18 deletion
+64
-18
src/vs/base/browser/ui/list/listView.ts
src/vs/base/browser/ui/list/listView.ts
+2
-0
src/vs/platform/statusbar/common/statusbar.ts
src/vs/platform/statusbar/common/statusbar.ts
+5
-0
src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css
...browser/parts/notifications/media/notificationsCenter.css
+2
-3
src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css
...browser/parts/notifications/media/notificationsToasts.css
+2
-3
src/vs/workbench/browser/parts/notifications/notificationsCenter.ts
...kbench/browser/parts/notifications/notificationsCenter.ts
+3
-3
src/vs/workbench/browser/parts/notifications/notificationsStatus.ts
...kbench/browser/parts/notifications/notificationsStatus.ts
+2
-1
src/vs/workbench/browser/parts/notifications/notificationsToasts.ts
...kbench/browser/parts/notifications/notificationsToasts.ts
+1
-1
src/vs/workbench/browser/parts/statusbar/media/statusbarpart.css
...workbench/browser/parts/statusbar/media/statusbarpart.css
+15
-1
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
+19
-4
src/vs/workbench/parts/debug/browser/statusbarColorProvider.ts
...s/workbench/parts/debug/browser/statusbarColorProvider.ts
+13
-2
未找到文件。
src/vs/base/browser/ui/list/listView.ts
浏览文件 @
4f724cbf
...
...
@@ -294,12 +294,14 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
item
.
row
.
domNode
.
style
.
top
=
`
${
this
.
elementTop
(
index
)}
px`
;
item
.
row
.
domNode
.
style
.
height
=
`
${
item
.
size
}
px`
;
item
.
row
.
domNode
.
setAttribute
(
'
data-index
'
,
`
${
index
}
`
);
item
.
row
.
domNode
.
setAttribute
(
'
data-last-element
'
,
index
===
this
.
length
-
1
?
'
true
'
:
'
false
'
);
renderer
.
renderElement
(
item
.
element
,
index
,
item
.
row
.
templateData
);
}
private
updateItemInDOM
(
item
:
IItem
<
T
>
,
index
:
number
):
void
{
item
.
row
.
domNode
.
style
.
top
=
`
${
this
.
elementTop
(
index
)}
px`
;
item
.
row
.
domNode
.
setAttribute
(
'
data-index
'
,
`
${
index
}
`
);
item
.
row
.
domNode
.
setAttribute
(
'
data-last-element
'
,
index
===
this
.
length
-
1
?
'
true
'
:
'
false
'
);
}
private
removeItemFromDOM
(
item
:
IItem
<
T
>
):
void
{
...
...
src/vs/platform/statusbar/common/statusbar.ts
浏览文件 @
4f724cbf
...
...
@@ -51,6 +51,11 @@ export interface IStatusbarEntry {
* An optional extension ID if this entry is provided from an extension.
*/
extensionId
?:
string
;
/**
* Wether to show a beak above the status bar entry.
*/
showBeak
?:
boolean
;
}
export
interface
IStatusbarService
{
...
...
src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css
浏览文件 @
4f724cbf
...
...
@@ -7,14 +7,13 @@
position
:
absolute
;
z-index
:
1000
;
right
:
8px
;
bottom
:
3
0px
;
/* above status bar */
bottom
:
3
1px
;
display
:
none
;
overflow
:
hidden
;
}
.monaco-workbench.nostatusbar
>
.notifications-center
{
right
:
12px
;
bottom
:
12px
;
bottom
:
8px
;
}
.monaco-workbench
>
.notifications-center.visible
{
...
...
src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css
浏览文件 @
4f724cbf
...
...
@@ -7,14 +7,13 @@
position
:
absolute
;
z-index
:
1000
;
right
:
3px
;
bottom
:
2
8px
;
/* above status bar */
bottom
:
2
6px
;
display
:
none
;
overflow
:
hidden
;
}
.monaco-workbench.nostatusbar
>
.notifications-toasts
{
right
:
12px
;
bottom
:
12px
;
bottom
:
3px
;
}
.monaco-workbench
>
.notifications-toasts.visible
{
...
...
src/vs/workbench/browser/parts/notifications/notificationsCenter.ts
浏览文件 @
4f724cbf
...
...
@@ -23,7 +23,7 @@ import { localize } from 'vs/nls';
export
class
NotificationsCenter
extends
Themable
{
private
static
MAX_DIMENSIONS
=
new
Dimension
(
60
0
,
400
);
private
static
MAX_DIMENSIONS
=
new
Dimension
(
45
0
,
400
);
private
notificationsCenterContainer
:
HTMLElement
;
private
notificationsList
:
NotificationsList
;
...
...
@@ -166,7 +166,7 @@ export class NotificationsCenter extends Themable {
protected
updateStyles
():
void
{
if
(
this
.
notificationsCenterContainer
)
{
const
widgetShadowColor
=
this
.
getColor
(
widgetShadow
);
this
.
notificationsCenterContainer
.
style
.
boxShadow
=
widgetShadowColor
?
`0
5
px 8px
${
widgetShadowColor
}
`
:
null
;
this
.
notificationsCenterContainer
.
style
.
boxShadow
=
widgetShadowColor
?
`0
0
px 8px
${
widgetShadowColor
}
`
:
null
;
}
}
...
...
@@ -219,6 +219,6 @@ export class NotificationsCenter extends Themable {
registerThemingParticipant
((
theme
:
ITheme
,
collector
:
ICssStyleCollector
)
=>
{
const
notificationBorderColor
=
theme
.
getColor
(
NOTIFICATIONS_BORDER
);
if
(
notificationBorderColor
)
{
collector
.
addRule
(
`.monaco-workbench > .notifications-center .notifications-list-container .notification-list-item { border-bottom: 1px solid
${
notificationBorderColor
}
; }`
);
collector
.
addRule
(
`.monaco-workbench > .notifications-center .notifications-list-container .
monaco-list-row[data-last-element="false"] > .
notification-list-item { border-bottom: 1px solid
${
notificationBorderColor
}
; }`
);
}
});
\ No newline at end of file
src/vs/workbench/browser/parts/notifications/notificationsStatus.ts
浏览文件 @
4f724cbf
...
...
@@ -72,7 +72,8 @@ export class NotificationsStatus {
this
.
statusItem
=
this
.
statusbarService
.
addEntry
({
text
:
this
.
counter
===
0
?
'
$(megaphone)
'
:
`$(megaphone)
${
this
.
counter
}
`
,
command
:
this
.
isNotificationsCenterVisible
?
HIDE_NOTIFICATIONS_CENTER_COMMAND_ID
:
this
.
model
.
notifications
.
length
>
0
?
SHOW_NOTIFICATIONS_CENTER_COMMAND_ID
:
void
0
,
tooltip
:
this
.
getTooltip
()
tooltip
:
this
.
getTooltip
(),
showBeak
:
this
.
isNotificationsCenterVisible
},
StatusbarAlignment
.
RIGHT
,
-
1000
/* towards the far end of the right hand side */
);
}
...
...
src/vs/workbench/browser/parts/notifications/notificationsToasts.ts
浏览文件 @
4f724cbf
...
...
@@ -299,7 +299,7 @@ export class NotificationsToasts extends Themable {
protected
updateStyles
():
void
{
this
.
mapNotificationToToast
.
forEach
(
toast
=>
{
const
widgetShadowColor
=
this
.
getColor
(
widgetShadow
);
toast
.
container
.
style
.
boxShadow
=
widgetShadowColor
?
`0
2
px 8px
${
widgetShadowColor
}
`
:
null
;
toast
.
container
.
style
.
boxShadow
=
widgetShadowColor
?
`0
0
px 8px
${
widgetShadowColor
}
`
:
null
;
});
}
...
...
src/vs/workbench/browser/parts/statusbar/media/statusbarpart.css
浏览文件 @
4f724cbf
...
...
@@ -9,7 +9,6 @@
height
:
22px
;
font-size
:
12px
;
padding
:
0
10px
;
overflow
:
hidden
;
}
.monaco-workbench
>
.part.statusbar
>
.statusbar-item
{
...
...
@@ -19,6 +18,21 @@
vertical-align
:
top
;
}
.monaco-workbench
>
.part.statusbar
>
.statusbar-item.has-beak
{
position
:
relative
;
}
.monaco-workbench
>
.part.statusbar
>
.statusbar-item.has-beak
:before
{
content
:
''
;
position
:
absolute
;
left
:
11px
;
top
:
-5px
;
border-bottom-width
:
5px
;
border-bottom-style
:
solid
;
border-left
:
5px
solid
transparent
;
border-right
:
5px
solid
transparent
;
}
.monaco-workbench
>
.part.statusbar
>
.statusbar-item.left
>
:first-child
{
margin-right
:
5px
;
}
...
...
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
浏览文件 @
4f724cbf
...
...
@@ -29,7 +29,7 @@ import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/
import
{
contrastBorder
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
isThemeColor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
addClass
,
EventHelper
}
from
'
vs/base/browser/dom
'
;
import
{
addClass
,
EventHelper
,
createStyleSheet
}
from
'
vs/base/browser/dom
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
export
class
StatusbarPart
extends
Part
implements
IStatusbarService
{
...
...
@@ -42,6 +42,8 @@ export class StatusbarPart extends Part implements IStatusbarService {
private
statusItemsContainer
:
Builder
;
private
statusMsgDispose
:
IDisposable
;
private
styleElement
:
HTMLStyleElement
;
constructor
(
id
:
string
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
...
...
@@ -60,7 +62,7 @@ export class StatusbarPart extends Part implements IStatusbarService {
public
addEntry
(
entry
:
IStatusbarEntry
,
alignment
:
StatusbarAlignment
,
priority
:
number
=
0
):
IDisposable
{
// Render entry in status bar
const
el
=
this
.
doCreateStatusItem
(
alignment
,
priority
);
const
el
=
this
.
doCreateStatusItem
(
alignment
,
priority
,
entry
.
showBeak
?
'
has-beak
'
:
void
0
);
const
item
=
this
.
instantiationService
.
createInstance
(
StatusBarEntryItem
,
entry
);
const
toDispose
=
item
.
render
(
el
);
...
...
@@ -140,18 +142,31 @@ export class StatusbarPart extends Part implements IStatusbarService {
const
container
=
this
.
getContainer
();
// Background colors
const
backgroundColor
=
this
.
getColor
(
this
.
contextService
.
getWorkbenchState
()
!==
WorkbenchState
.
EMPTY
?
STATUS_BAR_BACKGROUND
:
STATUS_BAR_NO_FOLDER_BACKGROUND
);
container
.
style
(
'
background-color
'
,
backgroundColor
);
container
.
style
(
'
color
'
,
this
.
getColor
(
this
.
contextService
.
getWorkbenchState
()
!==
WorkbenchState
.
EMPTY
?
STATUS_BAR_FOREGROUND
:
STATUS_BAR_NO_FOLDER_FOREGROUND
));
container
.
style
(
'
background-color
'
,
this
.
getColor
(
this
.
contextService
.
getWorkbenchState
()
!==
WorkbenchState
.
EMPTY
?
STATUS_BAR_BACKGROUND
:
STATUS_BAR_NO_FOLDER_BACKGROUND
));
// Border color
const
borderColor
=
this
.
getColor
(
this
.
contextService
.
getWorkbenchState
()
!==
WorkbenchState
.
EMPTY
?
STATUS_BAR_BORDER
:
STATUS_BAR_NO_FOLDER_BORDER
)
||
this
.
getColor
(
contrastBorder
);
container
.
style
(
'
border-top-width
'
,
borderColor
?
'
1px
'
:
null
);
container
.
style
(
'
border-top-style
'
,
borderColor
?
'
solid
'
:
null
);
container
.
style
(
'
border-top-color
'
,
borderColor
);
// Notification Beak
if
(
!
this
.
styleElement
)
{
this
.
styleElement
=
createStyleSheet
(
container
.
getHTMLElement
());
}
this
.
styleElement
.
innerHTML
=
`.monaco-workbench > .part.statusbar > .statusbar-item.has-beak:before { border-bottom-color:
${
backgroundColor
}
; }`
;
}
private
doCreateStatusItem
(
alignment
:
StatusbarAlignment
,
priority
:
number
=
0
):
HTMLElement
{
private
doCreateStatusItem
(
alignment
:
StatusbarAlignment
,
priority
:
number
=
0
,
extraClass
?:
string
):
HTMLElement
{
const
el
=
document
.
createElement
(
'
div
'
);
addClass
(
el
,
'
statusbar-item
'
);
if
(
extraClass
)
{
addClass
(
el
,
extraClass
);
}
if
(
alignment
===
StatusbarAlignment
.
RIGHT
)
{
addClass
(
el
,
'
right
'
);
...
...
src/vs/workbench/parts/debug/browser/statusbarColorProvider.ts
浏览文件 @
4f724cbf
...
...
@@ -11,7 +11,7 @@ import { IPartService, Parts } from 'vs/workbench/services/part/common/partServi
import
{
IDebugService
,
State
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
STATUS_BAR_NO_FOLDER_BACKGROUND
,
STATUS_BAR_NO_FOLDER_FOREGROUND
,
STATUS_BAR_BACKGROUND
,
Themable
,
STATUS_BAR_FOREGROUND
,
STATUS_BAR_NO_FOLDER_BORDER
,
STATUS_BAR_BORDER
}
from
'
vs/workbench/common/theme
'
;
import
{
addClass
,
removeClass
}
from
'
vs/base/browser/dom
'
;
import
{
addClass
,
removeClass
,
createStyleSheet
}
from
'
vs/base/browser/dom
'
;
// colors for theming
...
...
@@ -34,6 +34,7 @@ export const STATUS_BAR_DEBUGGING_BORDER = registerColor('statusBar.debuggingBor
},
localize
(
'
statusBarDebuggingBorder
'
,
"
Status bar border color separating to the sidebar and editor when a program is being debugged. The status bar is shown in the bottom of the window
"
));
export
class
StatusBarColorProvider
extends
Themable
implements
IWorkbenchContribution
{
private
styleElement
:
HTMLStyleElement
;
constructor
(
@
IThemeService
themeService
:
IThemeService
,
...
...
@@ -61,13 +62,23 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri
removeClass
(
container
,
'
debugging
'
);
}
container
.
style
.
backgroundColor
=
this
.
getColor
(
this
.
getColorKey
(
STATUS_BAR_NO_FOLDER_BACKGROUND
,
STATUS_BAR_DEBUGGING_BACKGROUND
,
STATUS_BAR_BACKGROUND
));
// Container Colors
const
backgroundColor
=
this
.
getColor
(
this
.
getColorKey
(
STATUS_BAR_NO_FOLDER_BACKGROUND
,
STATUS_BAR_DEBUGGING_BACKGROUND
,
STATUS_BAR_BACKGROUND
));
container
.
style
.
backgroundColor
=
backgroundColor
;
container
.
style
.
color
=
this
.
getColor
(
this
.
getColorKey
(
STATUS_BAR_NO_FOLDER_FOREGROUND
,
STATUS_BAR_DEBUGGING_FOREGROUND
,
STATUS_BAR_FOREGROUND
));
// Border Color
const
borderColor
=
this
.
getColor
(
this
.
getColorKey
(
STATUS_BAR_NO_FOLDER_BORDER
,
STATUS_BAR_DEBUGGING_BORDER
,
STATUS_BAR_BORDER
))
||
this
.
getColor
(
contrastBorder
);
container
.
style
.
borderTopWidth
=
borderColor
?
'
1px
'
:
null
;
container
.
style
.
borderTopStyle
=
borderColor
?
'
solid
'
:
null
;
container
.
style
.
borderTopColor
=
borderColor
;
// Notification Beak
if
(
!
this
.
styleElement
)
{
this
.
styleElement
=
createStyleSheet
(
container
);
}
this
.
styleElement
.
innerHTML
=
`.monaco-workbench > .part.statusbar > .statusbar-item.has-beak:before { border-bottom-color:
${
backgroundColor
}
!important; }`
;
}
private
getColorKey
(
noFolderColor
:
string
,
debuggingColor
:
string
,
normalColor
:
string
):
string
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录