Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Commit 37dee28

Browse files
committed
refactor(ui): Remove animation comment and clean up whitespace in main window
1 parent b2029e3 commit 37dee28

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

ui/main_window.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ def build(self, page: ft.Page):
204204
ft.Container(content=self.about_page.control, expand=True, visible=False),
205205
]
206206

207-
# 使用简单的 Container,不使用动画避免崩溃
208207
self.content_area = ft.Container(
209208
content=self.home_page.control,
210209
expand=True,
@@ -347,10 +346,10 @@ def _navigate_to(self, index: int):
347346
self.llbot_config_page.on_page_leave()
348347
logger.debug(f"页面离开耗时: {(time.perf_counter() - t1) * 1000:.2f}ms")
349348

350-
# 替换内容(使用缓存的控件引用)
349+
# 替换内容(使用缓存的控件引用)+ 淡入淡出动画
351350
t2 = time.perf_counter()
352351
logger.debug(f"准备替换内容: 从 {old_index}{index}")
353-
352+
354353
# 直接使用预先存储的控件引用,避免每次创建列表
355354
if index == 0:
356355
new_content = self.home_page.control
@@ -365,12 +364,13 @@ def _navigate_to(self, index: int):
365364
else:
366365
logger.error(f"无效的页面索引: {index}")
367366
return
368-
367+
369368
logger.debug(f"旧控件类型: {type(self.content_area.content).__name__}")
370369
logger.debug(f"新控件类型: {type(new_content).__name__}")
371-
370+
372371
self.content_area.content = new_content
373-
logger.debug("内容替换完成")
372+
373+
logger.debug("内容替换完成(带动画)")
374374
logger.debug(f"替换内容耗时: {(time.perf_counter() - t2) * 1000:.2f}ms")
375375

376376
# 更新导航按钮

0 commit comments

Comments
 (0)