From 1eb0174dfffc8a8cfbafc9a87af9f0af93f79d9d Mon Sep 17 00:00:00 2001 From: binary-husky <505030475@qq.com> Date: Thu, 27 Apr 2023 10:58:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EDARK=5FMODE=E9=80=89=E9=A1=B9?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E9=80=89=E6=8B=A9=E9=BB=98=E8=AE=A4=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 1 + main.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index 688f35d..2901343 100644 --- a/config.py +++ b/config.py @@ -33,6 +33,7 @@ CODE_HIGHLIGHT = True # 窗口布局 LAYOUT = "LEFT-RIGHT" # "LEFT-RIGHT"(左右布局) # "TOP-DOWN"(上下布局) +DARK_MODE = True # "LEFT-RIGHT"(左右布局) # "TOP-DOWN"(上下布局) # 发送请求到OpenAI后,等待多久判定为超时 TIMEOUT_SECONDS = 30 diff --git a/main.py b/main.py index 29ac825..cb14776 100644 --- a/main.py +++ b/main.py @@ -186,7 +186,9 @@ def main(): print(f"\t(暗色主题): http://localhost:{PORT}/?__dark-theme=true") def open(): time.sleep(2) # 打开浏览器 - webbrowser.open_new_tab(f"http://localhost:{PORT}/?__dark-theme=true") + DARK_MODE, = get_conf('DARK_MODE') + if DARK_MODE: webbrowser.open_new_tab(f"http://localhost:{PORT}/?__dark-theme=true") + else: webbrowser.open_new_tab(f"http://localhost:{PORT}") threading.Thread(target=open, name="open-browser", daemon=True).start() threading.Thread(target=auto_update, name="self-upgrade", daemon=True).start() threading.Thread(target=warm_up_modules, name="warm-up", daemon=True).start()