Skip to content

Commit

Permalink
🎨 帮助界面优化
Browse files Browse the repository at this point in the history
  • Loading branch information
HibiKier committed Oct 18, 2024
1 parent 3ffe213 commit 6dfebaa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions zhenxun/builtin_plugins/help/zhenxun_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,22 @@ def build_plugin_data(classify: dict[str, list[Item]]) -> list[dict[str, str]]:
for menu, value in classify.items()
]
plugin_list = build_line_data(plugin_list)

plugin_list.insert(
0,
build_plugin_line(
menu_key if menu_key not in ["normal", "功能"] else "主要功能",
max_data,
30,
100,
True,
),
)
return plugin_list


def build_plugin_line(
name: str, items: list, left: int, width: int | None = None
name: str, items: list, left: int, width: int | None = None, is_max: bool = False
) -> dict:
"""构造插件行数据
Expand All @@ -84,13 +86,14 @@ def build_plugin_line(
items: 插件名称列表
left: 左边距
width: 总插件长度.
is_max: 是否为最大长度的插件菜单
返回:
dict: 插件数据
"""
_plugins = []
width = width or 50
if len(items) // 2 > 6:
if len(items) // 2 > 6 or is_max:
width = 100
plugin_list1 = []
plugin_list2 = []
Expand Down

0 comments on commit 6dfebaa

Please sign in to comment.