简化LayoutPersistence构造函数参数,移除冗余的layoutState参数

This commit is contained in:
2025-10-20 09:50:00 +08:00
parent d663118a73
commit feaa0ed3a9
2 changed files with 117 additions and 77 deletions

View File

@@ -26,19 +26,12 @@ export class LayoutManager {
*/
initialize() {
// 创建布局持久化实例
// 直接传入store对象让LayoutPersistence能够访问最新的面板数据
// 创建布局持久化实例
// 优化LayoutPersistence构造函数已简化只需要store对象和storageKey
this.layoutPersistence = new LayoutPersistence(
{
leftPanelArea: this.store.leftPanelArea,
rightPanelArea: this.store.rightPanelArea,
topPanelArea: this.store.topPanelArea,
bottomPanelArea: this.store.bottomPanelArea,
centerPanelArea: this.store.centerPanelArea,
floatingWindows: this.store.floatingWindows,
},
{
activeCenterTab: this.store.activeCenterTab,
minimizedWindows: this.store.minimizedWindows
}
this.store,
'dockPanelLayout'
);
// 创建调整大小处理器