Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9a41aa00
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,发现更多精彩内容 >>
提交
9a41aa00
编写于
6月 20, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #28498: Add horizontal scrolling shade in minimap slider
上级
d8966860
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
7 deletion
+29
-7
src/vs/editor/browser/viewParts/minimap/minimap.ts
src/vs/editor/browser/viewParts/minimap/minimap.ts
+29
-7
未找到文件。
src/vs/editor/browser/viewParts/minimap/minimap.ts
浏览文件 @
9a41aa00
...
...
@@ -79,6 +79,8 @@ class MinimapOptions {
public
readonly
pixelRatio
:
number
;
public
readonly
typicalHalfwidthCharacterWidth
:
number
;
public
readonly
lineHeight
:
number
;
/**
...
...
@@ -112,11 +114,13 @@ class MinimapOptions {
const
pixelRatio
=
configuration
.
editor
.
pixelRatio
;
const
layoutInfo
=
configuration
.
editor
.
layoutInfo
;
const
viewInfo
=
configuration
.
editor
.
viewInfo
;
const
fontInfo
=
configuration
.
editor
.
fontInfo
;
this
.
renderMinimap
=
layoutInfo
.
renderMinimap
|
0
;
this
.
scrollBeyondLastLine
=
viewInfo
.
scrollBeyondLastLine
;
this
.
showSlider
=
viewInfo
.
minimap
.
showSlider
;
this
.
pixelRatio
=
pixelRatio
;
this
.
typicalHalfwidthCharacterWidth
=
fontInfo
.
typicalHalfwidthCharacterWidth
;
this
.
lineHeight
=
configuration
.
editor
.
lineHeight
;
this
.
minimapWidth
=
layoutInfo
.
minimapWidth
;
this
.
minimapHeight
=
layoutInfo
.
height
;
...
...
@@ -133,6 +137,7 @@ class MinimapOptions {
&&
this
.
scrollBeyondLastLine
===
other
.
scrollBeyondLastLine
&&
this
.
showSlider
===
other
.
showSlider
&&
this
.
pixelRatio
===
other
.
pixelRatio
&&
this
.
typicalHalfwidthCharacterWidth
===
other
.
typicalHalfwidthCharacterWidth
&&
this
.
lineHeight
===
other
.
lineHeight
&&
this
.
minimapWidth
===
other
.
minimapWidth
&&
this
.
minimapHeight
===
other
.
minimapHeight
...
...
@@ -410,6 +415,7 @@ export class Minimap extends ViewPart {
private
readonly
_shadow
:
FastDomNode
<
HTMLElement
>
;
private
readonly
_canvas
:
FastDomNode
<
HTMLCanvasElement
>
;
private
readonly
_slider
:
FastDomNode
<
HTMLElement
>
;
private
readonly
_sliderHorizontal
:
FastDomNode
<
HTMLElement
>
;
private
readonly
_tokensColorTracker
:
MinimapTokensColorTracker
;
private
readonly
_mouseDownListener
:
IDisposable
;
private
readonly
_sliderMouseMoveMonitor
:
GlobalMouseMoveMonitor
<
IStandardMouseMoveEventData
>
;
...
...
@@ -452,6 +458,11 @@ export class Minimap extends ViewPart {
this
.
_slider
.
setLayerHinting
(
true
);
this
.
_domNode
.
appendChild
(
this
.
_slider
);
this
.
_sliderHorizontal
=
createFastDomNode
(
document
.
createElement
(
'
div
'
));
this
.
_sliderHorizontal
.
setPosition
(
'
absolute
'
);
this
.
_sliderHorizontal
.
setClassName
(
'
minimap-slider-horizontal
'
);
this
.
_slider
.
appendChild
(
this
.
_sliderHorizontal
);
this
.
_tokensColorTracker
=
MinimapTokensColorTracker
.
getInstance
();
this
.
_minimapCharRenderer
=
getOrCreateMinimapCharRenderer
();
...
...
@@ -651,6 +662,14 @@ export class Minimap extends ViewPart {
this
.
_slider
.
setTop
(
layout
.
sliderTop
);
this
.
_slider
.
setHeight
(
layout
.
sliderHeight
);
// Compute horizontal slider coordinates
const
scrollLeftChars
=
renderingCtx
.
scrollLeft
/
this
.
_options
.
typicalHalfwidthCharacterWidth
;
const
horizontalSliderLeft
=
Math
.
min
(
this
.
_options
.
minimapWidth
,
Math
.
round
(
scrollLeftChars
*
getMinimapCharWidth
(
this
.
_options
.
renderMinimap
)
/
this
.
_options
.
pixelRatio
));
this
.
_sliderHorizontal
.
setLeft
(
horizontalSliderLeft
);
this
.
_sliderHorizontal
.
setWidth
(
this
.
_options
.
minimapWidth
-
horizontalSliderLeft
);
this
.
_sliderHorizontal
.
setTop
(
0
);
this
.
_sliderHorizontal
.
setHeight
(
layout
.
sliderHeight
);
this
.
_lastRenderData
=
this
.
renderLines
(
layout
);
}
...
...
@@ -852,19 +871,22 @@ export class Minimap extends ViewPart {
}
registerThemingParticipant
((
theme
,
collector
)
=>
{
le
t
sliderBackground
=
theme
.
getColor
(
scrollbarSliderBackground
);
cons
t
sliderBackground
=
theme
.
getColor
(
scrollbarSliderBackground
);
if
(
sliderBackground
)
{
collector
.
addRule
(
`.monaco-editor .minimap-slider { background:
${
sliderBackground
}
; }`
);
const
halfSliderBackground
=
sliderBackground
.
transparent
(
0.5
);
collector
.
addRule
(
`.monaco-editor .minimap-slider, .monaco-editor .minimap-slider .minimap-slider-horizontal { background:
${
halfSliderBackground
}
; }`
);
}
le
t
sliderHoverBackground
=
theme
.
getColor
(
scrollbarSliderHoverBackground
);
cons
t
sliderHoverBackground
=
theme
.
getColor
(
scrollbarSliderHoverBackground
);
if
(
sliderHoverBackground
)
{
collector
.
addRule
(
`.monaco-editor .minimap-slider:hover { background:
${
sliderHoverBackground
}
; }`
);
const
halfSliderHoverBackground
=
sliderHoverBackground
.
transparent
(
0.5
);
collector
.
addRule
(
`.monaco-editor .minimap-slider:hover, .monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background:
${
halfSliderHoverBackground
}
; }`
);
}
le
t
sliderActiveBackground
=
theme
.
getColor
(
scrollbarSliderActiveBackground
);
cons
t
sliderActiveBackground
=
theme
.
getColor
(
scrollbarSliderActiveBackground
);
if
(
sliderActiveBackground
)
{
collector
.
addRule
(
`.monaco-editor .minimap-slider.active { background:
${
sliderActiveBackground
}
; }`
);
const
halfSliderActiveBackground
=
sliderActiveBackground
.
transparent
(
0.5
);
collector
.
addRule
(
`.monaco-editor .minimap-slider.active, .monaco-editor .minimap-slider.active .minimap-slider-horizontal { background:
${
halfSliderActiveBackground
}
; }`
);
}
le
t
shadow
=
theme
.
getColor
(
scrollbarShadow
);
cons
t
shadow
=
theme
.
getColor
(
scrollbarShadow
);
if
(
shadow
)
{
collector
.
addRule
(
`.monaco-editor .minimap-shadow-visible { box-shadow:
${
shadow
}
-6px 0 6px -6px inset; }`
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录