This commit is contained in:
Vanessa 2023-02-22 17:38:13 +08:00
parent b434b779bb
commit edbe4da57e
20 changed files with 10 additions and 95 deletions

View file

@ -338,13 +338,13 @@
<svg>
<use xlink:href="#iconTopLeft"></use>
</svg>
iconTopLeft
<del>iconTopLeft</del>
</div>
<div>
<svg>
<use xlink:href="#iconTopRight"></use>
</svg>
iconTopRight
<del>iconTopRight</del>
</div>
<div>
<svg>

View file

@ -416,8 +416,6 @@
"moveToLeftBottom": "Move to the Left Bottom",
"moveToRightTop": "Move to the Right Top",
"moveToRightBottom": "Move to the Right Bottom",
"moveToTopLeft": "Move to the Top Left",
"moveToTopRight": "Move to the Top Right",
"moveToBottomLeft": "Move to the Bottom Left",
"moveToBottomRight": "Move to the Bottom Right",
"accountDisplayTitle": "Whether to display the title icon at the top bar",

View file

@ -416,8 +416,6 @@
"moveToLeftBottom": "Muéve a la parte inferior izquierda",
"moveToRightTop": "Mover a la parte superior derecha",
"moveToRightBottom": "Mover a la parte inferior derecha",
"moveToTopLeft": "Mover a la parte superior izquierda",
"moveToTopRight": "Mover a la parte superior derecha",
"moveToBottomLeft": "Mover a la parte inferior izquierda",
"moveToBottomRight": "Mover a la parte inferior derecha",
"accountDisplayTitle": "Si mostrar el icono del título en la barra superior",

View file

@ -416,8 +416,6 @@
"moveToLeftBottom": "Déplacer vers la Gauche à Bas",
"moveToRightTop": "Déplacer vers la Droit à Haut",
"moveToRightBottom": "Déplacer vers la Droit à Bas",
"moveToTopLeft": "Déplacer vers la Haut à Gauche",
"moveToTopRight": "Déplacer vers la Haut à Droit",
"moveToBottomLeft": "Déplacer vers la Bas à Gauche",
"moveToBottomRight": "Déplacer vers la Bas à Droit",
"accountDisplayTitle": "Affichage ou pas de l'icône du titre dans la barre supérieure.",

View file

@ -416,8 +416,6 @@
"moveToLeftBottom": "移動到左側下方",
"moveToRightTop": "移動到右側上方",
"moveToRightBottom": "移動到右側下方",
"moveToTopLeft": "移動到上側左方",
"moveToTopRight": "移動到上側右方",
"moveToBottomLeft": "移動到下側左方",
"moveToBottomRight": "移動到下側右方",
"accountDisplayTitle": "首欄顯示頭銜",

View file

@ -416,8 +416,6 @@
"moveToLeftBottom": "移动到左侧下方",
"moveToRightTop": "移动到右侧上方",
"moveToRightBottom": "移动到右侧下方",
"moveToTopLeft": "移动到上侧左方",
"moveToTopRight": "移动到上侧右方",
"moveToBottomLeft": "移动到下侧左方",
"moveToBottomRight": "移动到下侧右方",
"accountDisplayTitle": "顶栏显示头衔",

View file

@ -242,7 +242,7 @@ export class Asset extends Model {
<svg><use xlink:href="#iconSearch"></use></svg>
</button>
<button id="rectAnno" class="toolbarButton b3-tooltips b3-tooltips__s" tabindex="12" aria-expanded="false" aria-controls="findbar" aria-label="${window.siyuan.languages.rectAnnotation} ${updateHotkeyTip("D")}/${updateHotkeyTip("D")}">
<svg><use xlink:href="#iconTopLeft"></use></svg>
<svg><use xlink:href="#iconLeftTop"></use></svg>
</button>
<button class="toolbarButton pageUp b3-tooltips b3-tooltips__s" aria-label="${window.siyuan.languages.previousLabel}" id="previous" tabindex="13">
<svg><use xlink:href="#iconUp"></use></svg>

View file

@ -13,7 +13,6 @@
&--floatl,
&--floatr,
&--floatt,
&--floatb {
transition: var(--b3-width-transition);
}
@ -46,14 +45,6 @@
right: 0;
}
&.layout--floatt {
border-bottom: 1px solid var(--b3-border-color);
box-shadow: var(--b3-dialog-shadow);
left: 0;
top: 0;
right: 0;
}
&.layout--floatb {
border-top: 1px solid var(--b3-border-color);
box-shadow: 0 -8px 24px rgb(140 149 159 / 20%);
@ -334,10 +325,6 @@
border-left: .5px solid var(--b3-border-color);
}
&#dockTop {
border-bottom: .5px solid var(--b3-border-color);
}
&#dockBottom {
border-top: .5px solid var(--b3-border-color);
}

View file

@ -14,7 +14,6 @@
<button onclick="window.location.reload()" id="loadingRefresh" style="display: none;position: absolute;bottom: 16px;background: transparent;border: 1px solid #4285f4;color: #4285f4;border-radius: 4px;line-height: 20px;padding: 4px 8px;">Refresh</button>
</div>
<div id="toolbar" class="toolbar fn__flex"></div>
<div id="dockTop" class="dock"></div>
<div class="fn__flex-1 fn__flex">
<div id="dockLeft" class="dock dock--vertical"></div>
<div id="layouts" class="layout fn__flex-1"></div>

View file

@ -16,7 +16,6 @@
<img style="position: absolute;width: 36vh;" src="../../icon.png">
</div>
<div id="toolbar" class="toolbar fn__flex"></div>
<div id="dockTop" class="dock"></div>
<div class="fn__flex-1 fn__flex">
<div id="dockLeft" class="dock dock--vertical"></div>
<div id="layouts" class="layout fn__flex-1"></div>

View file

@ -250,20 +250,6 @@ export abstract class Constants {
"instance": "Layout",
"children": [{
"direction": "lr",
"size": "0px",
"type": "top",
"instance": "Layout",
"children": [{
"instance": "Wnd",
"children": []
}, {
"instance": "Wnd",
"resize": "lr",
"children": []
}]
}, {
"direction": "lr",
"resize": "tb",
"size": "auto",
"type": "normal",
"instance": "Layout",
@ -318,10 +304,6 @@ export abstract class Constants {
}]
}]
},
top: {
pin: true,
data: []
},
bottom: {
pin: true,
data: []

View file

@ -139,10 +139,6 @@ class App {
pin: true,
data: response.data.conf.uiLayout.right
};
window.siyuan.config.uiLayout.top = {
pin: true,
data: response.data.conf.uiLayout.top
};
window.siyuan.config.uiLayout.bottom = {
pin: true,
data: response.data.conf.uiLayout.bottom

View file

@ -26,22 +26,17 @@ export class Dock {
constructor(options: { data: { pin: boolean, data: IDockTab[][] }, position: TDockPosition }) {
switch (options.position) {
case "Left":
this.layout = window.siyuan.layout.layout.children[1].children[0] as Layout;
this.layout = window.siyuan.layout.layout.children[0].children[0] as Layout;
this.resizeElement = this.layout.element.nextElementSibling as HTMLElement;
this.layout.element.classList.add("layout--floatl");
break;
case "Right":
this.layout = window.siyuan.layout.layout.children[1].children[2] as Layout;
this.layout = window.siyuan.layout.layout.children[0].children[2] as Layout;
this.resizeElement = this.layout.element.previousElementSibling as HTMLElement;
this.layout.element.classList.add("layout--floatr");
break;
case "Top":
this.layout = window.siyuan.layout.layout.children[0] as Layout;
this.resizeElement = this.layout.element.nextElementSibling as HTMLElement;
this.layout.element.classList.add("layout--floatt");
break;
case "Bottom":
this.layout = window.siyuan.layout.layout.children[2] as Layout;
this.layout = window.siyuan.layout.layout.children[1] as Layout;
this.resizeElement = this.layout.element.previousElementSibling as HTMLElement;
this.layout.element.classList.add("layout--floatb");
break;
@ -475,13 +470,6 @@ export class Dock {
case "Right":
direct = "w";
break;
case "Top":
if (index === 0) {
direct = "se";
} else {
direct = "sw";
}
break;
case "Bottom":
if (index === 0) {
direct = "ne";

View file

@ -93,9 +93,6 @@ export const resetFloatDockSize = () => {
if (!window.siyuan.layout.rightDock.pin && window.siyuan.layout.rightDock.layout.element.style.opacity === "1") {
window.siyuan.layout.rightDock.showDock(true);
}
if (!window.siyuan.layout.topDock.pin && window.siyuan.layout.topDock.layout.element.style.opacity === "1") {
window.siyuan.layout.topDock.showDock(true);
}
if (!window.siyuan.layout.bottomDock.pin && window.siyuan.layout.bottomDock.layout.element.style.opacity === "1") {
window.siyuan.layout.bottomDock.showDock(true);
}

View file

@ -77,11 +77,6 @@ export const getAllDocks = () => {
docks.push(dock);
});
});
window.siyuan.config.uiLayout.top.data.forEach((item: IDockTab[]) => {
item.forEach((dock: IDockTab) => {
docks.push(dock);
});
});
window.siyuan.config.uiLayout.bottom.data.forEach((item: IDockTab[]) => {
item.forEach((dock: IDockTab) => {
docks.push(dock);

View file

@ -75,9 +75,6 @@ export const getDockByType = (type: TDockType) => {
if (window.siyuan.layout.bottomDock.data[type]) {
return window.siyuan.layout.bottomDock;
}
if (window.siyuan.layout.topDock.data[type]) {
return window.siyuan.layout.topDock;
}
};
export const switchWnd = (newWnd: Wnd, targetWnd: Wnd) => {
@ -155,7 +152,6 @@ export const exportLayout = (reload: boolean, cb?: () => void) => {
const layoutJSON: any = {
hideDock: useElement.getAttribute("xlink:href") === "#iconDock",
layout: {},
top: dockToJSON(window.siyuan.layout.topDock),
bottom: dockToJSON(window.siyuan.layout.bottomDock),
left: dockToJSON(window.siyuan.layout.leftDock),
right: dockToJSON(window.siyuan.layout.rightDock),
@ -171,8 +167,7 @@ export const exportLayout = (reload: boolean, cb?: () => void) => {
};
const JSONToDock = (json: any) => {
window.siyuan.layout.centerLayout = window.siyuan.layout.layout.children[1].children[1] as Layout;
window.siyuan.layout.topDock = new Dock({position: "Top", data: json.top});
window.siyuan.layout.centerLayout = window.siyuan.layout.layout.children[0].children[1] as Layout;
window.siyuan.layout.leftDock = new Dock({position: "Left", data: json.left});
window.siyuan.layout.rightDock = new Dock({position: "Right", data: json.right});
window.siyuan.layout.bottomDock = new Dock({position: "Bottom", data: json.bottom});
@ -706,7 +701,6 @@ export const addResize = (obj: Layout | Wnd) => {
resizeTabs();
if (!isWindow()) {
window.siyuan.layout.leftDock.setSize();
window.siyuan.layout.topDock.setSize();
window.siyuan.layout.bottomDock.setSize();
window.siyuan.layout.rightDock.setSize();
}

View file

@ -9,8 +9,6 @@ const moveMenuItem = (label: string, target: Element) => {
window.siyuan.layout.leftDock.add(label.endsWith("Top") ? 0 : 1, target);
} else if (label.indexOf("moveToRight") > -1) {
window.siyuan.layout.rightDock.add(label.endsWith("Top") ? 0 : 1, target);
} else if (label.indexOf("moveToTop") > -1) {
window.siyuan.layout.topDock.add(label.endsWith("Left") ? 0 : 1, target);
} else if (label.indexOf("moveToBottom") > -1) {
window.siyuan.layout.bottomDock.add(label.endsWith("Left") ? 0 : 1, target);
}
@ -24,8 +22,6 @@ export const initDockMenu = (target: Element) => {
window.siyuan.menus.menu.append(moveMenuItem("moveToLeftBottom", target).element);
window.siyuan.menus.menu.append(moveMenuItem("moveToRightTop", target).element);
window.siyuan.menus.menu.append(moveMenuItem("moveToRightBottom", target).element);
window.siyuan.menus.menu.append(moveMenuItem("moveToTopLeft", target).element);
window.siyuan.menus.menu.append(moveMenuItem("moveToTopRight", target).element);
window.siyuan.menus.menu.append(moveMenuItem("moveToBottomLeft", target).element);
window.siyuan.menus.menu.append(moveMenuItem("moveToBottomRight", target).element);
return window.siyuan.menus.menu;

View file

@ -64,7 +64,6 @@ export const workspaceMenu = (rect: DOMRect) => {
dockMenu.push(togglePinDock(window.siyuan.layout.leftDock, "iconLeftTop"));
dockMenu.push(togglePinDock(window.siyuan.layout.rightDock, "iconRightTop"));
dockMenu.push(togglePinDock(window.siyuan.layout.bottomDock, "iconBottomLeft"));
dockMenu.push(togglePinDock(window.siyuan.layout.topDock, "iconTopLeft"));
}
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.panels,

View file

@ -204,7 +204,6 @@ interface ISiyuan {
layout?: {
layout?: import("../layout").Layout,
centerLayout?: import("../layout").Layout,
topDock?: import("../layout/dock").Dock,
leftDock?: import("../layout/dock").Dock,
rightDock?: import("../layout/dock").Dock,
bottomDock?: import("../layout/dock").Dock,

View file

@ -101,7 +101,7 @@ export const globalShortcut = () => {
if (!window.siyuan.layout.leftDock.pin && window.siyuan.layout.leftDock.layout.element.clientWidth > 0 &&
// 隐藏停靠栏会导致点击两侧内容触发浮动面板弹出,因此需减小鼠标范围
(window.siyuan.layout.leftDock.element.clientWidth > 0 || (window.siyuan.layout.leftDock.element.clientWidth === 0 && event.clientX < 8))) {
if (event.clientY > document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight &&
if (event.clientY > document.getElementById("toolbar").clientHeight &&
event.clientY < window.innerHeight - document.getElementById("status").clientHeight - document.getElementById("dockBottom").clientHeight) {
if (!hasClosestByClassName(event.target, "b3-menu") &&
!hasClosestByClassName(event.target, "layout--float")) {
@ -114,7 +114,7 @@ export const globalShortcut = () => {
} else if (event.clientX > window.innerWidth - 41) {
if (!window.siyuan.layout.rightDock.pin && window.siyuan.layout.rightDock.layout.element.clientWidth > 0 &&
(window.siyuan.layout.rightDock.element.clientWidth > 0 || (window.siyuan.layout.rightDock.element.clientWidth === 0 && event.clientX > window.innerWidth - 8))) {
if (event.clientY > document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight &&
if (event.clientY > document.getElementById("toolbar").clientHeight &&
event.clientY < window.innerHeight - document.getElementById("status").clientHeight - document.getElementById("dockBottom").clientHeight) {
if (!hasClosestByClassName(event.target, "layout--float")) {
window.siyuan.layout.rightDock.showDock();
@ -125,9 +125,7 @@ export const globalShortcut = () => {
}
}
if (event.clientY < 75) {
window.siyuan.layout.topDock.showDock();
} else if (event.clientY > window.innerHeight - 73) {
if (event.clientY > window.innerHeight - 73) {
window.siyuan.layout.bottomDock.showDock();
}
}
@ -835,9 +833,6 @@ export const globalShortcut = () => {
// dock float 时,点击空白处,隐藏 dock
const floatDockLayoutElement = hasClosestByClassName(event.target, "layout--float", true);
if (floatDockLayoutElement) {
if (!floatDockLayoutElement.isSameNode(window.siyuan.layout.topDock.layout.element)) {
window.siyuan.layout.topDock.hideDock();
}
if (!floatDockLayoutElement.isSameNode(window.siyuan.layout.bottomDock.layout.element)) {
window.siyuan.layout.bottomDock.hideDock();
}
@ -848,7 +843,6 @@ export const globalShortcut = () => {
window.siyuan.layout.rightDock.hideDock();
}
} else if (!hasClosestByClassName(event.target, "dock") && !isWindow()) {
window.siyuan.layout.topDock.hideDock();
window.siyuan.layout.bottomDock.hideDock();
window.siyuan.layout.leftDock.hideDock();
window.siyuan.layout.rightDock.hideDock();