Skip to content

Commit

Permalink
Overlay structuring to happen in submodule (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryingpannn authored and jpan8866 committed Nov 11, 2024
1 parent 80f8c8e commit 25d5c0e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ product.overrides.json
extensions/pearai-submodule
extensions/pearai-ref
.prompts
.aider*
.env
2 changes: 1 addition & 1 deletion src/vs/workbench/browser/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
pearOverlayPartContainer.style.zIndex = "-10";
pearOverlayPartContainer.style.display = "absolute";
pearOverlayPartContainer.classList.add("pearoverlay-part-container");
pearOverlayPartContainer.style.backgroundColor = 'var(--vscode-editor-background)';
pearOverlayPartContainer.style.backgroundColor = 'transparent';

this.mainContainer.appendChild(pearOverlayPartContainer);
pearOverlayPart.create(pearOverlayPartContainer);
Expand Down
21 changes: 3 additions & 18 deletions src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,10 @@ export class PearOverlayPart extends Part {
this.fullScreenOverlay!.style.height = `${height}px`;
}

// Calculate 80% of width and height
const overlayWidth = Math.floor(width * 0.8);
const overlayHeight = Math.floor(height * 0.8);

// Calculate position to center the overlay
const overlayLeft = Math.floor((width - overlayWidth) / 2);
const overlayTop = Math.floor((height - overlayHeight) / 2);

if (this.popupAreaOverlay) {
this.popupAreaOverlay.style.width = `${overlayWidth}px`;
this.popupAreaOverlay.style.height = `${overlayHeight}px`;
this.popupAreaOverlay.style.left = `${overlayLeft}px`;
this.popupAreaOverlay.style.top = `${overlayTop}px`;
this.popupAreaOverlay.style.backgroundColor =
"var(--vscode-editor-background)";
this.popupAreaOverlay.style.width = `${width}px`;
this.popupAreaOverlay.style.height = `${height}px`;
this.popupAreaOverlay.style.backgroundColor = "transparent";
this.popupAreaOverlay.style.borderRadius = "12px";
}

Expand All @@ -220,10 +209,6 @@ export class PearOverlayPart extends Part {

const container = this.webviewView!.webview.container;
container.style.display = "flex";
container.style.boxSizing = "border-box";
container.style.boxShadow = "0 0 20px 0 rgba(0, 0, 0, 0.5)";
container.style.borderRadius = "12px";
container.style.backgroundColor = "var(--vscode-editor-background)";
container.style.zIndex = "1000";
this.fullScreenOverlay?.addEventListener("click", () => {
// TODO: If we are in the tutorial, don't close
Expand Down

0 comments on commit 25d5c0e

Please sign in to comment.