Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/10749

Vanessa5efc59406c75
diff --git a/app/src/assets/scss/util/_reset.scss b/app/src/assets/scss/util/_reset.scss
index a125ec4aca..ffe5117ce2 100644
--- a/app/src/assets/scss/util/_reset.scss
+++ b/app/src/assets/scss/util/_reset.scss
@@ -99,8 +99,8 @@ body {
}
}
- &.body--fullscreen:not(.body--win32):not(.body--window) .toolbar {
- padding-left: 5px;
+ &.body--fullscreen {
+ --b3-toolbar-left-mac: 5px;
}
&.body--maximize,
diff --git a/app/src/boot/onGetConfig.ts b/app/src/boot/onGetConfig.ts
index 771a8b9886..90656f9621 100644
--- a/app/src/boot/onGetConfig.ts
+++ b/app/src/boot/onGetConfig.ts
@@ -41,13 +41,13 @@ export const onGetConfig = (isStart: boolean, app: App) => {
});
webFrame.setZoomFactor(window.siyuan.storage[Constants.LOCAL_ZOOM]);
const position = Constants.SIZE_ZOOM.find((item) => item.zoom === window.siyuan.storage[Constants.LOCAL_ZOOM]).position;
- if (window.siyuan.config.appearance.hideToolbar) {
- position.y += 5;
- }
ipcRenderer.send(Constants.SIYUAN_CMD, {
cmd: "setTrafficLightPosition",
zoom: window.siyuan.storage[Constants.LOCAL_ZOOM],
- position
+ position: {
+ x: position.x,
+ y: (window.siyuan.config.appearance.hideToolbar ? 5 * window.siyuan.storage[Constants.LOCAL_ZOOM] : 0) + position.y
+ },
});
/// #endif
if (!window.siyuan.config.uiLayout || (window.siyuan.config.uiLayout && !window.siyuan.config.uiLayout.left)) {
diff --git a/app/src/layout/tabUtil.ts b/app/src/layout/tabUtil.ts
index 30edca0d21..9b1b748fd8 100644
--- a/app/src/layout/tabUtil.ts
+++ b/app/src/layout/tabUtil.ts
@@ -64,7 +64,7 @@ export const setTabPosition = (onlyPadding = false) => {
// header padding
if (isWindowMode) {
if (headerRect.left === 0) {
- headerElement.style.paddingLeft = getComputedStyle(document.body).getPropertyValue("--b3-toolbar-left-mac");
+ headerElement.style.paddingLeft = (parseInt(getComputedStyle(document.body).getPropertyValue("--b3-toolbar-left-mac")) - 5) + "px";
}
} else {
if (headerRect.left > toolbarDragRect.left && headerRect.left === centerRect.left) {
diff --git a/app/src/layout/topBar.ts b/app/src/layout/topBar.ts
index d4ea11e54b..aa3c48df8b 100644
--- a/app/src/layout/topBar.ts
+++ b/app/src/layout/topBar.ts
@@ -290,14 +290,14 @@ export const setZoom = (type: "zoomIn" | "zoomOut" | "restore") => {
}
webFrame.setZoomFactor(zoom);
- const position = Constants.SIZE_ZOOM.find((item) => item.zoom === window.siyuan.storage[Constants.LOCAL_ZOOM]).position;
- if (window.siyuan.config.appearance.hideToolbar) {
- position.y += 5;
- }
+ const position = Constants.SIZE_ZOOM.find((item) => item.zoom === zoom).position;
ipcRenderer.send(Constants.SIYUAN_CMD, {
cmd: "setTrafficLightPosition",
zoom,
- position
+ position: {
+ x: position.x,
+ y: ((window.siyuan.config.appearance.hideToolbar && !isWindow()) ? 5 * zoom : 0) + position.y
+ },
});
window.siyuan.storage[Constants.LOCAL_ZOOM] = zoom;
setStorageVal(Constants.LOCAL_ZOOM, zoom);
diff --git a/app/src/window/init.ts b/app/src/window/init.ts
index aa33481035..876a7df076 100644
--- a/app/src/window/init.ts
+++ b/app/src/window/init.ts
@@ -22,9 +22,6 @@ import {getAllEditor} from "../layout/getAll";
export const init = (app: App) => {
webFrame.setZoomFactor(window.siyuan.storage[Constants.LOCAL_ZOOM]);
const position = Constants.SIZE_ZOOM.find((item) => item.zoom === window.siyuan.storage[Constants.LOCAL_ZOOM]).position;
- if (window.siyuan.config.appearance.hideToolbar) {
- position.y += 5;
- }
ipcRenderer.send(Constants.SIYUAN_CMD, {
cmd: "setTrafficLightPosition",
zoom: window.siyuan.storage[Constants.LOCAL_ZOOM],