mirror of
https://gitcode.com/JianFeeeee/TrulyMEM-TrueHumanMEM.git
synced 2026-10-04 00:14:26 +00:00
feat: 实现流式消息显示和界面优化
This commit is contained in:
@ -15,22 +15,13 @@ class StatusBar(Static):
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self._focus_indicator = "[Input]"
|
||||
self._shortcuts = "F1:帮助 F2:侧边栏 F3:工具详情 F4:查询 F5:清屏 F6:退出"
|
||||
self._license_info = "本项目由jianf设计,以GPLv3形式开源"
|
||||
|
||||
def on_mount(self) -> None:
|
||||
"""组件挂载时"""
|
||||
self._update_display()
|
||||
|
||||
def update_focus(self, focus_name: str) -> None:
|
||||
"""更新焦点指示器"""
|
||||
self._focus_indicator = f"[{focus_name}]"
|
||||
self._update_display()
|
||||
|
||||
def _update_display(self) -> None:
|
||||
"""更新显示"""
|
||||
self.update(f"{self._shortcuts} | 焦点: {self._focus_indicator}")
|
||||
|
||||
def get_focus(self) -> str:
|
||||
"""获取当前焦点"""
|
||||
return self._focus_indicator
|
||||
self.update(f"{self._license_info} | {self._shortcuts}")
|
||||
|
||||
Reference in New Issue
Block a user