新增DARK_MODE选项,可选择默认颜色模式
This commit is contained in:
parent
5a83b3b096
commit
1eb0174dff
@ -33,6 +33,7 @@ CODE_HIGHLIGHT = True
|
|||||||
|
|
||||||
# 窗口布局
|
# 窗口布局
|
||||||
LAYOUT = "LEFT-RIGHT" # "LEFT-RIGHT"(左右布局) # "TOP-DOWN"(上下布局)
|
LAYOUT = "LEFT-RIGHT" # "LEFT-RIGHT"(左右布局) # "TOP-DOWN"(上下布局)
|
||||||
|
DARK_MODE = True # "LEFT-RIGHT"(左右布局) # "TOP-DOWN"(上下布局)
|
||||||
|
|
||||||
# 发送请求到OpenAI后,等待多久判定为超时
|
# 发送请求到OpenAI后,等待多久判定为超时
|
||||||
TIMEOUT_SECONDS = 30
|
TIMEOUT_SECONDS = 30
|
||||||
|
4
main.py
4
main.py
@ -186,7 +186,9 @@ def main():
|
|||||||
print(f"\t(暗色主题): http://localhost:{PORT}/?__dark-theme=true")
|
print(f"\t(暗色主题): http://localhost:{PORT}/?__dark-theme=true")
|
||||||
def open():
|
def open():
|
||||||
time.sleep(2) # 打开浏览器
|
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=open, name="open-browser", daemon=True).start()
|
||||||
threading.Thread(target=auto_update, name="self-upgrade", 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()
|
threading.Thread(target=warm_up_modules, name="warm-up", daemon=True).start()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user