mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +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 {promiseTransactions} from "./protyle/wysiwyg/transaction";
|
||||
import {initMessage} from "./dialog/message";
|
||||
import {resizeDrag} from "./layout/util";
|
||||
|
||||
class App {
|
||||
constructor() {
|
||||
|
|
@ -81,12 +82,7 @@ class App {
|
|||
window.siyuan.user = userResponse.data;
|
||||
onGetConfig();
|
||||
account.onSetaccount();
|
||||
const dragElement = document.getElementById("drag");
|
||||
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";
|
||||
}
|
||||
resizeDrag();
|
||||
setTitle(window.siyuan.languages.siyuanNote);
|
||||
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 = () => {
|
||||
const models = getAllModels();
|
||||
models.editor.forEach((item) => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
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";
|
||||
/// #if !BROWSER
|
||||
import {ipcRenderer} from "electron";
|
||||
|
|
@ -142,6 +142,7 @@ export const onGetConfig = () => {
|
|||
window.clearTimeout(resizeTimeout);
|
||||
resizeTimeout = window.setTimeout(() => {
|
||||
resizeTabs();
|
||||
resizeDrag();
|
||||
}, 200);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue