Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
883eafa6
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,发现更多精彩内容 >>
提交
883eafa6
编写于
6月 06, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
status - adopt visibility for send feedback entry
上级
12fb60ec
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
38 deletion
+23
-38
src/vs/platform/statusbar/common/statusbar.ts
src/vs/platform/statusbar/common/statusbar.ts
+5
-0
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
+8
-0
src/vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts
...ontrib/feedback/electron-browser/feedback.contribution.ts
+0
-18
src/vs/workbench/contrib/feedback/electron-browser/feedback.ts
...s/workbench/contrib/feedback/electron-browser/feedback.ts
+8
-4
src/vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem.ts
...ontrib/feedback/electron-browser/feedbackStatusbarItem.ts
+2
-16
未找到文件。
src/vs/platform/statusbar/common/statusbar.ts
浏览文件 @
883eafa6
...
...
@@ -75,6 +75,11 @@ export interface IStatusbarService {
* @param name human readable name the entry is about
*/
addEntry
(
entry
:
IStatusbarEntry
,
id
:
string
,
name
:
string
,
alignment
:
StatusbarAlignment
,
priority
?:
number
):
IStatusbarEntryAccessor
;
/**
* Allows to update an entry's visibilty with the provided ID.
*/
updateEntryVisibility
(
id
:
string
,
visible
:
boolean
):
void
;
}
export
interface
IStatusbarEntryAccessor
extends
IDisposable
{
...
...
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
浏览文件 @
883eafa6
...
...
@@ -395,6 +395,14 @@ export class StatusbarPart extends Part implements IStatusbarService {
return
entries
;
}
updateEntryVisibility
(
id
:
string
,
visible
:
boolean
):
void
{
if
(
visible
)
{
this
.
viewModel
.
show
(
id
);
}
else
{
this
.
viewModel
.
hide
(
id
);
}
}
createContentArea
(
parent
:
HTMLElement
):
HTMLElement
{
this
.
element
=
parent
;
...
...
src/vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts
浏览文件 @
883eafa6
...
...
@@ -8,7 +8,6 @@ import { IStatusbarRegistry, Extensions, StatusbarItemDescriptor } from 'vs/work
import
{
StatusbarAlignment
}
from
'
vs/platform/statusbar/common/statusbar
'
;
import
{
FeedbackStatusbarItem
}
from
'
vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
// Register Statusbar item
Registry
.
as
<
IStatusbarRegistry
>
(
Extensions
.
Statusbar
).
registerStatusbarItem
(
new
StatusbarItemDescriptor
(
...
...
@@ -18,20 +17,3 @@ Registry.as<IStatusbarRegistry>(Extensions.Statusbar).registerStatusbarItem(new
StatusbarAlignment
.
RIGHT
,
-
100
/* towards the end of the right hand side */
));
// Configuration: Workbench
const
configurationRegistry
=
Registry
.
as
<
IConfigurationRegistry
>
(
ConfigurationExtensions
.
Configuration
);
configurationRegistry
.
registerConfiguration
({
'
id
'
:
'
workbench
'
,
'
order
'
:
7
,
'
title
'
:
localize
(
'
workbenchConfigurationTitle
'
,
"
Workbench
"
),
'
type
'
:
'
object
'
,
'
properties
'
:
{
'
workbench.statusBar.feedback.visible
'
:
{
'
type
'
:
'
boolean
'
,
'
default
'
:
true
,
'
description
'
:
localize
(
'
feedbackVisibility
'
,
"
Controls the visibility of the Twitter feedback (smiley) in the status bar at the bottom of the workbench.
"
)
}
}
});
\ No newline at end of file
src/vs/workbench/contrib/feedback/electron-browser/feedback.ts
浏览文件 @
883eafa6
...
...
@@ -18,10 +18,9 @@ import { editorWidgetBackground, widgetShadow, inputBorder, inputForeground, inp
import
{
IAnchor
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
Button
}
from
'
vs/base/browser/ui/button/button
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
OcticonLabel
}
from
'
vs/base/browser/ui/octiconLabel/octiconLabel
'
;
export
const
FEEDBACK_VISIBLE_CONFIG
=
'
workbench.statusBar.feedback.visible
'
;
import
{
IStatusbarService
}
from
'
vs/platform/statusbar/common/statusbar
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
export
interface
IFeedback
{
feedback
:
string
;
...
...
@@ -67,6 +66,7 @@ export class FeedbackDropdown extends Dropdown {
@
ITelemetryService
private
readonly
telemetryService
:
ITelemetryService
,
@
IIntegrityService
private
readonly
integrityService
:
IIntegrityService
,
@
IThemeService
private
readonly
themeService
:
IThemeService
,
@
IStatusbarService
private
readonly
statusbarService
:
IStatusbarService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
)
{
super
(
container
,
{
...
...
@@ -91,6 +91,10 @@ export class FeedbackDropdown extends Dropdown {
dom
.
addClass
(
this
.
element
,
'
send-feedback
'
);
this
.
element
.
title
=
nls
.
localize
(
'
sendFeedback
'
,
"
Tweet Feedback
"
);
if
(
!
this
.
configurationService
.
getValue
(
'
workbench.statusBar.feedback.visible
'
))
{
this
.
statusbarService
.
updateEntryVisibility
(
'
status.feedback
'
,
false
);
}
}
protected
getAnchor
():
HTMLElement
|
IAnchor
{
...
...
@@ -404,7 +408,7 @@ export class FeedbackDropdown extends Dropdown {
}
if
(
this
.
hideButton
&&
!
this
.
hideButton
.
checked
)
{
this
.
configurationService
.
updateValue
(
FEEDBACK_VISIBLE_CONFIG
,
false
);
this
.
statusbarService
.
updateEntryVisibility
(
'
status.feedback
'
,
false
);
}
super
.
hide
();
...
...
src/vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem.ts
浏览文件 @
883eafa6
...
...
@@ -5,14 +5,13 @@
import
{
IDisposable
,
dispose
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IStatusbarItem
}
from
'
vs/workbench/browser/parts/statusbar/statusbar
'
;
import
{
FeedbackDropdown
,
IFeedback
,
IFeedbackDelegate
,
FEEDBACK_VISIBLE_CONFIG
}
from
'
vs/workbench/contrib/feedback/electron-browser/feedback
'
;
import
{
FeedbackDropdown
,
IFeedback
,
IFeedbackDelegate
}
from
'
vs/workbench/contrib/feedback/electron-browser/feedback
'
;
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
product
from
'
vs/platform/product/node/product
'
;
import
{
Themable
,
STATUS_BAR_ITEM_HOVER_BACKGROUND
}
from
'
vs/workbench/common/theme
'
;
import
{
IThemeService
,
registerThemingParticipant
,
ITheme
,
ICssStyleCollector
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IConfigurationChangeEvent
,
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
clearNode
,
EventHelper
,
addClass
,
removeClass
,
addDisposableListener
}
from
'
vs/base/browser/dom
'
;
class
TwitterFeedbackService
implements
IFeedbackDelegate
{
...
...
@@ -50,33 +49,21 @@ class TwitterFeedbackService implements IFeedbackDelegate {
export
class
FeedbackStatusbarItem
extends
Themable
implements
IStatusbarItem
{
private
dropdown
:
FeedbackDropdown
|
undefined
;
private
enabled
:
boolean
;
private
container
:
HTMLElement
;
constructor
(
@
IInstantiationService
private
readonly
instantiationService
:
IInstantiationService
,
@
IContextViewService
private
readonly
contextViewService
:
IContextViewService
,
@
IWorkspaceContextService
private
readonly
contextService
:
IWorkspaceContextService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IThemeService
themeService
:
IThemeService
)
{
super
(
themeService
);
this
.
enabled
=
this
.
configurationService
.
getValue
(
FEEDBACK_VISIBLE_CONFIG
);
this
.
registerListeners
();
}
private
registerListeners
():
void
{
this
.
_register
(
this
.
contextService
.
onDidChangeWorkbenchState
(()
=>
this
.
updateStyles
()));
this
.
_register
(
this
.
configurationService
.
onDidChangeConfiguration
(
e
=>
this
.
onConfigurationUpdated
(
e
)));
}
private
onConfigurationUpdated
(
event
:
IConfigurationChangeEvent
):
void
{
if
(
event
.
affectsConfiguration
(
FEEDBACK_VISIBLE_CONFIG
))
{
this
.
enabled
=
this
.
configurationService
.
getValue
(
FEEDBACK_VISIBLE_CONFIG
);
this
.
update
();
}
}
render
(
element
:
HTMLElement
):
IDisposable
{
...
...
@@ -93,10 +80,9 @@ export class FeedbackStatusbarItem extends Themable implements IStatusbarItem {
}
private
update
():
IDisposable
{
const
enabled
=
product
.
sendASmile
&&
this
.
enabled
;
// Create
if
(
enabled
)
{
if
(
product
.
sendASmile
)
{
if
(
!
this
.
dropdown
)
{
this
.
dropdown
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
FeedbackDropdown
,
this
.
container
,
{
contextViewProvider
:
this
.
contextViewService
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录