mirror of
https://github.com/microsoft/vscode.git
synced 2026-06-06 15:45:54 +01:00
@@ -1616,6 +1616,10 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
|
||||
return this.state.windowBorder;
|
||||
}
|
||||
|
||||
getWindowBorderWidth(): number {
|
||||
return this.state.windowBorder ? 2 : 0;
|
||||
}
|
||||
|
||||
getWindowBorderRadius(): string | undefined {
|
||||
return this.state.windowBorder && isMacintosh ? '5px' : undefined;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ export class HoverWidget extends Widget {
|
||||
// Get horizontal alignment and position
|
||||
let targetLeft = this._target.x !== undefined ? this._target.x : Math.min(...targetBounds.map(e => e.left));
|
||||
if (targetLeft + this._hover.containerDomNode.clientWidth >= document.documentElement.clientWidth) {
|
||||
this._x = document.documentElement.clientWidth - (this._workbenchLayoutService.hasWindowBorder() ? 3 : 1);
|
||||
this._x = document.documentElement.clientWidth - this._workbenchLayoutService.getWindowBorderWidth() - 1;
|
||||
this._hover.containerDomNode.classList.add('right-aligned');
|
||||
} else {
|
||||
this._x = targetLeft;
|
||||
|
||||
@@ -144,6 +144,11 @@ export interface IWorkbenchLayoutService extends ILayoutService {
|
||||
*/
|
||||
hasWindowBorder(): boolean;
|
||||
|
||||
/**
|
||||
* Returns the window border width.
|
||||
*/
|
||||
getWindowBorderWidth(): number;
|
||||
|
||||
/**
|
||||
* Returns the window border radius if any.
|
||||
*/
|
||||
|
||||
@@ -429,6 +429,7 @@ export class TestLayoutService implements IWorkbenchLayoutService {
|
||||
hasFocus(_part: Parts): boolean { return false; }
|
||||
focusPart(_part: Parts): void { }
|
||||
hasWindowBorder(): boolean { return false; }
|
||||
getWindowBorderWidth(): number { return 0; }
|
||||
getWindowBorderRadius(): string | undefined { return undefined; }
|
||||
isVisible(_part: Parts): boolean { return true; }
|
||||
getDimension(_part: Parts): Dimension { return new Dimension(0, 0); }
|
||||
|
||||
Reference in New Issue
Block a user