Skip to content

Commit

Permalink
修改插件图标获取逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
zlk-sys committed Oct 15, 2024
1 parent dc42205 commit 1d69f96
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Helpers/pluginHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ def run_plugins(parent):
get_v.close()
if data["type"] == "Bar" and os.path.basename(folder) == plugin_name:
#icon = f'plugins/{plugin_name}/{data["icon"]}'
if os.path.exists(data["show_icon"]):
icon = data["show_icon"]
else:
icon = os.path.join(folder, data["show_icon"])
icon = data["show_icon"]
#icon = "resource/logo.png"
name = data["name"]
if cfg.debug_card.value:
Expand All @@ -95,7 +92,11 @@ def run_plugins_plugin(parent, PluginsGroup):
get_json = open(f"{folder}/index.json", "r", encoding="utf-8")
data = json.loads(get_json.read())
get_json.close()
addCard(parent, PluginsGroup, data["icon"], data["name"], data["desc"], data["type"], folder)
if os.path.exists(data["icon"]):
icon = data["icon"]
else:
icon = os.path.join(folder, data["icon"])
addCard(parent, PluginsGroup, icon, data["name"], data["desc"], data["type"], folder)


def open_plugin_window(plugin, parent):
Expand Down

0 comments on commit 1d69f96

Please sign in to comment.