Skip to content

Commit

Permalink
Merge pull request lencx#240 from agurodriguez/fix-nav-padding
Browse files Browse the repository at this point in the history
  • Loading branch information
lencx authored Jan 24, 2023
2 parents c5ba0f7 + 6cf7da5 commit f0e4663
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src-tauri/src/scripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ async function init() {
topDom.id = "chatgpt-app-window-top";
document.body.appendChild(topDom);

const nav = document.body.querySelector('nav');
if (nav) {
const currentPaddingTop = parseInt(window.getComputedStyle(document.querySelector('nav'), null).getPropertyValue('padding-top').replace('px', ''), 10);
const navStyleDom = document.createElement("style");
navStyleDom.innerHTML = `nav{padding-top:${currentPaddingTop + topDom.clientHeight}px !important}`;
document.head.appendChild(navStyleDom);
}

topDom.addEventListener("mousedown", () => invoke("drag_window"));
topDom.addEventListener("touchstart", () => invoke("drag_window"));
topDom.addEventListener("dblclick", () => invoke("fullscreen"));
Expand Down

0 comments on commit f0e4663

Please sign in to comment.