mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
This commit is contained in:
parent
44e43d620a
commit
efaa544973
3 changed files with 14 additions and 7 deletions
|
|
@ -14,6 +14,7 @@ import {openFileById} from "./editor/util";
|
||||||
import {bootSync, downloadProgress, progressLoading, setTitle, transactionError} from "./dialog/processSystem";
|
import {bootSync, downloadProgress, progressLoading, setTitle, transactionError} from "./dialog/processSystem";
|
||||||
import {promiseTransactions} from "./protyle/wysiwyg/transaction";
|
import {promiseTransactions} from "./protyle/wysiwyg/transaction";
|
||||||
import {initMessage} from "./dialog/message";
|
import {initMessage} from "./dialog/message";
|
||||||
|
import {resizeDrag} from "./layout/util";
|
||||||
|
|
||||||
class App {
|
class App {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -81,12 +82,7 @@ class App {
|
||||||
window.siyuan.user = userResponse.data;
|
window.siyuan.user = userResponse.data;
|
||||||
onGetConfig();
|
onGetConfig();
|
||||||
account.onSetaccount();
|
account.onSetaccount();
|
||||||
const dragElement = document.getElementById("drag");
|
resizeDrag();
|
||||||
if ("windows" !== window.siyuan.config.system.os && "linux" !== window.siyuan.config.system.os) {
|
|
||||||
dragElement.style.paddingRight = dragElement.getBoundingClientRect().left + "px";
|
|
||||||
} else {
|
|
||||||
dragElement.style.paddingRight = (dragElement.getBoundingClientRect().left - document.querySelector("#windowControls").clientWidth) + "px";
|
|
||||||
}
|
|
||||||
setTitle(window.siyuan.languages.siyuanNote);
|
setTitle(window.siyuan.languages.siyuanNote);
|
||||||
initMessage();
|
initMessage();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -394,6 +394,16 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const resizeDrag = () => {
|
||||||
|
const dragElement = document.getElementById("drag");
|
||||||
|
const right = dragElement.getBoundingClientRect().left - document.querySelector("#windowControls").clientWidth
|
||||||
|
if (right < dragElement.clientWidth) {
|
||||||
|
dragElement.style.paddingRight = right + "px";
|
||||||
|
} else {
|
||||||
|
dragElement.style.paddingRight = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const resizeTabs = () => {
|
export const resizeTabs = () => {
|
||||||
const models = getAllModels();
|
const models = getAllModels();
|
||||||
models.editor.forEach((item) => {
|
models.editor.forEach((item) => {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import {openSearch} from "../search/spread";
|
import {openSearch} from "../search/spread";
|
||||||
import {exportLayout, JSONToLayout, resizeTabs} from "../layout/util";
|
import {exportLayout, JSONToLayout, resizeDrag, resizeTabs} from "../layout/util";
|
||||||
import {hotKey2Electron, updateHotkeyTip} from "../protyle/util/compatibility";
|
import {hotKey2Electron, updateHotkeyTip} from "../protyle/util/compatibility";
|
||||||
/// #if !BROWSER
|
/// #if !BROWSER
|
||||||
import {ipcRenderer} from "electron";
|
import {ipcRenderer} from "electron";
|
||||||
|
|
@ -142,6 +142,7 @@ export const onGetConfig = () => {
|
||||||
window.clearTimeout(resizeTimeout);
|
window.clearTimeout(resizeTimeout);
|
||||||
resizeTimeout = window.setTimeout(() => {
|
resizeTimeout = window.setTimeout(() => {
|
||||||
resizeTabs();
|
resizeTabs();
|
||||||
|
resizeDrag();
|
||||||
}, 200);
|
}, 200);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue