From b638e890d52c2994d64f686aeb3072ae043a95bd Mon Sep 17 00:00:00 2001 From: helmisek <6172587+Helmisek@users.noreply.github.com> Date: Thu, 19 Sep 2024 02:03:31 +0200 Subject: [PATCH] fix: add more changes for base --- src/vs/base/browser/browser.ts | 4 ++-- src/vs/base/browser/ui/radio/radio.ts | 4 ++-- .../base/parts/sandbox/common/electronTypes.ts | 18 ------------------ 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/vs/base/browser/browser.ts b/src/vs/base/browser/browser.ts index 87db1c57..f3e6b43c 100644 --- a/src/vs/base/browser/browser.ts +++ b/src/vs/base/browser/browser.ts @@ -136,6 +136,6 @@ export function isWCOEnabled(): boolean { // Returns the bounding rect of the titlebar area if it is supported and defined // See docs at https://developer.mozilla.org/en-US/docs/Web/API/WindowControlsOverlay/getTitlebarAreaRect -export function getWCOBoundingRect(): DOMRect | undefined { - return (navigator as any)?.windowControlsOverlay?.getTitlebarAreaRect(); +export function getWCOTitlebarAreaRect(targetWindow: Window): DOMRect | undefined { + return (targetWindow.navigator as any)?.windowControlsOverlay?.getTitlebarAreaRect(); } diff --git a/src/vs/base/browser/ui/radio/radio.ts b/src/vs/base/browser/ui/radio/radio.ts index 2f57e4ac..5ab1edc4 100644 --- a/src/vs/base/browser/ui/radio/radio.ts +++ b/src/vs/base/browser/ui/radio/radio.ts @@ -11,7 +11,7 @@ import { $ } from 'vs/base/browser/dom'; import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate'; import { Button } from 'vs/base/browser/ui/button/button'; import { DisposableMap, DisposableStore } from 'vs/base/common/lifecycle'; -import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; +import { createInstantHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; export interface IRadioStyles { readonly activeForeground?: string; @@ -53,7 +53,7 @@ export class Radio extends Widget { constructor(opts: IRadioOptions) { super(); - this.hoverDelegate = opts.hoverDelegate ?? getDefaultHoverDelegate('element'); + this.hoverDelegate = opts.hoverDelegate ?? this._register(createInstantHoverDelegate()); this.domNode = $('.monaco-custom-radio'); this.domNode.setAttribute('role', 'radio'); diff --git a/src/vs/base/parts/sandbox/common/electronTypes.ts b/src/vs/base/parts/sandbox/common/electronTypes.ts index 43fa7507..ef8c1026 100644 --- a/src/vs/base/parts/sandbox/common/electronTypes.ts +++ b/src/vs/base/parts/sandbox/common/electronTypes.ts @@ -217,24 +217,6 @@ export interface FileFilter { name: string; } -export interface OpenDevToolsOptions { - /** - * Opens the devtools with specified dock state, can be `left`, `right`, `bottom`, - * `undocked`, `detach`. Defaults to last used dock state. In `undocked` mode it's - * possible to dock back. In `detach` mode it's not. - */ - mode: ('left' | 'right' | 'bottom' | 'undocked' | 'detach'); - /** - * Whether to bring the opened devtools window to the foreground. The default is - * `true`. - */ - activate?: boolean; - /** - * A title for the DevTools window (only in `undocked` or `detach` mode). - */ - title?: string; -} - interface InputEvent { // Docs: https://electronjs.org/docs/api/structures/input-event