mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
Merge branch 'main' into dev
This commit is contained in:
8
src-tauri/src/scripts/core.js
vendored
8
src-tauri/src/scripts/core.js
vendored
@@ -64,6 +64,14 @@ async function init() {
|
|||||||
topDom.id = "chatgpt-app-window-top";
|
topDom.id = "chatgpt-app-window-top";
|
||||||
document.body.appendChild(topDom);
|
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("mousedown", () => invoke("drag_window"));
|
||||||
topDom.addEventListener("touchstart", () => invoke("drag_window"));
|
topDom.addEventListener("touchstart", () => invoke("drag_window"));
|
||||||
topDom.addEventListener("dblclick", () => invoke("fullscreen"));
|
topDom.addEventListener("dblclick", () => invoke("fullscreen"));
|
||||||
|
|||||||
Reference in New Issue
Block a user