1.7.0实现

This commit is contained in:
2022-07-08 04:02:21 +08:00
parent d3970b8b28
commit 7f18273cca
15 changed files with 225 additions and 79 deletions

View File

@@ -46,6 +46,10 @@ def OpenGiteeIssues():
def OpenGithubIssues():
webbrowser.open_new_tab("https://github.com/gfdgd-xi/uengine-runner/issues")
# 获取用户主目录
def get_home()->"获取用户主目录":
return os.path.expanduser('~')
###########################
# 程序信息
###########################
@@ -57,7 +61,20 @@ version = information["Version"]
###########################
# 窗口创建
###########################
window = tk.Tk()
# 读取主题
try:
theme = not ("dark" in readtxt(get_home() + "/.gtkrc-2.0") and "gtk-theme-name=" in readtxt(get_home() + "/.gtkrc-2.0"))
except:
print("主题读取错误,默认使用浅色主题")
theme = True
if theme:
window = tk.Tk()
themes = ttkthemes.ThemedStyle(window)
themes.set_theme("breeze")
else:
import ttkbootstrap
style = ttkbootstrap.Style(theme="darkly")
window = style.master # 创建窗口
win = ttk.Frame()
starValue = tk.StringVar()
@@ -84,8 +101,6 @@ githubButton = ttk.Button(otherUpload, text="Github Issues", command=OpenGithubI
updateButton = ttk.Button(win, text="提交", command=UpdateButtonClick)
# 设置窗口
style = ttkthemes.ThemedStyle(window)
style.set_theme("breeze")
window.title("UEngine 运行器 {} 问题/建议反馈".format(version))
window.resizable(0, 0)
window.iconphoto(False, tk.PhotoImage(file=iconPath))