diff --git a/assets/github_dark.png b/assets/github_dark.png new file mode 100644 index 0000000..8b25551 Binary files /dev/null and b/assets/github_dark.png differ diff --git a/assets/github_light.png b/assets/github_light.png new file mode 100644 index 0000000..628da97 Binary files /dev/null and b/assets/github_light.png differ diff --git a/src/about.py b/src/about.py new file mode 100644 index 0000000..e9f5fd9 --- /dev/null +++ b/src/about.py @@ -0,0 +1,21 @@ +import tkinter, darkdetect, webbrowser +from tkinter import ttk +import vars as v + +def dark(): + if v.cfg["theme"] == "Dark" or (v.cfg["theme"] == "System" and darkdetect.isDark()): + return True + else: + return False + +def build(): + root = tkinter.Toplevel() + root.title("About Onyx") + root.geometry("550x200") + root.resizable(False, False) + + logolabel = tkinter.Label(root, image=v.logo).place(x=10, y=20) + name = tkinter.Label(root, text="Onyx", font=("Segoe UI", 40, "bold")).place(x=210, y=30) + version = tkinter.Label(root, text="Version {}".format(v.ver.split(" ")[0]), font=("Segoe UI", 20, "")).place(x=370, y=57) + versiontype = tkinter.Label(root, text="Beta" if v.ver.endswith("beta") else "Stable", font=("Segoe UI", 20, "bold"), fg="orange" if v.ver.endswith("beta") else "green").place(x=210, y=105) + github = ttk.Button(root, text=" Github Repo", image=v.github_light if dark() else v.github_dark, compound="left", command=lambda:webbrowser.open("https://github.com/not-nef/onyx")).place(x=330, y=105) \ No newline at end of file diff --git a/src/main.py b/src/main.py index dbe9f0f..9080046 100644 --- a/src/main.py +++ b/src/main.py @@ -1,4 +1,4 @@ -ver = "0.6" +ver = "0.6 beta" import tkinter, ntkutils, pygments, darkdetect, sv_ttk from tkinter.font import Font @@ -7,7 +7,7 @@ from tkinterdnd2 import * from tklinenums import TkLineNumbers -import config, tabmanager +import config, tabmanager, about import settings.UI as settingsui from settings.images import setimages import generatesize as size @@ -95,7 +95,7 @@ def closepreview(): filemenu.add_command(label="Close Preview", command=closepreview, foreground="black") settingsmenu.add_command(label="Open Settings", command=settingsui.build, foreground="black") -settingsmenu.add_command(label="About", state="disabled") +settingsmenu.add_command(label="About", command=about.build, foreground="black") if cfg["mica"]: if cfg["theme"] == "Dark" or (cfg["theme"] == "System" and darkdetect.isDark()): @@ -137,6 +137,7 @@ def filedrop(event): v.footer = footer v.closeimg = closeimg v.theme = theme +v.ver = ver setimages() diff --git a/src/settings/images.py b/src/settings/images.py index 2905972..257147b 100644 --- a/src/settings/images.py +++ b/src/settings/images.py @@ -7,4 +7,7 @@ def setimages(): v.keyboard_light = tkinter.PhotoImage(master=v.root, file="./assets/keyboard_light.png") v.keyboard_dark = tkinter.PhotoImage(master=v.root, file="./assets/keyboard_dark.png") v.warn_light = tkinter.PhotoImage(master=v.root, file="./assets/warn_light.png") - v.warn_dark = tkinter.PhotoImage(master=v.root, file="./assets/warn_dark.png") \ No newline at end of file + v.warn_dark = tkinter.PhotoImage(master=v.root, file="./assets/warn_dark.png") + v.logo = tkinter.PhotoImage(master=v.root, file="./assets/logo.png") + v.github_dark = tkinter.PhotoImage(master=v.root, file="./assets/github_dark.png") + v.github_light = tkinter.PhotoImage(master=v.root, file="./assets/github_light.png") \ No newline at end of file diff --git a/src/vars.py b/src/vars.py index 4a03086..bfebb00 100644 --- a/src/vars.py +++ b/src/vars.py @@ -13,10 +13,14 @@ tabbar = "" footer = "" theme = "" +ver = "" brush_light = "" brush_dark = "" keyboard_light = "" keyboard_dark = "" warn_light = "" -warn_dark = "" \ No newline at end of file +warn_dark = "" +logo = "" +github_dark = "" +github_light = "" \ No newline at end of file