提交 fe9c6332 编写于 作者: A Alex Dima

Fixes #21348: No top shadown on the scrollbar when the minimap is enabled

上级 c10f99e7
......@@ -25,7 +25,8 @@ export class ScrollDecorationViewPart extends ViewPart {
super(context);
this._scrollTop = 0;
this._width = this._context.configuration.editor.layoutInfo.width;
this._width = 0;
this._updateWidth();
this._shouldShow = false;
this._useShadows = this._context.configuration.editor.viewInfo.scrollbar.useShadows;
this._domNode = createFastDomNode(document.createElement('div'));
......@@ -44,6 +45,16 @@ export class ScrollDecorationViewPart extends ViewPart {
return this._domNode.domNode;
}
private _updateWidth(): boolean {
const layoutInfo = this._context.configuration.editor.layoutInfo;
let newWidth = layoutInfo.width - layoutInfo.minimapWidth;
if (this._width !== newWidth) {
this._width = newWidth;
return true;
}
return false;
}
// --- begin event handlers
public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {
......@@ -52,10 +63,7 @@ export class ScrollDecorationViewPart extends ViewPart {
this._useShadows = this._context.configuration.editor.viewInfo.scrollbar.useShadows;
}
if (e.layoutInfo) {
if (this._width !== this._context.configuration.editor.layoutInfo.width) {
this._width = this._context.configuration.editor.layoutInfo.width;
shouldRender = true;
}
shouldRender = this._updateWidth();
}
return this._updateShouldShow() || shouldRender;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册