Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
fce9e3de
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,发现更多精彩内容 >>
提交
fce9e3de
编写于
6月 21, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: allow toolbar to be in two different vertical lines
上级
6a9c5b44
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
7 deletion
+18
-7
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
+18
-7
未找到文件。
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
浏览文件 @
fce9e3de
...
...
@@ -33,6 +33,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
const
DEBUG_ACTIONS_WIDGET_POSITION_KEY
=
'
debug.actionswidgetposition
'
;
const
DEBUG_ACTIONS_WIDGET_Y_KEY
=
'
debug.actionswidgety
'
;
const
HEIGHT
=
32
;
export
const
debugToolBarBackground
=
registerColor
(
'
debugToolBar.background
'
,
{
dark
:
'
#333333
'
,
...
...
@@ -136,14 +138,14 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
this
.
telemetryService
.
publicLog
(
'
workbenchActionExecuted
'
,
{
id
:
e
.
action
.
id
,
from
:
'
debugActionsWidget
'
});
}
}));
$
(
window
).
on
(
dom
.
EventType
.
RESIZE
,
()
=>
this
.
set
XCoordinate
(),
this
.
toUnbind
);
$
(
window
).
on
(
dom
.
EventType
.
RESIZE
,
()
=>
this
.
set
Coordinates
(),
this
.
toUnbind
);
this
.
dragArea
.
on
(
dom
.
EventType
.
MOUSE_UP
,
(
event
:
MouseEvent
)
=>
{
const
mouseClickEvent
=
new
StandardMouseEvent
(
event
);
if
(
mouseClickEvent
.
detail
===
2
)
{
// double click on debug bar centers it again #8250
const
widgetWidth
=
this
.
$el
.
getHTMLElement
().
clientWidth
;
this
.
set
XCoordinate
(
0.5
*
window
.
innerWidth
-
0.5
*
widgetWidth
);
this
.
set
Coordinates
(
0.5
*
window
.
innerWidth
-
0.5
*
widgetWidth
,
0
);
this
.
storePosition
();
}
});
...
...
@@ -157,7 +159,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
// Prevent default to stop editor selecting text #8524
mouseMoveEvent
.
preventDefault
();
// Reduce x by width of drag handle to reduce jarring #16604
this
.
set
XCoordinate
(
mouseMoveEvent
.
posx
-
14
);
this
.
set
Coordinates
(
mouseMoveEvent
.
posx
-
14
,
mouseMoveEvent
.
posy
);
}).
once
(
'
mouseup
'
,
(
e
:
MouseEvent
)
=>
{
this
.
storePosition
();
this
.
dragArea
.
removeClass
(
'
dragged
'
);
...
...
@@ -171,7 +173,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
private
storePosition
():
void
{
const
position
=
parseFloat
(
this
.
$el
.
getComputedStyle
().
left
)
/
window
.
innerWidth
;
this
.
storageService
.
store
(
DEBUG_ACTIONS_WIDGET_POSITION_KEY
,
position
,
StorageScope
.
WORKSPACE
);
this
.
storageService
.
store
(
DEBUG_ACTIONS_WIDGET_POSITION_KEY
,
position
,
StorageScope
.
GLOBAL
);
}
protected
updateStyles
():
void
{
...
...
@@ -203,18 +205,27 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
$
(
this
.
$el
).
style
(
'
top
'
,
`
${
titlebarOffset
}
px`
);
}
private
set
XCoordinate
(
x
?:
number
):
void
{
private
set
Coordinates
(
x
?:
number
,
y
?:
number
):
void
{
if
(
!
this
.
isVisible
)
{
return
;
}
const
widgetWidth
=
this
.
$el
.
getHTMLElement
().
clientWidth
;
if
(
x
===
undefined
)
{
const
positionPercentage
=
this
.
storageService
.
get
(
DEBUG_ACTIONS_WIDGET_POSITION_KEY
,
StorageScope
.
WORKSPACE
);
const
positionPercentage
=
this
.
storageService
.
get
(
DEBUG_ACTIONS_WIDGET_POSITION_KEY
,
StorageScope
.
GLOBAL
);
x
=
positionPercentage
!==
undefined
?
parseFloat
(
positionPercentage
)
*
window
.
innerWidth
:
(
0.5
*
window
.
innerWidth
-
0.5
*
widgetWidth
);
}
x
=
Math
.
max
(
0
,
Math
.
min
(
x
,
window
.
innerWidth
-
widgetWidth
));
// do not allow the widget to overflow on the right
this
.
$el
.
style
(
'
left
'
,
`
${
x
}
px`
);
if
(
y
===
undefined
)
{
y
=
this
.
storageService
.
getInteger
(
DEBUG_ACTIONS_WIDGET_Y_KEY
,
StorageScope
.
GLOBAL
,
0
);
}
if
((
y
<
HEIGHT
/
2
)
||
(
y
>
HEIGHT
+
HEIGHT
/
2
))
{
const
moveToTop
=
y
<
HEIGHT
;
this
.
$el
.
style
(
'
top
'
,
moveToTop
?
'
0px
'
:
`
${
HEIGHT
}
px`
);
this
.
storageService
.
store
(
DEBUG_ACTIONS_WIDGET_Y_KEY
,
moveToTop
?
0
:
2
*
HEIGHT
,
StorageScope
.
GLOBAL
);
}
}
private
onDidConfigurationChange
(
event
:
IConfigurationChangeEvent
):
void
{
...
...
@@ -234,7 +245,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
this
.
isVisible
=
true
;
this
.
$el
.
show
();
this
.
set
XCoordinate
();
this
.
set
Coordinates
();
}
private
hide
():
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录