diff --git a/app/src/assets/template/app/index.tpl b/app/src/assets/template/app/index.tpl index 768f0964c..7f98b5590 100644 --- a/app/src/assets/template/app/index.tpl +++ b/app/src/assets/template/app/index.tpl @@ -19,7 +19,7 @@
-
+
diff --git a/app/src/assets/template/desktop/index.tpl b/app/src/assets/template/desktop/index.tpl index 5ef84704d..ad983e925 100644 --- a/app/src/assets/template/desktop/index.tpl +++ b/app/src/assets/template/desktop/index.tpl @@ -21,7 +21,7 @@
-
+
diff --git a/app/src/constants.ts b/app/src/constants.ts index 8bba683e4..8eda7330c 100644 --- a/app/src/constants.ts +++ b/app/src/constants.ts @@ -313,13 +313,13 @@ export abstract class Constants { data: [ [{ type: "file", - size: {width: 224, height: 0}, + size: {width: 227, height: 0}, show: true, icon: "iconFiles", hotkeyLangId: "fileTree", }, { type: "outline", - size: {width: 224, height: 0}, + size: {width: 227, height: 0}, show: false, icon: "iconAlignCenter", hotkeyLangId: "outline", @@ -331,13 +331,13 @@ export abstract class Constants { hotkeyLangId: "inbox", }], [{ type: "bookmark", - size: {width: 224, height: 0}, + size: {width: 227, height: 0}, show: false, icon: "iconBookmark", hotkeyLangId: "bookmark", }, { type: "tag", - size: {width: 224, height: 0}, + size: {width: 227, height: 0}, show: false, icon: "iconTags", hotkeyLangId: "tag", diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts index 4019d9f7f..0b2b282c3 100644 --- a/app/src/layout/Wnd.ts +++ b/app/src/layout/Wnd.ts @@ -47,7 +47,7 @@ export class Wnd { this.element = document.createElement("div"); this.element.classList.add("fn__flex-1", "fn__flex"); let dragHTML = '
'; - if (parentType === "left" || parentType === "right" || parentType === "top" || parentType === "bottom") { + if (parentType === "left" || parentType === "right" || parentType === "bottom") { dragHTML = ""; } this.element.innerHTML = `
@@ -657,7 +657,7 @@ export class Wnd { if (this.children.length === 1) { this.destroyModel(this.children[0].model); this.children = []; - if (["top", "bottom", "left", "right"].includes(this.parent.type)) { + if (["bottom", "left", "right"].includes(this.parent.type)) { item.panelElement.remove(); } else { this.remove(); diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index 08292ecd1..ed9b69bbf 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -402,9 +402,9 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any) => { if (layout instanceof Layout || layout instanceof Wnd) { if (layout instanceof Layout && - (layout.type === "top" || layout.type === "bottom" || layout.type === "left" || layout.type === "right")) { + (layout.type === "bottom" || layout.type === "left" || layout.type === "right")) { // 四周布局使用默认值,清空内容,重置时使用 dock 数据 - if (layout.type === "top" || layout.type === "bottom") { + if (layout.type === "bottom") { json.children = [{ "instance": "Wnd", "children": [] @@ -604,7 +604,7 @@ export const addResize = (obj: Layout | Wnd) => { } const getMinSize = (element: HTMLElement) => { - let minSize = 224; + let minSize = 227; Array.from(element.querySelectorAll(".file-tree")).find((item) => { if (item.classList.contains("sy__backlink") || item.classList.contains("sy__graph") || item.classList.contains("sy__globalGraph") || item.classList.contains("sy__inbox")) { @@ -644,14 +644,9 @@ export const addResize = (obj: Layout | Wnd) => { const previousElement = resizeElement.previousElementSibling as HTMLElement; nextElement.style.overflow = "auto"; // 拖动时 layout__resize 会出现 https://github.com/siyuan-note/siyuan/issues/6221 previousElement.style.overflow = "auto"; - if (!nextElement.nextElementSibling) { - if (!previousElement.previousElementSibling) { - setSize(previousElement, direction); - } else { - setSize(nextElement, direction); - } - } else if (nextElement.nextElementSibling?.nextElementSibling && - nextElement.parentElement.lastElementChild.isSameNode(nextElement.nextElementSibling.nextElementSibling)) { + if (!nextElement.nextElementSibling || nextElement.nextElementSibling.classList.contains("layout__dockresize")) { + setSize(nextElement, direction); + } else { setSize(previousElement, direction); } const x = event[direction === "lr" ? "clientX" : "clientY"]; @@ -684,6 +679,10 @@ export const addResize = (obj: Layout | Wnd) => { nextNowSize < getMinSize(nextElement)) { return; } + if (window.siyuan.layout.bottomDock?.layout.element.isSameNode(nextElement) && + nextNowSize < 64) { + return; + } if (!previousElement.classList.contains("fn__flex-1")) { previousElement.style[direction === "lr" ? "width" : "height"] = previousNowSize + "px"; } diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts index f497dfc56..a4776a015 100644 --- a/app/src/types/index.d.ts +++ b/app/src/types/index.d.ts @@ -1,4 +1,4 @@ -type TLayout = "normal" | "top" | "bottom" | "left" | "right" | "center" +type TLayout = "normal" | "bottom" | "left" | "right" | "center" type TSearchFilter = "mathBlock" | "table" | "blockquote" | "superBlock" | "paragraph" | "document" | "heading" | "list" | "listItem" | "codeBlock" | "htmlBlock" type TDirection = "lr" | "tb" @@ -12,7 +12,7 @@ type TDockType = | "backlink" | "backlinkOld" | "inbox" -type TDockPosition = "Left" | "Right" | "Top" | "Bottom" +type TDockPosition = "Left" | "Right" | "Bottom" type TWS = "main" | "filetree" | "protyle" type TEditorMode = "preview" | "wysiwyg" type TOperation =