mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-05 16:28:49 +01:00
🎨 tab 最小化
This commit is contained in:
parent
fb5021a018
commit
a3c28bbb4d
2 changed files with 6 additions and 2 deletions
|
|
@ -126,7 +126,9 @@ export const onGetConfig = (isStart: boolean, app: App) => {
|
|||
window.siyuan.emojis = response.data as IEmoji[];
|
||||
try {
|
||||
JSONToLayout(app, isStart);
|
||||
adjustLayout();
|
||||
setTimeout(() => {
|
||||
adjustLayout();
|
||||
}); // 等待 dock 中 !this.pin 的 setTimeout
|
||||
/// #if !BROWSER
|
||||
sendGlobalShortcut(app);
|
||||
/// #endif
|
||||
|
|
|
|||
|
|
@ -876,7 +876,8 @@ export const adjustLayout = (layout: Layout = window.siyuan.layout.centerLayout.
|
|||
}
|
||||
});
|
||||
let lastItem: HTMLElement;
|
||||
while (layout.element.scrollWidth > layout.element.clientWidth) {
|
||||
let index = Math.floor(window.innerWidth / 24);
|
||||
while (layout.element.scrollWidth > layout.element.clientWidth && index > 0) {
|
||||
layout.children.find((item: Layout | Wnd) => {
|
||||
if (item.element.style.width && item.element.style.width !== "0px") {
|
||||
item.element.style.maxWidth = Math.max(Math.min(item.element.clientWidth, window.innerWidth) - 8, 64) + "px";
|
||||
|
|
@ -886,6 +887,7 @@ export const adjustLayout = (layout: Layout = window.siyuan.layout.centerLayout.
|
|||
return true;
|
||||
}
|
||||
});
|
||||
index--;
|
||||
}
|
||||
if (lastItem) {
|
||||
lastItem.style.maxWidth = Math.max(Math.min(lastItem.clientWidth, window.innerWidth) - 8, 64) + "px";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue